gstprotection: GStreamer 1.0 Core Reference Manual

## gstprotection gstprotection — Functions and classes to support encrypted streams. |

## Functions

GstProtectionMeta * | gst_buffer_add_protection_meta ()
#define | gst_buffer_get_protection_meta()
const gchar * | gst_protection_select_system ()

## Types and Values

struct | GstProtectionMeta

## Includes

    #include <gst/gstprotection.h>

## Description

The GstProtectionMeta class enables the information needed to decrypt a GstBuffer to be attached to that buffer.

Typically, a demuxer element would attach GstProtectionMeta objects to the buffers that it pushes downstream. The demuxer would parse the protection information for a video/audio frame from its input data and use this information to populate the GstStructure `info` field, which is then encapsulated in a GstProtectionMeta object and attached to the corresponding output buffer using the `gst_buffer_add_protection_meta()` function. The information in this attached GstProtectionMeta would be used by a downstream decrypter element to recover the original unencrypted frame.

## Functions

### gst_buffer_add_protection_meta ()

    GstProtectionMeta *
    gst_buffer_add_protection_meta (GstBuffer *buffer,
                                    GstStructure *info);

Attaches protection metadata to a GstBuffer.

#### Parameters

buffer | GstBuffer holding an encrypted sample, to which protection metadata should be added. |
info | a GstStructure holding cryptographic information relating to the sample contained in `buffer` . This function takes ownership of `info` . | [transfer full]

#### Returns

a pointer to the added GstProtectionMeta if successful; `NULL` if unsuccessful.

Since: 1.6

### gst_buffer_get_protection_meta()

    #define             gst_buffer_get_protection_meta(b)

### gst_protection_select_system ()

    const gchar *
    gst_protection_select_system (const gchar **system_identifiers);

Iterates the supplied list of UUIDs and checks the GstRegistry for an element that supports one of the supplied UUIDs. If more than one element matches, the system ID of the highest ranked element is selected.

#### Parameters

system_identifiers | A null terminated array of strings that contains the UUID values of each protection system that is to be checked. | [transfer none]

#### Returns

One of the strings from `system_identifiers` that indicates the highest ranked element that implements the protection system indicated by that system ID, or `NULL` if no element has been found.

[transfer none]

Since: 1.6

## Types and Values

### struct GstProtectionMeta

    struct GstProtectionMeta {
      GstMeta meta;

      GstStructure *info;
    };

Metadata type that holds information about a sample from a protection-protected track, including the information needed to decrypt it (if it is encrypted).

#### Members

GstMeta `meta`; | the parent GstMeta. |
GstStructure *`info`; | the cryptographic information needed to decrypt the sample. |