# GstMLInfo

Source: [https://docs.qualcomm.com/doc/80-70014-50/topic/ml-api-gstmlinfo.html](https://docs.qualcomm.com/doc/80-70014-50/topic/ml-api-gstmlinfo.html)

GstMLInfo represents the information structure describing the machine learning
        properties. This information can be filled in from GstCaps with
            gst\_ml\_info\_from\_caps().

Table : Information structure describing ML properties

| Field | Description |
| --- | --- |
| `type (GstMLType)` | Type of the tensors |
| `n_tensors (guint)` | Number of tensors |
| `n_dimensions (guint)` | Number of dimensions for each tensor |
| `tensors (guint)` | Array with tensor dimensions |

## gst\_ml\_info\_init

Initializes the GstMLInfo fields.

**Prototype**

    void
             gst_ml_info_init (GstMLInfo * info)
    Copy to clipboard

**Parameters**

| [in] | `info` | A GstMLInfo |
| :--- | :--- | :--- |

**Returns**

None

## gst\_ml\_info\_new

Copies a GstMLInfo structure.

**Prototype**

    GstMLInfo *
             gst_ml_info_new (void)Copy to clipboard

**Returns**

A new GstMLInfo. Free with gst\_ml\_info\_free().

## gst\_ml\_info\_copy

Copies a GstMLInfo structure.

**Prototype**

    GstMLInfo *
    gst_ml_info_copy (const GstMLInfo * info)
    Copy to clipboard

| [in] | `info` | A GstMLInfo |
| :--- | :--- | :--- |

**Returns**

A new GstMLInfo. Free with gst\_ml\_info\_free().

## gst\_ml\_info\_free

Frees a GstMLInfo structure previously allocated with
                    gst\_ml\_info\_new() or
                gst\_ml\_info\_copy().

**Prototype**

    void
    gst_ml_info_free (const GstMLInfo * info)
    Copy to clipboard

**Parameters**

| [in] | `info` | A GstMLInfo |
| :--- | :--- | :--- |

**Returns**

None

## gst\_ml\_info\_from\_caps

Parses the capabilities (caps) and updates the caps information.

**Prototype**

    gboolean 
    gst_ml_info_from_caps (GstMLInfo * info, const GstCaps  * caps)
    Copy to clipboard

**Parameters**

| [in] | `info` | A GstMLInfo |
| :--- | :--- | :--- |
| [in] | `caps` | A GstCaps |

**Returns**

TRUE if the operation was successful

## gst\_ml\_info\_to\_caps

Converts the values of info into a GstCaps.

**Prototype**

    GstCaps *  
    gst_ml_info_to_caps (const GstMLInfo * info)
    Copy to clipboard

**Parameters**

| [in] | `info` | A GstMLInfo |
| :--- | :--- | :--- |

**Returns**

A new [GstCaps](https://gstreamer.freedesktop.org/documentation/gstreamer/gstcaps.html) containing the information.

## gst\_ml\_info\_is\_equal

Compares two GstMLInfo and returns whether they are equal.

**Prototype**

    gboolean
    gst_ml_info_is_equal (const GstMLInfo * l_info, const GstMLInfo * r_info)
    Copy to clipboard

**Parameters**

| [in] | `l_info` | A GstMLInfo |
| :--- | :--- | :--- |
| [in] | `r_info` | A GstMLInfo |

**Returns**

TRUE if the operation was successful.

## gst\_ml\_info\_tensor\_size

Calculates the size of the tensor specified by its index from GstMLInfo.

**Prototype**

    gsize
    gst_ml_info_tensor_size (const GstMLInfo * info, guint index)
    Copy to clipboard

**Parameters**

| [in] | `info` | A GstMLInfo |
| :--- | :--- | :--- |
| [in] | `index` | The tensor index |

**Returns**

The size in bytes.

## gst\_ml\_info\_size

Calculates the total size of all the tensors inside GstMLInfo.

**Prototype**

    gsize
    gst_ml_info_size (const GstMLInfo * info)
    Copy to clipboard

**Parameters**

| [in] | `info` | A GstMLInfo |
| --- | --- | --- |

**Returns**

The size in bytes.

**Parent Topic:** [Machine learning APIs](https://docs.qualcomm.com/doc/80-70014-50/topic/machine-learning-apis.html)

Last Published: Oct 27, 2025

[Previous Topic
GstMLType](https://docs.qualcomm.com/bundle/publicresource/80-70014-50/topics/ml-api-gstmltype.md) [Next Topic
GstMLTensorMeta](https://docs.qualcomm.com/bundle/publicresource/80-70014-50/topics/ml-api-gstmltensormeta.md)