# Machine learning APIs

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/machine-learning-apis.html](https://docs.qualcomm.com/doc/80-70022-50/topic/machine-learning-apis.html)

Configure the tensor-specific requirements and machine learning
        properties.

## GstMLType

The following table lists the possible values describing the tensor
                    format:

| Enumeration | Description |
| --- | --- |
| GST\_ML\_TYPE\_UNKNOWN | Invalid data |
| GST\_ML\_TYPE\_INT8 | Data is represented as 1 byte of signed integer value |
| GST\_ML\_TYPE\_UINT8 | Data is represented as 1 byte of unsigned integer value |
| GST\_ML\_TYPE\_INT32 | Data is represented as 4 bytes of signed integer value |
| GST\_ML\_TYPE\_UINT32 | Data is represented as 4 bytes of unsigned integer value |
| GST\_ML\_TYPE\_FLOAT16 | Data is represented as 2 bytes of floating-point value |
| GST\_ML\_TYPE\_FLOAT32 | Data is represented as 4 bytes of floating-point value |

The following list provides information on each of the GstMLType APIs:

- **gst\_ml\_type\_get\_size**
    Returns the size of the GstMLType in
                            bytes.

    **Prototype**

        guint
        gst_ml_type_get_size (GstMLType type)
        Copy to clipboard

    **Parameters**

| [in] | `type` | A GstMLType |
    | :--- | :--- | :--- |

    **Returns**

    The size in bytes.
- **gst\_ml\_type\_from\_string**
                    
    Returns GstMLType based on its string
                            version.

    **Prototype**

        GstMLType
        gst_ml_type_from_string (const gchar * type)
        Copy to clipboard

    **Parameters**

| [in] | `type` | A char string version of a GstMLType |
    | :--- | :--- | :--- |

    **Returns**

    A GstMLType
- **gst\_ml\_type\_to\_string**
    Returns a char string version of a
                            GstMLType.

        const gchar *
        gst_ml_type_to_string (GstMLType type)
        Copy to clipboard

    **Parameters**

| [in] | `type` | A string version of a GstMLType |
    | :--- | :--- | :--- |

    **Returns**

    A new char string version of a
                    GstMLType

## GstMLInfo

gst\_ml\_info\_from\_caps() is used to add the information on the ML
                properties from GstCaps.

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 |

The following list provides information on each of the GstMLInfo APIs:

- **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're
                            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.

## GstMLTensorMeta

These APIs are based on [GstMeta](https://gstreamer.freedesktop.org/documentation/gstreamer/gstmeta.html?gi-language=c), which is a member of the [GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html?gi-language=c) metadata structure.

Table : GstMLTensorMeta information structure

| Field | Description |
| --- | --- |
| meta ([GstMeta](https://gstreamer.freedesktop.org/documentation/gstreamer/gstmeta.html?gi-language=c)) | GstMeta is the parent |
| id (guint) | ID corresponding to the memory index in [GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html?gi-language=c) |
| type (GstMLType) | Tensor type |
| n\_dimensions (guint) | Number of tensor dimensions |
| dimensions (guint) | Array of tensor dimensions |

The following list provides information on each of the GstMLTensorMeta APIs:

- **gst\_buffer\_add\_ml\_tensor\_meta**
    Attaches GstMLTensorMeta metadata to a
                        buffer with the given
                            parameters.

    **Prototype**

        GstMLTensorMeta *
        gst_buffer_add_ml_tensor_meta (GstBuffer * buffer, const GstMLType type, const guint n_dimensions, const guint dimensions[GST_ML_TENSOR_MAX_DIMS])Copy to clipboard

    **Parameters**

| [in] | `buffer` | A [GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html?gi-language=c) |
    | :--- | :--- | :--- |
    | [in] | `type` | The tensor type. |
    | [in] | `n_dimensions` | The number of tensor dimensions. |
    | [in] | `dimensions` | The array that has the tensor dimensions. |

    **Returns**

    The GstMLTensorMeta on buffer. Don't free after
                        the code is run.
- **gst\_buffer\_get\_ml\_tensor\_meta**
    Gets the first GstMLTensorMeta on
                        buffer.

    **Prototype**

        GstMLTensorMeta *
        gst_buffer_get_ml_tensor_meta (GstBuffer * buffer)Copy to clipboard

    **Parameters**

| [in] | `buffer` | A [GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html?gi-language=c) |
    | :--- | :--- | :--- |

    **Returns**

    The GstMLTensorMeta on buffer. Don't free after
                        the code is run.
- **gst\_buffer\_get\_ml\_tensor\_meta\_id**
    Finds the GstMLTensorMeta on buffer
                        with the given
                            ID.

    **Prototype**

        GstMLTensorMeta *
        gst_buffer_get_ml_tensor_meta_id (GstBuffer * buffer, guint id)
        Copy to clipboard

    **Parameters**

| [in] | `buffer` | A [GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html?gi-language=c) |
    | :--- | :--- | :--- |
    | [in] | `id` | A metadata ID |

    **Returns**

    The GstMLTensorMeta on buffer. Don't free after
                        the code is run.
- **gst\_ml\_meta\_tensor\_size**
    Gets the total size of the tensor in bytes,
                        which is calculated based on the dimensions and tensor
                            type.

    **Prototype**

        gsize
        gst_ml_meta_tensor_size (const GstMLTensorMeta * meta)Copy to clipboard

**Parameters**

| [in] | `meta` | A GstMLTensorMeta |
    | :--- | :--- | :--- |

    **Returns**

    The size in bytes.

## GstMLFrame

GstMLFrame is a structure obtained from gst\_ml\_frame\_map().

Table : Structure of GstMLFrame

| Field | Description |
| --- | --- |
| info (GstMLInfo) | The GstMLInfo |
| buffer ([GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html?gi-language=c)) | Mapped buffer containing the tensor memory blocks |
| map ([GstMapInfo](https://gstreamer.freedesktop.org/documentation/gstreamer/gstmemory.html?gi-language=c#GstMapInfo)) | Mappings of the tensor memory blocks |

The following list provides information on each of the GstMLFrame APIs:

- **gst\_ml\_frame\_map**
    Updates the frame values using [GstMLInfo](https://docs.qualcomm.com/doc/80-70022-50/topic/machine-learning-apis.html#machine-learning-apis__section_qqy_3ng_tcc) and
                        GstBuffer.

    1. The address is passed to the GstMLFrame structure that's allocated on
                            the stack.
    2. The gst\_ml\_frame\_map() function fills the GstMLFrame
                            structure with ML tensor-specific information to access the ML buffer
                            data. All the buffer video tensors are mapped and the pointers are set
                            in the frame data.

**Prototype**

        gboolean
        gst_ml_frame_map (GstMLFrame * frame, const GstMLInfo * info, GstBuffer * buffer, GstMapFlags flags)
        Copy to clipboard

    **Parameters**

| [in] | `frame` | Pointer to GstMLFrame |
    | :--- | :--- | :--- |
    | [in] | `info` | A GstMLInfo |
    | [in] | `buffer` | A GstBuffer |
    | [in] | `flags` | A GstMapFlags |

    **Returns**

    TRUE if the map operation was
                    successful.
- **gst\_ml\_frame\_unmap**: 
    Un-maps the memory that was earlier mapped with
                            gst\_ml\_frame\_map().

    **Prototype**

        void
        gst_ml_frame_unmap (GstMLFrame * frame)Copy to clipboard

    **Parameters**

| [in] | `frame` | Pointer to GstMLFrame |
    | :--- | :--- | :--- |

    **Returns**

    None

## GstMLBufferPool

Configure the following using GstMLBufferPool API:

- Tensor-specific requirements such as several [GstMemory](https://gstreamer.freedesktop.org/documentation/gstreamer/gstmemory.html?gi-language=c) blocks in a single [GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html?gi-language=c)
    Type of memory used
                            for allocation.
- Addition of GstMLTensorMeta to the buffers.

Figure : GstBufferPool subclass for ML
                
                <!--?xml version="1.0" encoding="UTF-8"?-->
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="1020" height="540" viewbox="0 0 1020 540">
  <g>
    <rect x=".499908447250959" y=".499994968784449" width="1019.000000000000227" height="539" rx="7.5" ry="7.5" style="fill: #fafafa;"></rect>
    <path d="M1012.000030517563573.999994968784449c3.85986328125,0,7,3.14013671875,7,7v524c0,3.85986328125-3.14013671875,7-7,7H8.000030517562664c-3.85986328125,0-7-3.14013671875-7-7V7.999994968784449C1.000030517562664,4.140131687534449,4.140167236312664.999994968784449,8.000030517562664.999994968784449h1004.000000000000909M1012.000030517563573-.000005031215551H8.000030517562664C3.581756591782323-.000005031215551.000030517562664,3.581721043003199.000030517562664,7.999994968784449v524c0,4.41827392578125,3.581726074219659,8,8,8h1004.000000000000909c4.41827392578125,0,8-3.58172607421875,8-8V7.999994968784449C1020.000030517563573,3.581721043003199,1016.418304443344823-.000005031215551,1012.000030517563573-.000005031215551h0Z" style="fill: #d2d7e1;"></path>
  </g>
  <g>
    <rect x="14.484154593857056" y="15" width="284.567017009580013" height="200" rx="4.000000000000001" ry="4.000000000000001" style="fill: #d2d7e1;"></rect>
    <text transform="translate(102.453060150131932 39.630152439487574)" style="font-family: Roboto-Medium, Roboto; font-size: 16px; font-weight: 500;"><tspan x="0" y="0">GstMLBufferPool</tspan></text>
    <text transform="translate(29.484191894516698 83.641321873081324)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0" xml:space="preserve">-  </tspan><tspan x="12.3359375" y="0" style="letter-spacing: -.010009765625em;">parent: GstBufferPool</tspan><tspan x="0" y="19.2001953125" xml:space="preserve">-  </tspan><tspan x="12.3359375" y="19.2001953125" style="letter-spacing: -.010009765625em;">priv: GstImageBufferPoolPrivate *</tspan></text>
    <line x1="14.484154593857056" y1="54.954473437824163" x2="299.051171603437069" y2="54.954473437824163" style="fill: none; stroke: #b3b7bf; stroke-miterlimit: 10;"></line>
    <rect x="347.737359347563142" y="15" width="324.567017009580923" height="200" rx="4" ry="4" style="fill: #d2d7e1;"></rect>
    <text transform="translate(467.022674560532323 39.630152439487574)" style="font-family: Roboto-Medium, Roboto; font-size: 16px; font-weight: 500;"><tspan x="0" y="0">GstBufferPool</tspan></text>
    <text transform="translate(362.737365722641698 83.641321873081324)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0" xml:space="preserve">-  object: GstObject</tspan><tspan x="0" y="19.2001953125" xml:space="preserve">-  flushing: gint</tspan><tspan x="0" y="38.39990234375" xml:space="preserve">-  priv: GstBufferPoolPrivate *</tspan><tspan x="0" y="57.60009765625" xml:space="preserve">-  started: gboolean</tspan><tspan x="0" y="76.7998046875" xml:space="preserve">-  _gst_reserved: gpointer[GST_PADDING]</tspan></text>
    <line x1="347.737359347563142" y1="54.954473437824163" x2="672.304376357144065" y2="54.954473437824163" style="fill: none; stroke: #b3b7bf; stroke-miterlimit: 10;"></line>
    <rect x="720.948828396562021" y="15" width="284.567017009580013" height="200" rx="4" ry="4" style="fill: #d2d7e1;"></rect>
    <text transform="translate(836.456756591782323 39.630152439487574)" style="font-family: Roboto-Medium, Roboto; font-size: 16px; font-weight: 500;"><tspan x="0" y="0">GstBuffer</tspan></text>
    <text transform="translate(735.948791503891698 83.641321873081324)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0" xml:space="preserve">-  mini_object: GstMiniObject</tspan><tspan x="0" y="19.2001953125" xml:space="preserve">-  pool: GstBufferPool *</tspan><tspan x="0" y="38.39990234375" xml:space="preserve">-  pts: GstClockTime</tspan><tspan x="0" y="57.60009765625" xml:space="preserve">-  dts: GstClockTime</tspan><tspan x="0" y="76.7998046875" xml:space="preserve">-  duration: GstClockTime</tspan><tspan x="0" y="96" xml:space="preserve">-  offset: guint64</tspan><tspan x="0" y="115.2001953125" xml:space="preserve">-  offset_end: guint64</tspan></text>
    <line x1="720.948828396562021" y1="54.954473437824163" x2="1005.515845406142034" y2="54.954473437824163" style="fill: none; stroke: #b3b7bf; stroke-miterlimit: 10;"></line>
    <rect x="14.484154593857056" y="263.686187744126073" width="284.567017009580013" height="261.313812255873927" rx="4" ry="4" style="fill: #d2d7e1;"></rect>
    <text transform="translate(66.199153900131932 288.316340183628199)" style="font-family: Roboto-Medium, Roboto; font-size: 16px; font-weight: 500;"><tspan x="0" y="0">GstImageBufferPoolPrivate</tspan></text>
    <text transform="translate(29.484191894516698 332.327509617221949)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0" xml:space="preserve">-  memtype: GQuark</tspan><tspan x="0" y="19.2001953125" xml:space="preserve">-  allocator: GstAllocator</tspan><tspan x="0" y="38.39990234375" xml:space="preserve">-  params: GstAllocationParams</tspan><tspan x="0" y="57.60009765625" xml:space="preserve">-  info: GstMLInfo</tspan><tspan x="0" y="76.7998046875" xml:space="preserve">-  addmeta: gboolean</tspan><tspan x="0" y="96" xml:space="preserve">-  continuous: gboolean</tspan><tspan x="0" y="115.2001953125" xml:space="preserve">-  devid: gint</tspan></text>
    <line x1="14.484154593857056" y1="303.640661181951145" x2="299.051171603437069" y2="303.640661181951145" style="fill: none; stroke: #b3b7bf; stroke-miterlimit: 10;"></line>
    <rect x="347.737359347563142" y="263.686187744126073" width="324.567017009580923" height="261.313812255873927" rx="4" ry="4" style="fill: #d2d7e1;"></rect>
    <text transform="translate(441.819549560532323 288.316340183628199)" style="font-family: Roboto-Medium, Roboto; font-size: 16px; font-weight: 500;"><tspan x="0" y="0">GstBufferPoolPrivate</tspan></text>
    <text transform="translate(362.737365722641698 332.327509617221949)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0" xml:space="preserve">-  queue: GstAtomicQueue</tspan><tspan x="0" y="19.2001953125" xml:space="preserve">-  poll: GstPoll *</tspan><tspan x="0" y="38.39990234375" xml:space="preserve">-  rec_lock: GRecMutex</tspan><tspan x="0" y="57.60009765625" xml:space="preserve">-  maxsize: gsize</tspan><tspan x="0" y="76.7998046875" xml:space="preserve">-  started: gboolean</tspan><tspan x="0" y="96" xml:space="preserve">-  active: gboolean</tspan><tspan x="0" y="115.2001953125" xml:space="preserve">-  min_buffers: guint</tspan><tspan x="0" y="134.39990234375" xml:space="preserve">-  cur_buffers: guint</tspan><tspan x="0" y="153.60009765625" xml:space="preserve">-  allocator: GstAllocator *</tspan><tspan x="0" y="172.7998046875" xml:space="preserve">-  params: GstAllocationParams</tspan></text>
    <line x1="347.737359347563142" y1="303.640661181951145" x2="672.304376357144065" y2="303.640661181951145" style="fill: none; stroke: #b3b7bf; stroke-miterlimit: 10;"></line>
    <rect x="720.948828396562021" y="263.686187744126073" width="284.567017009580013" height="261.313812255873927" rx="4" ry="4" style="fill: #d2d7e1;"></rect>
    <text transform="translate(829.183319091782323 288.316340183628199)" style="font-family: Roboto-Medium, Roboto; font-size: 16px; font-weight: 500;"><tspan x="0" y="0">GstMemory</tspan></text>
    <text transform="translate(735.948791503891698 332.327509617221949)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0" xml:space="preserve">-  mini_object: GstMiniObject</tspan><tspan x="0" y="19.2001953125" xml:space="preserve">-  allocator: GstAllocator *</tspan><tspan x="0" y="38.39990234375" xml:space="preserve">-  parent: GstMemory *</tspan><tspan x="0" y="57.60009765625" xml:space="preserve">-  maxsize: gsize</tspan><tspan x="0" y="76.7998046875" xml:space="preserve">-  align: gsize</tspan><tspan x="0" y="96" xml:space="preserve">-  offset: gsize</tspan><tspan x="0" y="115.2001953125" xml:space="preserve">-  size: gsize</tspan></text>
    <line x1="720.948828396562021" y1="303.640661181951145" x2="1005.515845406142034" y2="303.640661181951145" style="fill: none; stroke: #b3b7bf; stroke-miterlimit: 10;"></line>
    <g>
      <line x1="164.484146118149511" y1="214.999994968784449" x2="164.484161376938573" y2="255.564295505893824" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="160.495094299301854 254.397089695347859 164.484161376938573 261.305262302768824 168.473224639878026 254.397089695347859 160.495094299301854 254.397089695347859"></polygon>
    </g>
    <g>
      <line x1="517.737365722641698" y1="214.999994968784449" x2="517.737365722641698" y2="255.564295505893824" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="513.748291015610448 254.397089695347859 517.737365722641698 261.305262302768824 521.726440429672948 254.397089695347859 513.748291015610448 254.397089695347859"></polygon>
    </g>
    <g>
      <line x1="345.356445312485448" y1="114.999979709995387" x2="304.792152404770604" y2="115.000010227573512" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="305.959342956528417 111.010950779331324 299.051170349106542 115.000010227573512 305.959350585922948 118.989069675815699 305.959342956528417 111.010950779331324"></polygon>
    </g>
    <g>
      <line x1="719.779235839829198" y1="114.999979709995387" x2="679.214965820297948" y2="115.000010227573512" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
      <polygon points="680.382141113266698 111.010950779331324 673.473968505844823 115.000010227573512 680.382141113266698 118.989069675815699 680.382141113266698 111.010950779331324"></polygon>
    </g>
  </g>
</svg>

- **Prototype**
    Creates a buffer pool that can assign the ML
                    frames.

        GstBufferPool *
        gst_ml_buffer_pool_new (const gchar * type)
        Copy to clipboard
- **Parameters**

| [in] | `type` | The memory used by the pool to assign buffers. |
    | :--- | :--- | :--- |
- **Returns**
    - A new [GstBufferPool](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbufferpool.html?gi-language=c) to assign ML
                            frames.
    - Free with [gst_object_unref](https://gstreamer.freedesktop.org/documentation/gstreamer/gstobject.html#gst_object_unref).
- **Arguments**

The following table lists arguments that can be passed to
                                gst\_ml\_buffer\_pool\_new() to configure the buffer
                            memories:

    | Argument | Description | Usage |
    | --- | --- | --- |
    | GST\_ML\_BUFFER\_POOL\_TYPE\_ION | Assigns buffers by passing it as arguments<br>                                        to gst\_ml\_buffer\_pool\_new() | #define GST_ML_BUFFER_POOL_TYPE_ION "GstMLBufferPoolTypeIonMemory"Copy to clipboard |
    | GST\_ML\_BUFFER\_POOL\_TYPE\_SYSTEM | Assigns buffers by passing it as arguments<br>                                        to gst\_ml\_buffer\_pool\_new() | #define GST_ML_BUFFER_POOL_TYPE_SYSTEM "GstMLBufferPoolTypeSystemMemory"Copy to clipboard |
    | GST\_ML\_BUFFER\_POOL\_OPTION\_TENSOR\_META | Requests ML tensor metadata on buffers from the<br>                                        pool. | #define GST_ML_BUFFER_POOL_OPTION_TENSOR_META "GstMLBufferPoolOptionTensorMeta"Copy to clipboard |
    | GST\_ML\_BUFFER\_POOL\_OPTION\_CONTINUOUS | Requests all tensors to be into a continuous physical<br>                                        memory. | #define GST_ML_BUFFER_POOL_OPTION_CONTINUOUS "GstMLBufferPoolOptionContinuous"Copy to clipboard |
    |  |  |  |

**Parent Topic:** [GSt APIs](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-apis.html)

Last Published: Feb 20, 2026

[Previous Topic
Video APIs](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/video-apis.md) [Next Topic
GSt debug](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/imsdk_debug_gst.md)