# parsebin

GstBin that auto-magically constructs a parsing pipeline using available parsers and demuxers via auto-plugging.

parsebin unpacks the contents of the input stream to the level of parsed elementary streams, but unlike decodebin it doesn't connect decoder elements. The output pads produce packetised encoded data with timestamps where possible, or send missing-element messages where not.

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBin
                        ╰──parsebin

## Implemented interfaces

    GstChildProxy

## Factory details

Authors: – Jan Schmidt , Edward Hervey

Classification: – `Generic/Bin/Parser`

Rank – none

Plugin – playback

Package – GStreamer Base Plug-ins

## Pad Templates

### `sink`

    ANY

Presence – always

Direction – sink

Object type – GstPad

### `src_%u`

    ANY

Presence – sometimes

Direction – src

Object type – GstPad

## Signals

### autoplug-continue

    gboolean
    autoplug_continue_callback (GstElement * bin,
                                GstPad * pad,
                                GstCaps * caps,
                                gpointer udata)

    def autoplug_continue_callback (bin, pad, caps, udata):
        #python callback for the 'autoplug-continue' signal

    function autoplug_continue_callback(bin: GstElement * bin, pad: GstPad * pad, caps: GstCaps * caps, udata: gpointer udata): {
        // javascript callback for the 'autoplug-continue' signal
    }

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

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

Parameters:

`bin` –

The ParseBin.

`pad` –

The GstPad.

`caps` –

The GstCaps found.

`udata` –
No description available
Returns (gboolean) –

TRUE if you wish ParseBin 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).

Flags: Run Last

### autoplug-factories

    GValueArray *
    autoplug_factories_callback (GstElement * bin,
                                 GstPad * pad,
                                 GstCaps * caps,
                                 gpointer udata)

    def autoplug_factories_callback (bin, pad, caps, udata):
        #python callback for the 'autoplug-factories' signal

    function autoplug_factories_callback(bin: GstElement * bin, pad: GstPad * pad, caps: GstCaps * caps, udata: gpointer udata): {
        // javascript callback for the 'autoplug-factories' signal
    }

This function is emitted when an array of possible factories for caps on pad is needed. ParseBin 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.

> 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!

Parameters:

`bin` –

The ParseBin.

`pad` –

The GstPad.

`caps` –

The GstCaps found.

`udata` –
No description available
Returns (GValueArray *) –

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".

Flags: Run Last

### autoplug-query

    gboolean
    autoplug_query_callback (GstElement * bin,
                             GstPad * child,
                             GstElement * pad,
                             GstQuery * element,
                             gpointer query)

    def autoplug_query_callback (bin, child, pad, element, query):
        #python callback for the 'autoplug-query' signal

    function autoplug_query_callback(bin: GstElement * bin, child: GstPad * child, pad: GstElement * pad, element: GstQuery * element, query: gpointer query): {
        // javascript callback for the 'autoplug-query' signal
    }

This signal is emitted whenever an autoplugged element that is not linked downstream yet and not exposed does a query. It can be used to tell the element about the downstream supported caps for example.

Parameters:

`bin` –

The ParseBin.

`child` –

The child element doing the query

`pad` –

The GstPad.

`element` –

The GstElement.

`query` –

The GstQuery.

Returns (gboolean) –

TRUE if the query was handled, FALSE otherwise.

Flags: Run Last

### autoplug-select

    GstAutoplugSelectResult *
    autoplug_select_callback (GstElement * bin,
                              GstPad * pad,
                              GstCaps * caps,
                              GstElementFactory * factory,
                              gpointer udata)

    def autoplug_select_callback (bin, pad, caps, factory, udata):
        #python callback for the 'autoplug-select' signal

    function autoplug_select_callback(bin: GstElement * bin, pad: GstPad * pad, caps: GstCaps * caps, factory: GstElementFactory * factory, udata: gpointer udata): {
        // javascript callback for the 'autoplug-select' signal
    }

This signal is emitted once ParseBin 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 GstAutoplugSelectResult enum value indicating what ParseBin should do next.

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

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

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

> The signal handler will not be invoked if any of the previously registered signal handlers (if any) return a value other than GST_AUTOPLUG_SELECT_TRY. Which also means that if you return GST_AUTOPLUG_SELECT_TRY from one signal handler, handlers that get registered next (again, if any) can override that decision.

Parameters:

`bin` –

The ParseBin.

`pad` –

The GstPad.

`caps` –

The GstCaps.

`factory` –

A GstElementFactory to use.

`udata` –
No description available
Returns (GstAutoplugSelectResult *) –

a GstAutoplugSelectResult that indicates the required operation. the default handler will always return try.

Flags: Run Last

### autoplug-sort

    GValueArray *
    autoplug_sort_callback (GstElement * bin,
                            GstPad * pad,
                            GstCaps * caps,
                            GValueArray * factories,
                            gpointer udata)

    def autoplug_sort_callback (bin, pad, caps, factories, udata):
        #python callback for the 'autoplug-sort' signal

    function autoplug_sort_callback(bin: GstElement * bin, pad: GstPad * pad, caps: GstCaps * caps, factories: GValueArray * factories, udata: gpointer udata): {
        // javascript callback for the 'autoplug-sort' signal
    }

Once ParseBin has found the possible GstElementFactory objects to try for caps on pad, this signal is emitted. 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.

> 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!

Parameters:

`bin` –

The ParseBin.

`pad` –

The GstPad.

`caps` –

The GstCaps.

`factories` –

A GValueArray of possible GstElementFactory to use.

`udata` –
No description available
Returns (GValueArray *) –

A new sorted array of GstElementFactory objects.

Flags: Run Last

### drained

    drained_callback (GstElement * bin,
                      gpointer udata)

    def drained_callback (bin, udata):
        #python callback for the 'drained' signal

    function drained_callback(bin: GstElement * bin, udata: gpointer udata): {
        // javascript callback for the 'drained' signal
    }

This signal is emitted once ParseBin has finished parsing all the data.

Parameters:

`bin` –

The ParseBin

`udata` –
No description available

Flags: Run Last

### unknown-type

    unknown_type_callback (GstElement * bin,
                           GstPad * pad,
                           GstCaps * caps,
                           gpointer udata)

    def unknown_type_callback (bin, pad, caps, udata):
        #python callback for the 'unknown-type' signal

    function unknown_type_callback(bin: GstElement * bin, pad: GstPad * pad, caps: GstCaps * caps, udata: gpointer udata): {
        // javascript callback for the 'unknown-type' signal
    }

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

Parameters:

`bin` –

The ParseBin.

`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.

`udata` –
No description available

Flags: Run Last

## Properties

### connection-speed

    “connection-speed” guint64

Network connection speed in kbps (0 = unknown)

Flags : Read / Write

Default value : 0

### expose-all-streams

    “expose-all-streams” gboolean

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

Flags : Read / Write

Default value : true

### sink-caps

    “sink-caps” GstCaps *

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

Flags : Read / Write

### subtitle-encoding

    “subtitle-encoding” gchararray

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.

Flags : Read / Write

Default value : NULL

The results of the search are