## encoding-profile

encoding-profile — Encoding profile library

## Synopsis

    #include <gst/pbutils/encoding-profile.h>

                        GstEncodingProfile;
    #define             gst_encoding_profile_unref          (profile)
    #define             gst_encoding_profile_ref            (profile)
    GstEncodingProfile * gst_encoding_profile_find          (const gchar *targetname,
                                                             const gchar *profilename,
                                                             const gchar *category);
    GstEncodingProfile * gst_encoding_profile_from_discoverer
                                                            (GstDiscovererInfo *info);
    const gchar *       gst_encoding_profile_get_name       (GstEncodingProfile *profile);
    const gchar *       gst_encoding_profile_get_description
                                                            (GstEncodingProfile *profile);
    const GstCaps *     gst_encoding_profile_get_format     (GstEncodingProfile *profile);
    const gchar *       gst_encoding_profile_get_preset     (GstEncodingProfile *profile);
    guint               gst_encoding_profile_get_presence   (GstEncodingProfile *profile);
    const GstCaps *     gst_encoding_profile_get_restriction
                                                            (GstEncodingProfile *profile);
    void                gst_encoding_profile_set_name       (GstEncodingProfile *profile,
                                                             const gchar *name);
    void                gst_encoding_profile_set_description
                                                            (GstEncodingProfile *profile,
                                                             const gchar *description);
    void                gst_encoding_profile_set_format     (GstEncodingProfile *profile,
                                                             GstCaps *format);
    void                gst_encoding_profile_set_preset     (GstEncodingProfile *profile,
                                                             const gchar *preset);
    void                gst_encoding_profile_set_restriction
                                                            (GstEncodingProfile *profile,
                                                             GstCaps *restriction);
    void                gst_encoding_profile_set_presence   (GstEncodingProfile *profile,
                                                             guint presence);
    gboolean            gst_encoding_profile_is_equal       (GstEncodingProfile *a,
                                                             GstEncodingProfile *b);
    GstCaps *           gst_encoding_profile_get_input_caps (GstEncodingProfile *profile);
    const gchar *       gst_encoding_profile_get_type_nick  (GstEncodingProfile *profile);

                        GstEncodingContainerProfile;
    GstEncodingContainerProfile * gst_encoding_container_profile_new
                                                            (const gchar *name,
                                                             const gchar *description,
                                                             GstCaps *format,
                                                             const gchar *preset);
    gboolean            gst_encoding_container_profile_add_profile
                                                            (GstEncodingContainerProfile *container,
                                                             GstEncodingProfile *profile);
    gboolean            gst_encoding_container_profile_contains_profile
                                                            (GstEncodingContainerProfile *container,
                                                             GstEncodingProfile *profile);
    const GList *       gst_encoding_container_profile_get_profiles
                                                            (GstEncodingContainerProfile *profile);

                        GstEncodingAudioProfile;
    GstEncodingAudioProfile * gst_encoding_audio_profile_new
                                                            (GstCaps *format,
                                                             const gchar *preset,
                                                             GstCaps *restriction,
                                                             guint presence);

                        GstEncodingVideoProfile;
    GstEncodingVideoProfile * gst_encoding_video_profile_new
                                                            (GstCaps *format,
                                                             const gchar *preset,
                                                             GstCaps *restriction,
                                                             guint presence);
    guint               gst_encoding_video_profile_get_pass (GstEncodingVideoProfile *prof);
    gboolean            gst_encoding_video_profile_get_variableframerate
                                                            (GstEncodingVideoProfile *prof);
    void                gst_encoding_video_profile_set_pass (GstEncodingVideoProfile *prof,
                                                             guint pass);
    void                gst_encoding_video_profile_set_variableframerate
                                                            (GstEncodingVideoProfile *prof,
                                                             gboolean variableframerate);

    #define             GST_ENCODING_CATEGORY_DEVICE
    #define             GST_ENCODING_CATEGORY_ONLINE_SERVICE
    #define             GST_ENCODING_CATEGORY_STORAGE_EDITING
    #define             GST_ENCODING_CATEGORY_CAPTURE
                        GstEncodingTarget;
    #define             gst_encoding_target_unref           (target)
    #define             gst_encoding_target_ref             (target)
    GstEncodingTarget * gst_encoding_target_new             (const gchar *name,
                                                             const gchar *category,
                                                             const gchar *description,
                                                             const GList *profiles);
    const gchar *       gst_encoding_target_get_name        (GstEncodingTarget *target);
    const gchar *       gst_encoding_target_get_category    (GstEncodingTarget *target);
    const gchar *       gst_encoding_target_get_description (GstEncodingTarget *target);
    const GList *       gst_encoding_target_get_profiles    (GstEncodingTarget *target);
    GstEncodingProfile * gst_encoding_target_get_profile    (GstEncodingTarget *target,
                                                             const gchar *name);
    gboolean            gst_encoding_target_add_profile     (GstEncodingTarget *target,
                                                             GstEncodingProfile *profile);
    gboolean            gst_encoding_target_save            (GstEncodingTarget *target,
                                                             GError **error);
    gboolean            gst_encoding_target_save_to_file    (GstEncodingTarget *target,
                                                             const gchar *filepath,
                                                             GError **error);
    GstEncodingTarget * gst_encoding_target_load            (const gchar *name,
                                                             const gchar *category,
                                                             GError **error);
    GstEncodingTarget * gst_encoding_target_load_from_file  (const gchar *filepath,
                                                             GError **error);
    GList *             gst_encoding_list_all_targets       (const gchar *categoryname);
    GList *             gst_encoding_list_available_categories
                                                            (void);

## Object Hierarchy

      GstMiniObject
       +----GstEncodingProfile
             +----GstEncodingVideoProfile
             +----GstEncodingAudioProfile
             +----GstEncodingContainerProfile

      GstMiniObject
       +----GstEncodingProfile
             +----GstEncodingContainerProfile

      GstMiniObject
       +----GstEncodingProfile
             +----GstEncodingAudioProfile

      GstMiniObject
       +----GstEncodingProfile
             +----GstEncodingVideoProfile

      GstMiniObject
       +----GstEncodingTarget

## Description

Functions to create and handle encoding profiles.

Encoding profiles describe the media types and settings one wishes to use for an encoding process. The top-level profiles are commonly GstEncodingContainerProfile(s) (which contains a user-readable name and description along with which container format to use). These, in turn, reference one or more GstEncodingProfile(s) which indicate which encoding format should be used on each individual streams.

GstEncodingProfile(s) can be provided to the 'encodebin' element, which will take care of selecting and setting up the required elements to produce an output stream conforming to the specifications of the profile.

Unlike other systems, the encoding profiles do not specify which GstElement to use for the various encoding and muxing steps, but instead relies on specifying the format one wishes to use.

Encoding profiles can be created at runtime by the application or loaded from (and saved to) file using the GstEncodingTarget API.

### Example: Creating a profile

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26

    #include <gst/pbutils/encoding-profile.h>
    ...
    GstEncodingProfile *
    create_ogg_theora_profile(void)
    {
     GstEncodingContainerProfile *prof;
     GstCaps *caps;

     caps = gst_caps_from_string("application/ogg");
     prof = gst_encoding_container_profile_new("Ogg audio/video",
        "Standard OGG/THEORA/VORBIS",
        caps, NULL);
     gst_caps_unref (caps);

     caps = gst_caps_from_string("video/x-theora");
     gst_encoding_container_profile_add_profile(prof,
          (GstEncodingProfile*) gst_encoding_video_profile_new(caps, NULL, NULL, 0));
     gst_caps_unref (caps);

     caps = gst_caps_from_string("audio/x-vorbis");
     gst_encoding_container_profile_add_profile(prof,
          (GstEncodingProfile*) gst_encoding_audio_profile_new(caps, NULL, NULL, 0));
     gst_caps_unref (caps);

     return (GstEncodingProfile*) prof;
    }

### Example: Listing categories, targets and profiles

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27

    #include <gst/pbutils/encoding-profile.h>
    ...
    GstEncodingProfile *prof;
    GList *categories, *tmpc;
    GList *targets, *tmpt;
    ...
    categories = gst_encoding_target_list_available_categories();

    ... Show available categories to user ...

    for (tmpc = categories; tmpc; tmpc = tmpc->next) {
      gchar *category = (gchar *) tmpc->data;

      ... and we can list all targets within that category ...

      targets = gst_encoding_target_list_all (category);

      ... and show a list to our users ...

      g_list_foreach (targets, (GFunc) gst_encoding_target_unref, NULL);
      g_list_free (targets);
    }

    g_list_foreach (categories, (GFunc) g_free, NULL);
    g_list_free (categories);

    ...

## Details

### GstEncodingProfile

    typedef struct _GstEncodingProfile GstEncodingProfile;

The opaque base class object for all encoding profiles. This contains generic information like name, description, format and preset.

Since 0.10.32

### gst_encoding_profile_unref()

    #define gst_encoding_profile_unref(profile) (gst_mini_object_unref ((GstMiniObject*) profile))

Decreases the reference count of the `profile`, possibly freeing the `profile`.

`profile` : | a GstEncodingProfile

Since 0.10.32

### gst_encoding_profile_ref()

    #define gst_encoding_profile_ref(profile) (gst_mini_object_ref ((GstMiniObject*) profile))

Increases the reference count of the `profile`.

`profile` : | a GstEncodingProfile

Since 0.10.32

### gst_encoding_profile_find ()

    GstEncodingProfile * gst_encoding_profile_find          (const gchar *targetname,
                                                             const gchar *profilename,
                                                             const gchar *category);

Find the GstEncodingProfile with the specified name and category.

`targetname` : | The name of the target. [transfer none]
`profilename` : | The name of the profile. [transfer none]
`category` : | The target category. Can be `NULL`. [transfer none][allow-none]
Returns : | The matching GstEncodingProfile or `NULL`. [transfer full]

Since 0.10.32

### gst_encoding_profile_from_discoverer ()

    GstEncodingProfile * gst_encoding_profile_from_discoverer
                                                            (GstDiscovererInfo *info);

Creates a GstEncodingProfile matching the formats from the given GstEncodingProfile. Streams other than audio or video (eg, subtitles), are currently ignored.

`info` : | The GstDiscovererInfo to read from. [transfer none]
Returns : | The new GstEncodingProfile or `NULL`. [transfer full]

Since 0.10.36

### gst_encoding_profile_get_name ()

    const gchar *       gst_encoding_profile_get_name       (GstEncodingProfile *profile);

`profile` : | a GstEncodingProfile
Returns : | the name of the profile, can be `NULL`.

Since 0.10.32

### gst_encoding_profile_get_description ()

    const gchar *       gst_encoding_profile_get_description
                                                            (GstEncodingProfile *profile);

`profile` : | a GstEncodingProfile
Returns : | the description of the profile, can be `NULL`.

Since 0.10.32

### gst_encoding_profile_get_format ()

    const GstCaps *     gst_encoding_profile_get_format     (GstEncodingProfile *profile);

`profile` : | a GstEncodingProfile
Returns : | the GstCaps corresponding to the media format used in the profile.

Since 0.10.32

### gst_encoding_profile_get_preset ()

    const gchar *       gst_encoding_profile_get_preset     (GstEncodingProfile *profile);

`profile` : | a GstEncodingProfile
Returns : | the name of the GstPreset to be used in the profile.

Since 0.10.32

### gst_encoding_profile_get_presence ()

    guint               gst_encoding_profile_get_presence   (GstEncodingProfile *profile);

`profile` : | a GstEncodingProfile
Returns : | The number of times the profile is used in its parent container profile. If 0, it is not a mandatory stream.

Since 0.10.32

### gst_encoding_profile_get_restriction ()

    const GstCaps *     gst_encoding_profile_get_restriction
                                                            (GstEncodingProfile *profile);

`profile` : | a GstEncodingProfile
Returns : | The restriction GstCaps to apply before the encoder that will be used in the profile. The fields present in restriction caps are properties of the raw stream (that is before encoding), such as height and width for video and depth and sampling rate for audio. Does not apply to GstEncodingContainerProfile (since there is no corresponding raw stream). Can be `NULL`.

Since 0.10.32

### gst_encoding_profile_set_name ()

    void                gst_encoding_profile_set_name       (GstEncodingProfile *profile,
                                                             const gchar *name);

Set `name` as the given name for the `profile`. A copy of `name` will be made internally.

`profile` : | a GstEncodingProfile
`name` : | the name to set on the profile

Since 0.10.32

### gst_encoding_profile_set_description ()

    void                gst_encoding_profile_set_description
                                                            (GstEncodingProfile *profile,
                                                             const gchar *description);

Set `description` as the given description for the `profile`. A copy of `description` will be made internally.

`profile` : | a GstEncodingProfile
`description` : | the description to set on the profile

Since 0.10.32

### gst_encoding_profile_set_format ()

    void                gst_encoding_profile_set_format     (GstEncodingProfile *profile,
                                                             GstCaps *format);

Sets the media format used in the profile.

`profile` : | a GstEncodingProfile
`format` : | the media format to use in the profile.

Since 0.10.32

### gst_encoding_profile_set_preset ()

    void                gst_encoding_profile_set_preset     (GstEncodingProfile *profile,
                                                             const gchar *preset);

Sets the preset to use for the profile.

`profile` : | a GstEncodingProfile
`preset` : | the element preset to use

Since 0.10.32

### gst_encoding_profile_set_restriction ()

    void                gst_encoding_profile_set_restriction
                                                            (GstEncodingProfile *profile,
                                                             GstCaps *restriction);

Set the restriction GstCaps to apply before the encoder that will be used in the profile. See `gst_encoding_profile_set_restriction()` for more about restrictions. Does not apply to GstEncodingContainerProfile.

`profile` : | a GstEncodingProfile
`restriction` : | the restriction to apply

Since 0.10.32

### gst_encoding_profile_set_presence ()

    void                gst_encoding_profile_set_presence   (GstEncodingProfile *profile,
                                                             guint presence);

Set the number of time the profile is used in its parent container profile. If 0, it is not a mandatory stream

`profile` : | a GstEncodingProfile
`presence` : | the number of time the profile can be used

Since 0.10.32

### gst_encoding_profile_is_equal ()

    gboolean            gst_encoding_profile_is_equal       (GstEncodingProfile *a,
                                                             GstEncodingProfile *b);

Checks whether the two GstEncodingProfile are equal

`a` : | a GstEncodingProfile
`b` : | a GstEncodingProfile
Returns : | `TRUE` if `a` and `b` are equal, else `FALSE`.

Since 0.10.32

### gst_encoding_profile_get_input_caps ()

    GstCaps *           gst_encoding_profile_get_input_caps (GstEncodingProfile *profile);

Computes the full output caps that this `profile` will be able to consume.

`profile` : | a GstEncodingProfile
Returns : | The full caps the given `profile` can consume. Call `gst_caps_unref()` when you are done with the caps.

Since 0.10.32

### gst_encoding_profile_get_type_nick ()

    const gchar *       gst_encoding_profile_get_type_nick  (GstEncodingProfile *profile);

`profile` : | a GstEncodingProfile
Returns : | the human-readable name of the type of `profile`.

Since 0.10.32

### GstEncodingContainerProfile

    typedef struct _GstEncodingContainerProfile GstEncodingContainerProfile;

Encoding profiles for containers. Keeps track of a list of GstEncodingProfile

Since 0.10.32

### gst_encoding_container_profile_new ()

    GstEncodingContainerProfile * gst_encoding_container_profile_new
                                                            (const gchar *name,
                                                             const gchar *description,
                                                             GstCaps *format,
                                                             const gchar *preset);

Creates a new GstEncodingContainerProfile.

`name` : | The name of the container profile, can be `NULL`
`description` : | The description of the container profile, can be `NULL`
`format` : | The format to use for this profile
`preset` : | The preset to use for this profile
Returns : | The newly created GstEncodingContainerProfile.

Since 0.10.32

### gst_encoding_container_profile_add_profile ()

    gboolean            gst_encoding_container_profile_add_profile
                                                            (GstEncodingContainerProfile *container,
                                                             GstEncodingProfile *profile);

Add a GstEncodingProfile to the list of profiles handled by `container`.

No copy of `profile` will be made, if you wish to use it elsewhere after this method you should increment its reference count.

`container` : | the GstEncodingContainerProfile to use
`profile` : | the GstEncodingProfile to add.
Returns : | `TRUE` if the `stream` was properly added, else `FALSE`.

Since 0.10.32

### gst_encoding_container_profile_contains_profile ()

    gboolean            gst_encoding_container_profile_contains_profile
                                                            (GstEncodingContainerProfile *container,
                                                             GstEncodingProfile *profile);

Checks if `container` contains a GstEncodingProfile identical to `profile`.

`container` : | a GstEncodingContainerProfile
`profile` : | a GstEncodingProfile
Returns : | `TRUE` if `container` contains a GstEncodingProfile identical to `profile`, else `FALSE`.

Since 0.10.32

### gst_encoding_container_profile_get_profiles ()

    const GList *       gst_encoding_container_profile_get_profiles
                                                            (GstEncodingContainerProfile *profile);

### GstEncodingAudioProfile

    typedef struct _GstEncodingAudioProfile GstEncodingAudioProfile;

Variant of GstEncodingProfile for audio streams.

Since 0.10.32

### gst_encoding_audio_profile_new ()

    GstEncodingAudioProfile * gst_encoding_audio_profile_new
                                                            (GstCaps *format,
                                                             const gchar *preset,
                                                             GstCaps *restriction,
                                                             guint presence);

Creates a new GstEncodingAudioProfile

All provided allocatable arguments will be internally copied, so can be safely freed/unreferenced after calling this method.

`format` : | the GstCaps
`preset` : | the preset(s) to use on the encoder, can be NULL
`restriction` : | the GstCaps used to restrict the input to the encoder, can be NULL. See `gst_encoding_profile_get_restriction()` for more details.
`presence` : | the number of time this stream must be used. 0 means any number of times (including never)
Returns : | the newly created GstEncodingAudioProfile.

Since 0.10.32

### GstEncodingVideoProfile

    typedef struct _GstEncodingVideoProfile GstEncodingVideoProfile;

Variant of GstEncodingProfile for video streams, allows specifying the `pass`.

Since 0.10.32

### gst_encoding_video_profile_new ()

    GstEncodingVideoProfile * gst_encoding_video_profile_new
                                                            (GstCaps *format,
                                                             const gchar *preset,
                                                             GstCaps *restriction,
                                                             guint presence);

Creates a new GstEncodingVideoProfile

All provided allocatable arguments will be internally copied, so can be safely freed/unreferenced after calling this method.

If you wish to control the pass number (in case of multi-pass scenarios), please refer to the `gst_encoding_video_profile_set_pass()` documentation.

If you wish to use/force a constant framerate please refer to the `gst_encoding_video_profile_set_variableframerate()` documentation.

`format` : | the GstCaps
`preset` : | the preset(s) to use on the encoder, can be NULL
`restriction` : | the GstCaps used to restrict the input to the encoder, can be NULL. See `gst_encoding_profile_get_restriction()` for more details.
`presence` : | the number of time this stream must be used. 0 means any number of times (including never)
Returns : | the newly created GstEncodingVideoProfile.

Since 0.10.32

### gst_encoding_video_profile_get_pass ()

    guint               gst_encoding_video_profile_get_pass (GstEncodingVideoProfile *prof);

`prof` : | a GstEncodingVideoProfile
Returns : | The pass number if this is part of a multi-pass profile. Starts at 1 for multi-pass. 0 if this is not a multi-pass profile

Since 0.10.32

### gst_encoding_video_profile_get_variableframerate ()

    gboolean            gst_encoding_video_profile_get_variableframerate
                                                            (GstEncodingVideoProfile *prof);

`prof` : | a GstEncodingVideoProfile
Returns : | Whether non-constant video framerate is allowed for encoding.

Since 0.10.32

### gst_encoding_video_profile_set_pass ()

    void                gst_encoding_video_profile_set_pass (GstEncodingVideoProfile *prof,
                                                             guint pass);

Sets the pass number of this video profile. The first pass profile should have this value set to 1. If this video profile isn't part of a multi-pass profile, you may set it to 0 (the default value).

`prof` : | a GstEncodingVideoProfile
`pass` : | the pass number for this profile

Since 0.10.32

### gst_encoding_video_profile_set_variableframerate ()

    void                gst_encoding_video_profile_set_variableframerate
                                                            (GstEncodingVideoProfile *prof,
                                                             gboolean variableframerate);

If set to `TRUE`, then the incoming stream will be allowed to have non-constant framerate. If set to `FALSE` (default value), then the incoming stream will be normalized by dropping/duplicating frames in order to produce a constance framerate.

`prof` : | a GstEncodingVideoProfile
`variableframerate` : | a boolean

Since 0.10.32

### GST_ENCODING_CATEGORY_DEVICE

    #define GST_ENCODING_CATEGORY_DEVICE		"device"

GstEncodingTarget category for device-specific targets. The name of the target will usually be the constructor and model of the device, and that target will contain GstEncodingProfiles suitable for that device.

### GST_ENCODING_CATEGORY_ONLINE_SERVICE

    #define GST_ENCODING_CATEGORY_ONLINE_SERVICE "online-service"

GstEncodingTarget category for online-services. The name of the target will usually be the name of the online service and that target will contain GstEncodingProfiles suitable for that online service.

### GST_ENCODING_CATEGORY_STORAGE_EDITING

    #define GST_ENCODING_CATEGORY_STORAGE_EDITING   "storage-editing"

GstEncodingTarget category for storage, archiving and editing targets. Those targets can be lossless and/or provide very fast random access content. The name of the target will usually be the container type or editing target, and that target will contain GstEncodingProfiles suitable for editing or storage.

### GST_ENCODING_CATEGORY_CAPTURE

    #define GST_ENCODING_CATEGORY_CAPTURE		"capture"

GstEncodingTarget category for recording and capture. Targets within this category are optimized for low latency encoding.

### GstEncodingTarget

    typedef struct _GstEncodingTarget GstEncodingTarget;

Collection of GstEncodingProfile for a specific target or use-case.

When being stored/loaded, targets come from a specific category, like GST_ENCODING_CATEGORY_DEVICE.

Since 0.10.32

### gst_encoding_target_unref()

    #define             gst_encoding_target_unref(target)

Decreases the reference count of the `target`, possibly freeing it.

`target` : | a GstEncodingTarget

Since 0.10.32

### gst_encoding_target_ref()

    #define             gst_encoding_target_ref(target)

Increases the reference count of the `target`.

`target` : | a GstEncodingTarget

Since 0.10.32

### gst_encoding_target_new ()

    GstEncodingTarget * gst_encoding_target_new             (const gchar *name,
                                                             const gchar *category,
                                                             const gchar *description,
                                                             const GList *profiles);

Creates a new GstEncodingTarget.

The name and category can only consist of lowercase ASCII letters for the first character, followed by either lowercase ASCII letters, digits or hyphens ('-').

The `category` should be one of the existing well-defined categories, like GST_ENCODING_CATEGORY_DEVICE, but it can be a application or user specific category if needed.

`name` : | The name of the target.
`category` : | The name of the category to which this `target` belongs. For example: GST_ENCODING_CATEGORY_DEVICE. [transfer none]
`description` : | A description of GstEncodingTarget in the current locale. [transfer none]
`profiles` : | A GList of GstEncodingProfile. [transfer none][element-type Gst.EncodingProfile]
Returns : | The newly created GstEncodingTarget or `NULL` if there was an error. [transfer full]

Since 0.10.32

### gst_encoding_target_get_name ()

    const gchar *       gst_encoding_target_get_name        (GstEncodingTarget *target);

`target` : | a GstEncodingTarget
Returns : | The name of the `target`. [transfer none]

Since 0.10.32

### gst_encoding_target_get_category ()

    const gchar *       gst_encoding_target_get_category    (GstEncodingTarget *target);

`target` : | a GstEncodingTarget
Returns : | The category of the `target`. For example: GST_ENCODING_CATEGORY_DEVICE. [transfer none]

Since 0.10.32

### gst_encoding_target_get_description ()

    const gchar *       gst_encoding_target_get_description (GstEncodingTarget *target);

`target` : | a GstEncodingTarget
Returns : | The description of the `target`. [transfer none]

Since 0.10.32

### gst_encoding_target_get_profiles ()

    const GList *       gst_encoding_target_get_profiles    (GstEncodingTarget *target);

`target` : | a GstEncodingTarget
Returns : | A list of GstEncodingProfile(s) this `target` handles. [transfer none][element-type Gst.EncodingProfile]

Since 0.10.32

### gst_encoding_target_get_profile ()

    GstEncodingProfile * gst_encoding_target_get_profile    (GstEncodingTarget *target,
                                                             const gchar *name);

`target` : | a GstEncodingTarget
`name` : | the name of the profile to retrieve
Returns : | The matching GstEncodingProfile, or `NULL`. [transfer full]

Since 0.10.32

### gst_encoding_target_add_profile ()

    gboolean            gst_encoding_target_add_profile     (GstEncodingTarget *target,
                                                             GstEncodingProfile *profile);

Adds the given `profile` to the `target`. Each added profile must have a unique name within the profile.

The `target` will steal a reference to the `profile`. If you wish to use the profile after calling this method, you should increase its reference count.

`target` : | the GstEncodingTarget to add a profile to
`profile` : | the GstEncodingProfile to add. [transfer full]
Returns : | `TRUE` if the profile was added, else `FALSE`.

Since 0.10.32

### gst_encoding_target_save ()

    gboolean            gst_encoding_target_save            (GstEncodingTarget *target,
                                                             GError **error);

Saves the `target` to a default user-local directory.

`target` : | a GstEncodingTarget
`error` : | If an error occured, this field will be filled in.
Returns : | `TRUE` if the target was correctly saved, else `FALSE`.

Since 0.10.32

### gst_encoding_target_save_to_file ()

    gboolean            gst_encoding_target_save_to_file    (GstEncodingTarget *target,
                                                             const gchar *filepath,
                                                             GError **error);

Saves the `target` to the provided file location.

`target` : | a GstEncodingTarget
`filepath` : | the location to store the `target` at.
`error` : | If an error occured, this field will be filled in.
Returns : | `TRUE` if the target was correctly saved, else `FALSE`.

Since 0.10.32

### gst_encoding_target_load ()

    GstEncodingTarget * gst_encoding_target_load            (const gchar *name,
                                                             const gchar *category,
                                                             GError **error);

Searches for the GstEncodingTarget with the given name, loads it and returns it.

If the category name is specified only targets from that category will be searched for.

`name` : | the name of the GstEncodingTarget to load.
`category` : | the name of the target category, like GST_ENCODING_CATEGORY_DEVICE. Can be `NULL`. [allow-none]
`error` : | If an error occured, this field will be filled in.
Returns : | The GstEncodingTarget if available, else `NULL`. [transfer full]

Since 0.10.32

### gst_encoding_target_load_from_file ()

    GstEncodingTarget * gst_encoding_target_load_from_file  (const gchar *filepath,
                                                             GError **error);

Opens the provided file and returns the contained GstEncodingTarget.

`filepath` : | The file location to load the GstEncodingTarget from
`error` : | If an error occured, this field will be filled in.
Returns : | The GstEncodingTarget contained in the file, else `NULL`. [transfer full]

Since 0.10.32

### gst_encoding_list_all_targets ()

    GList *             gst_encoding_list_all_targets       (const gchar *categoryname);

List all available GstEncodingTarget for the specified category, or all categories if `categoryname` is `NULL`.

`categoryname` : | The category, for ex: GST_ENCODING_CATEGORY_DEVICE. Can be `NULL`. [allow-none]
Returns : | The list of GstEncodingTarget. [transfer full][element-type GstEncodingTarget]

Since 0.10.32

### gst_encoding_list_available_categories ()

    GList *             gst_encoding_list_available_categories
                                                            (void);

Lists all GstEncodingTarget categories present on disk.

Returns : | A list of GstEncodingTarget categories. [transfer full][element-type gchar*]

Since 0.10.32