decodebin

## decodebin decodebin — Autoplug and decode to raw media |

## Synopsis

    struct              GstDecodeBin;

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GstObject
                   +----GstElement
                         +----GstBin
                               +----GstDecodeBin

## Implemented Interfaces

GstDecodeBin implements GstChildProxy.

## Properties

      "threaded"                 gboolean              : Read / Write
      "sink-caps"                GstCaps*              : Read / Write
      "caps"                     GstCaps*              : Read / Write
      "expose-all-streams"       gboolean              : Read / Write
      "high-percent"             gint                  : Read / Write
      "low-percent"              gint                  : Read / Write
      "max-size-buffers"         guint                 : Read / Write
      "max-size-bytes"           guint                 : Read / Write
      "max-size-time"            guint64               : Read / Write
      "post-stream-topology"     gboolean              : Read / Write
      "subtitle-encoding"        gchar*                : Read / Write
      "use-buffering"            gboolean              : Read / Write

## Signals

      "new-decoded-pad"                                : Run Last
      "removed-decoded-pad"                            : Run Last
      "unknown-type"                                   : Run Last
      "autoplug-continue"                              : Run Last
      "autoplug-factories"                             : Run Last
      "autoplug-select"                                : Run Last
      "autoplug-sort"                                  : Run Last
      "drained"                                        : Run Last

## Description

GstBin that auto-magically constructs a decoding pipeline using available decoders and demuxers via auto-plugging.

decodebin is considered stable now and replaces the old decodebin element. uridecodebin uses decodebin internally and is often more convenient to use, as it creates a suitable source element as well.

## Synopsis

### Element Information

plugin | playback
author | Edward Hervey <edward.hervey@collabora.co.uk>, Sebastian Dröge <sebastian.droege@collabora.co.uk>
class | Generic/Bin/Decoder

### Element Pads

name | sink
direction | sink
presence | always
details | ANY

name | src_%u
direction | source
presence | sometimes
details | ANY

## Details

### struct GstDecodeBin

    struct GstDecodeBin;

The opaque GstDecodeBin data structure

## Property Details

### The `"threaded"` property

      "threaded"                 gboolean              : Read / Write

Use threads.

Default value: FALSE

### The `"sink-caps"` property

      "sink-caps"                GstCaps*              : Read / Write

The caps of the input data. (NULL = use typefind element).

### The `"caps"` property

      "caps"                     GstCaps*              : Read / Write

The caps on which to stop decoding.

### The `"expose-all-streams"` property

      "expose-all-streams"       gboolean              : Read / Write

Expose all streams, including those of unknown type or that don't match the 'caps' property.

Default value: TRUE

### The `"high-percent"` property

      "high-percent"             gint                  : Read / Write

High threshold percent for buffering to finish.

Allowed values: [0,100]

Default value: 99

Since 0.10.26

### The `"low-percent"` property

      "low-percent"              gint                  : Read / Write

Low threshold percent for buffering to start.

Allowed values: [0,100]

Default value: 10

Since 0.10.26

### The `"max-size-buffers"` property

      "max-size-buffers"         guint                 : Read / Write

Max amount of buffers in the queue (0=automatic).

Default value: 0

Since 0.10.26

### The `"max-size-bytes"` property

      "max-size-bytes"           guint                 : Read / Write

Max amount of bytes in the queue (0=automatic).

Default value: 0

Since 0.10.26

### The `"max-size-time"` property

      "max-size-time"            guint64               : Read / Write

Max amount of time in the queue (in ns, 0=automatic).

Default value: 0

Since 0.10.26

### The `"post-stream-topology"` property

      "post-stream-topology"     gboolean              : Read / Write

Post stream-topology messages.

Default value: FALSE

### The `"subtitle-encoding"` property

      "subtitle-encoding"        gchar*                : Read / Write

Encoding to assume if input subtitles are not in UTF-8 encoding. If not set, the GST_SUBTITLE_ENCODING environment variable will be checked for an encoding to use. If that is not set either, ISO-8859-15 will be assumed.

Default value: NULL

### The `"use-buffering"` property

      "use-buffering"            gboolean              : Read / Write

Emit GST_MESSAGE_BUFFERING based on low-/high-percent thresholds.

Default value: FALSE

## Signal Details

### The `"new-decoded-pad"` signal

    void                user_function                      (GstDecodeBin *gstdecodebin,
                                                            GstPad       *arg1,
                                                            gboolean      arg2,
                                                            gpointer      user_data)         : Run Last

`gstdecodebin` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"removed-decoded-pad"` signal

    void                user_function                      (GstDecodeBin *gstdecodebin,
                                                            GstPad       *arg1,
                                                            gpointer      user_data)         : Run Last

`gstdecodebin` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"unknown-type"` signal

    void                user_function                      (GstDecodeBin *bin,
                                                            GstPad       *pad,
                                                            GstCaps      *caps,
                                                            gpointer      user_data)      : Run Last

This signal is emitted when a pad for which there is no further possible decoding is added to the decodebin.

`bin` : | The decodebin.
`pad` : | The new pad containing caps that cannot be resolved to a 'final' stream type.
`caps` : | The GstCaps of the pad that cannot be resolved.
`user_data` : | user data set when the signal handler was connected.

### The `"autoplug-continue"` signal

    gboolean            user_function                      (GstDecodeBin *bin,
                                                            GstPad       *pad,
                                                            GstCaps      *caps,
                                                            gpointer      user_data)      : Run Last

This signal is emitted whenever decodebin finds a new stream. It is emitted before looking for any elements that can handle that stream.

### Note

Invocation of signal handlers stops after the first signal handler returns FALSE. Signal handlers are invoked in the order they were connected in.

`bin` : | The decodebin.
`pad` : | The GstPad.
`caps` : | The GstCaps found.
`user_data` : | user data set when the signal handler was connected.
Returns : | TRUE if you wish decodebin to look for elements that can handle the given `caps`. If FALSE, those caps will be considered as final and the pad will be exposed as such (see 'pad-added' signal of GstElement).

### The `"autoplug-factories"` signal

    GValueArray*        user_function                      (GstDecodeBin *bin,
                                                            GstPad       *pad,
                                                            GstCaps      *caps,
                                                            gpointer      user_data)      : Run Last

This function is emited when an array of possible factories for `caps` on `pad` is needed. Decodebin will by default return an array with all compatible factories, sorted by rank.

If this function returns NULL, `pad` will be exposed as a final caps.

If this function returns an empty array, the pad will be considered as having an unhandled type media type.

### Note

Only the signal handler that is connected first will ever by invoked. Don't connect signal handlers with the G_CONNECT_AFTER flag to this signal, they will never be invoked!

`bin` : | The decodebin.
`pad` : | The GstPad.
`caps` : | The GstCaps found.
`user_data` : | user data set when the signal handler was connected.
Returns : | a GValueArray* with a list of factories to try. The factories are by default tried in the returned order or based on the index returned by "autoplug-select".

### The `"autoplug-select"` signal

    GstAutoplugSelectResultuser_function                      (GstDecodeBin      *bin,
                                                            GstPad            *pad,
                                                            GstCaps           *caps,
                                                            GstElementFactory *factory,
                                                            gpointer           user_data)      : Run Last

This signal is emitted once decodebin has found all the possible GstElementFactory that can be used to handle the given `caps`. For each of those factories, this signal is emitted.

The signal handler should return a GST_TYPE_AUTOPLUG_SELECT_RESULT enum value indicating what decodebin should do next.

A value of GST_AUTOPLUG_SELECT_TRY will try to autoplug an element from `factory`.

A value of GST_AUTOPLUG_SELECT_EXPOSE will expose `pad` without plugging any element to it.

A value of GST_AUTOPLUG_SELECT_SKIP will skip `factory` and move to the next factory.

### Note

Only the signal handler that is connected first will ever by invoked. Don't connect signal handlers with the G_CONNECT_AFTER flag to this signal, they will never be invoked!

`bin` : | The decodebin.
`pad` : | The GstPad.
`caps` : | The GstCaps.
`factory` : | A GstElementFactory to use.
`user_data` : | user data set when the signal handler was connected.
Returns : | a GST_TYPE_AUTOPLUG_SELECT_RESULT that indicates the required operation. the default handler will always return GST_AUTOPLUG_SELECT_TRY.

### The `"autoplug-sort"` signal

    GValueArray*        user_function                      (GstDecodeBin *bin,
                                                            GstPad       *pad,
                                                            GstCaps      *caps,
                                                            GValueArray  *factories,
                                                            gpointer      user_data)      : Run Last

Once decodebin has found the possible GstElementFactory objects to try for `caps` on `pad`, this signal is emited. The purpose of the signal is for the application to perform additional sorting or filtering on the element factory array.

The callee should copy and modify `factories` or return NULL if the order should not change.

### Note

Invocation of signal handlers stops after one signal handler has returned something else than NULL. Signal handlers are invoked in the order they were connected in. Don't connect signal handlers with the G_CONNECT_AFTER flag to this signal, they will never be invoked!

`bin` : | The decodebin.
`pad` : | The GstPad.
`caps` : | The GstCaps.
`factories` : | A GValueArray of possible GstElementFactory to use.
`user_data` : | user data set when the signal handler was connected.
Returns : | A new sorted array of GstElementFactory objects.

### The `"drained"` signal

    void                user_function                      (GstDecodeBin *bin,
                                                            gpointer      user_data)      : Run Last

This signal is emitted once decodebin has finished decoding all the data.

`bin` : | The decodebin
`user_data` : | user data set when the signal handler was connected.

Since 0.10.16