# GstVideoDecoder

This base class is for video decoders turning encoded data into raw video frames.

The GstVideoDecoder base class and derived subclasses should cooperate as follows:

## Configuration

- Initially, GstVideoDecoder calls start when the decoder element is activated, which allows the subclass to perform any global setup.

- GstVideoDecoder calls set_format to inform the subclass of caps describing input video data that it is about to receive, including possibly configuration data. While unlikely, it might be called more than once, if changing input parameters require reconfiguration.

- Incoming data buffers are processed as needed, described in Data Processing below.

- GstVideoDecoder calls stop at end of all processing.

## Data processing

- The base class gathers input data, and optionally allows subclass to parse this into subsequently manageable chunks, typically corresponding to and referred to as 'frames'.

- Each input frame is provided in turn to the subclass' handle_frame callback.

- When the subclass enables the subframe mode with `gst_video_decoder_set_subframe_mode`, the base class will provide to the subclass the same input frame with different input buffers to the subclass handle_frame callback. During this call, the subclass needs to take ownership of the input_buffer as GstVideoCodecFrame.input_buffer will have been changed before the next subframe buffer is received. The subclass will call `gst_video_decoder_have_last_subframe` when a new input frame can be created by the base class. Every subframe will share the same GstVideoCodecFrame.output_buffer to write the decoding result. The subclass is responsible to protect its access.

- If codec processing results in decoded data, the subclass should call gst_video_decoder_finish_frame to have decoded data pushed downstream. In subframe mode the subclass should call gst_video_decoder_finish_subframe until the last subframe where it should call gst_video_decoder_finish_frame. The subclass can detect the last subframe using GST_VIDEO_BUFFER_FLAG_MARKER on buffers or using its own logic to collect the subframes. In case of decoding failure, the subclass must call gst_video_decoder_drop_frame or gst_video_decoder_drop_subframe, to allow the base class to do timestamp and offset tracking, and possibly to requeue the frame for a later attempt in the case of reverse playback.

## Shutdown phase

- The GstVideoDecoder class calls stop to inform the subclass that data parsing will be stopped.

## Additional Notes

- Seeking/Flushing

  - When the pipeline is seeked or otherwise flushed, the subclass is informed via a call to its reset callback, with the hard parameter set to true. This indicates the subclass should drop any internal data queues and timestamps and prepare for a fresh set of buffers to arrive for parsing and decoding.

- End Of Stream

  - At end-of-stream, the subclass parse function may be called some final times with the at_eos parameter set to true, indicating that the element should not expect any more data to be arriving, and it should parse and remaining frames and call gst_video_decoder_have_frame if possible.

The subclass is responsible for providing pad template caps for source and sink pads. The pads need to be named "sink" and "src". It also needs to provide information about the output caps, when they are known. This may be when the base class calls the subclass' set_format function, though it might be during decoding, before calling gst_video_decoder_finish_frame. This is done via gst_video_decoder_set_output_state

The subclass is also responsible for providing (presentation) timestamps (likely based on corresponding input ones). If that is not applicable or possible, the base class provides limited framerate based interpolation.

Similarly, the base class provides some limited (legacy) seeking support if specifically requested by the subclass, as full-fledged support should rather be left to upstream demuxer, parser or alike. This simple approach caters for seeking and duration reporting using estimated input bitrates. To enable it, a subclass should call gst_video_decoder_set_estimate_rate to enable handling of incoming byte-streams.

The base class provides some support for reverse playback, in particular in case incoming data is not packetized or upstream does not provide fragments on keyframe boundaries. However, the subclass should then be prepared for the parsing and frame processing stage to occur separately (in normal forward processing, the latter immediately follows the former), The subclass also needs to ensure the parsing stage properly marks keyframes, unless it knows the upstream elements will do so properly for incoming data.

The bare minimum that a functional subclass needs to implement is:

- Provide pad templates

- Inform the base class of output caps via gst_video_decoder_set_output_state

- Parse input data, if it is not considered packetized from upstream Data will be provided to parse which should invoke gst_video_decoder_add_to_frame and gst_video_decoder_have_frame to separate the data belonging to each video frame.

- Accept data in handle_frame and provide decoded results to gst_video_decoder_finish_frame, or call gst_video_decoder_drop_frame.

## GstVideoDecoder

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstVideoDecoder

The opaque GstVideoDecoder data structure.

### Class structure

#### GstVideoDecoderClass

Subclasses can override any of the available virtual methods or not, as needed. At minimum handle_frame needs to be overridden, and set_format and likely as well. If non-packetized input is supported or expected, parse needs to be overridden as well.

### GstVideo.VideoDecoderClass

Subclasses can override any of the available virtual methods or not, as needed. At minimum handle_frame needs to be overridden, and set_format and likely as well. If non-packetized input is supported or expected, parse needs to be overridden as well.

### GstVideo.VideoDecoderClass

Subclasses can override any of the available virtual methods or not, as needed. At minimum handle_frame needs to be overridden, and set_format and likely as well. If non-packetized input is supported or expected, parse needs to be overridden as well.

## GstVideo.VideoDecoder

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstVideo.VideoDecoder

The opaque GstVideo.VideoDecoder data structure.

## GstVideo.VideoDecoder

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstVideo.VideoDecoder

The opaque GstVideo.VideoDecoder data structure.

### Methods

#### gst_video_decoder_add_to_frame

    gst_video_decoder_add_to_frame (GstVideoDecoder * decoder,
                                    int n_bytes)

Removes next n_bytes of input data and adds it to currently parsed frame.

Parameters:

`decoder` –

a GstVideoDecoder

`n_bytes` –

the number of bytes to add

#### GstVideo.VideoDecoder.prototype.add_to_frame

    function GstVideo.VideoDecoder.prototype.add_to_frame(n_bytes: Number): {
        // javascript wrapper for 'gst_video_decoder_add_to_frame'
    }

Removes next n_bytes of input data and adds it to currently parsed frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`n_bytes` (Number) –

the number of bytes to add

#### GstVideo.VideoDecoder.add_to_frame

    def GstVideo.VideoDecoder.add_to_frame (self, n_bytes):
        #python wrapper for 'gst_video_decoder_add_to_frame'

Removes next n_bytes of input data and adds it to currently parsed frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`n_bytes` (int) –

the number of bytes to add

#### gst_video_decoder_allocate_output_buffer

    GstBuffer *
    gst_video_decoder_allocate_output_buffer (GstVideoDecoder * decoder)

Helper function that allocates a buffer to hold a video frame for decoder's current GstVideoCodecState.

You should use gst_video_decoder_allocate_output_frame instead of this function, if possible at all.

Parameters:

`decoder` –

a GstVideoDecoder

Returns ( [transfer: full][nullable]) –

allocated buffer, or NULL if no buffer could be allocated (e.g. when downstream is flushing or shutting down)

#### GstVideo.VideoDecoder.prototype.allocate_output_buffer

    function GstVideo.VideoDecoder.prototype.allocate_output_buffer(): {
        // javascript wrapper for 'gst_video_decoder_allocate_output_buffer'
    }

Helper function that allocates a buffer to hold a video frame for decoder's current GstVideo.VideoCodecState.

You should use GstVideo.VideoDecoder.prototype.allocate_output_frame instead of this function, if possible at all.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Gst.Buffer) –

allocated buffer, or NULL if no buffer could be allocated (e.g. when downstream is flushing or shutting down)

#### GstVideo.VideoDecoder.allocate_output_buffer

    def GstVideo.VideoDecoder.allocate_output_buffer (self):
        #python wrapper for 'gst_video_decoder_allocate_output_buffer'

Helper function that allocates a buffer to hold a video frame for decoder's current GstVideo.VideoCodecState.

You should use GstVideo.VideoDecoder.allocate_output_frame instead of this function, if possible at all.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Gst.Buffer) –

allocated buffer, or NULL if no buffer could be allocated (e.g. when downstream is flushing or shutting down)

#### gst_video_decoder_allocate_output_frame

    GstFlowReturn
    gst_video_decoder_allocate_output_frame (GstVideoDecoder * decoder,
                                             GstVideoCodecFrame * frame)

Helper function that allocates a buffer to hold a video frame for decoder's current GstVideoCodecState. Subclass should already have configured video state and set src pad caps.

The buffer allocated here is owned by the frame and you should only keep references to the frame, not the buffer.

Parameters:

`decoder` –

a GstVideoDecoder

`frame` –

a GstVideoCodecFrame

Returns –

GST_FLOW_OK if an output buffer could be allocated

#### GstVideo.VideoDecoder.prototype.allocate_output_frame

    function GstVideo.VideoDecoder.prototype.allocate_output_frame(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_allocate_output_frame'
    }

Helper function that allocates a buffer to hold a video frame for decoder's current GstVideo.VideoCodecState. Subclass should already have configured video state and set src pad caps.

The buffer allocated here is owned by the frame and you should only keep references to the frame, not the buffer.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a GstVideo.VideoCodecFrame

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK if an output buffer could be allocated

#### GstVideo.VideoDecoder.allocate_output_frame

    def GstVideo.VideoDecoder.allocate_output_frame (self, frame):
        #python wrapper for 'gst_video_decoder_allocate_output_frame'

Helper function that allocates a buffer to hold a video frame for decoder's current GstVideo.VideoCodecState. Subclass should already have configured video state and set src pad caps.

The buffer allocated here is owned by the frame and you should only keep references to the frame, not the buffer.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a GstVideo.VideoCodecFrame

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK if an output buffer could be allocated

#### gst_video_decoder_allocate_output_frame_with_params

    GstFlowReturn
    gst_video_decoder_allocate_output_frame_with_params (GstVideoDecoder * decoder,
                                                         GstVideoCodecFrame * frame,
                                                         GstBufferPoolAcquireParams * params)

Same as gst_video_decoder_allocate_output_frame except it allows passing GstBufferPoolAcquireParams to the sub call gst_buffer_pool_acquire_buffer.

Parameters:

`decoder` –

a GstVideoDecoder

`frame` –

a GstVideoCodecFrame

`params` –

a GstBufferPoolAcquireParams

Returns –

GST_FLOW_OK if an output buffer could be allocated

Since : 1.12

#### GstVideo.VideoDecoder.prototype.allocate_output_frame_with_params

    function GstVideo.VideoDecoder.prototype.allocate_output_frame_with_params(frame: GstVideo.VideoCodecFrame, params: Gst.BufferPoolAcquireParams): {
        // javascript wrapper for 'gst_video_decoder_allocate_output_frame_with_params'
    }

Same as GstVideo.VideoDecoder.prototype.allocate_output_frame except it allows passing Gst.BufferPoolAcquireParams to the sub call gst_buffer_pool_acquire_buffer.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a GstVideo.VideoCodecFrame

`params` (Gst.BufferPoolAcquireParams) –

a Gst.BufferPoolAcquireParams

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK if an output buffer could be allocated

Since : 1.12

#### GstVideo.VideoDecoder.allocate_output_frame_with_params

    def GstVideo.VideoDecoder.allocate_output_frame_with_params (self, frame, params):
        #python wrapper for 'gst_video_decoder_allocate_output_frame_with_params'

Same as GstVideo.VideoDecoder.allocate_output_frame except it allows passing Gst.BufferPoolAcquireParams to the sub call gst_buffer_pool_acquire_buffer.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a GstVideo.VideoCodecFrame

`params` (Gst.BufferPoolAcquireParams) –

a Gst.BufferPoolAcquireParams

Returns (Gst.FlowReturn) –

Gst.FlowReturn.OK if an output buffer could be allocated

Since : 1.12

#### gst_video_decoder_drop_frame

    GstFlowReturn
    gst_video_decoder_drop_frame (GstVideoDecoder * dec,
                                  GstVideoCodecFrame * frame)

Similar to gst_video_decoder_finish_frame, but drops frame in any case and posts a QoS message with the frame's details on the bus. In any case, the frame is considered finished and released.

Parameters:

`dec` –

a GstVideoDecoder

`frame` ( [transfer: full]) –

the GstVideoCodecFrame to drop

Returns –

a GstFlowReturn, usually GST_FLOW_OK.

#### GstVideo.VideoDecoder.prototype.drop_frame

    function GstVideo.VideoDecoder.prototype.drop_frame(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_drop_frame'
    }

Similar to GstVideo.VideoDecoder.prototype.finish_frame, but drops frame in any case and posts a QoS message with the frame's details on the bus. In any case, the frame is considered finished and released.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to drop

Returns (Gst.FlowReturn) –

a Gst.FlowReturn, usually GST_FLOW_OK.

#### GstVideo.VideoDecoder.drop_frame

    def GstVideo.VideoDecoder.drop_frame (self, frame):
        #python wrapper for 'gst_video_decoder_drop_frame'

Similar to GstVideo.VideoDecoder.finish_frame, but drops frame in any case and posts a QoS message with the frame's details on the bus. In any case, the frame is considered finished and released.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to drop

Returns (Gst.FlowReturn) –

a Gst.FlowReturn, usually GST_FLOW_OK.

#### gst_video_decoder_drop_subframe

    GstFlowReturn
    gst_video_decoder_drop_subframe (GstVideoDecoder * dec,
                                     GstVideoCodecFrame * frame)

Drops input data. The frame is not considered finished until the whole frame is finished or dropped by the subclass.

Parameters:

`dec` –

a GstVideoDecoder

`frame` ( [transfer: full]) –

the GstVideoCodecFrame

Returns –

a GstFlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### GstVideo.VideoDecoder.prototype.drop_subframe

    function GstVideo.VideoDecoder.prototype.drop_subframe(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_drop_subframe'
    }

Drops input data. The frame is not considered finished until the whole frame is finished or dropped by the subclass.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame

Returns (Gst.FlowReturn) –

a Gst.FlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### GstVideo.VideoDecoder.drop_subframe

    def GstVideo.VideoDecoder.drop_subframe (self, frame):
        #python wrapper for 'gst_video_decoder_drop_subframe'

Drops input data. The frame is not considered finished until the whole frame is finished or dropped by the subclass.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame

Returns (Gst.FlowReturn) –

a Gst.FlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### gst_video_decoder_finish_frame

    GstFlowReturn
    gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
                                    GstVideoCodecFrame * frame)

frame should have a valid decoded data buffer, whose metadata fields are then appropriately set according to frame data and pushed downstream. If no output data is provided, frame is considered skipped. In any case, the frame is considered finished and released.

After calling this function the output buffer of the frame is to be considered read-only. This function will also change the metadata of the buffer.

Parameters:

`decoder` –

a GstVideoDecoder

`frame` ( [transfer: full]) –

a decoded GstVideoCodecFrame

Returns –

a GstFlowReturn resulting from sending data downstream

#### GstVideo.VideoDecoder.prototype.finish_frame

    function GstVideo.VideoDecoder.prototype.finish_frame(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_finish_frame'
    }

frame should have a valid decoded data buffer, whose metadata fields are then appropriately set according to frame data and pushed downstream. If no output data is provided, frame is considered skipped. In any case, the frame is considered finished and released.

After calling this function the output buffer of the frame is to be considered read-only. This function will also change the metadata of the buffer.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a decoded GstVideo.VideoCodecFrame

Returns (Gst.FlowReturn) –

a Gst.FlowReturn resulting from sending data downstream

#### GstVideo.VideoDecoder.finish_frame

    def GstVideo.VideoDecoder.finish_frame (self, frame):
        #python wrapper for 'gst_video_decoder_finish_frame'

frame should have a valid decoded data buffer, whose metadata fields are then appropriately set according to frame data and pushed downstream. If no output data is provided, frame is considered skipped. In any case, the frame is considered finished and released.

After calling this function the output buffer of the frame is to be considered read-only. This function will also change the metadata of the buffer.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a decoded GstVideo.VideoCodecFrame

Returns (Gst.FlowReturn) –

a Gst.FlowReturn resulting from sending data downstream

#### gst_video_decoder_finish_subframe

    GstFlowReturn
    gst_video_decoder_finish_subframe (GstVideoDecoder * decoder,
                                       GstVideoCodecFrame * frame)

Indicate that a subframe has been finished to be decoded by the subclass. This method should be called for all subframes except the last subframe where gst_video_decoder_finish_frame should be called instead.

Parameters:

`decoder` –

a GstVideoDecoder

`frame` ( [transfer: full]) –

the GstVideoCodecFrame

Returns –

a GstFlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### GstVideo.VideoDecoder.prototype.finish_subframe

    function GstVideo.VideoDecoder.prototype.finish_subframe(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_finish_subframe'
    }

Indicate that a subframe has been finished to be decoded by the subclass. This method should be called for all subframes except the last subframe where gst_video_decoder_finish_frame should be called instead.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame

Returns (Gst.FlowReturn) –

a Gst.FlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### GstVideo.VideoDecoder.finish_subframe

    def GstVideo.VideoDecoder.finish_subframe (self, frame):
        #python wrapper for 'gst_video_decoder_finish_subframe'

Indicate that a subframe has been finished to be decoded by the subclass. This method should be called for all subframes except the last subframe where gst_video_decoder_finish_frame should be called instead.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame

Returns (Gst.FlowReturn) –

a Gst.FlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### gst_video_decoder_get_allocator

    gst_video_decoder_get_allocator (GstVideoDecoder * decoder,
                                     GstAllocator ** allocator,
                                     GstAllocationParams * params)

Lets GstVideoDecoder sub-classes to know the memory allocator used by the base class and its params.

Unref the allocator after use it.

Parameters:

`decoder` –

a GstVideoDecoder

`allocator` ( [out][optional][nullable][transfer: full]) –

the GstAllocator used

`params` ( [out][optional][transfer: full]) –

the GstAllocationParams of allocator

#### GstVideo.VideoDecoder.prototype.get_allocator

    function GstVideo.VideoDecoder.prototype.get_allocator(): {
        // javascript wrapper for 'gst_video_decoder_get_allocator'
    }

Lets GstVideo.VideoDecoder sub-classes to know the memory allocator used by the base class and its params.

Unref the allocator after use it.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

#### GstVideo.VideoDecoder.get_allocator

    def GstVideo.VideoDecoder.get_allocator (self):
        #python wrapper for 'gst_video_decoder_get_allocator'

Lets GstVideo.VideoDecoder sub-classes to know the memory allocator used by the base class and its params.

Unref the allocator after use it.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

#### gst_video_decoder_get_buffer_pool

    GstBufferPool *
    gst_video_decoder_get_buffer_pool (GstVideoDecoder * decoder)

Parameters:

`decoder` –

a GstVideoDecoder

Returns ( [transfer: full][nullable]) –

the instance of the GstBufferPool used by the decoder; free it after use it

#### GstVideo.VideoDecoder.prototype.get_buffer_pool

    function GstVideo.VideoDecoder.prototype.get_buffer_pool(): {
        // javascript wrapper for 'gst_video_decoder_get_buffer_pool'
    }

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Gst.BufferPool) –

the instance of the Gst.BufferPool used by the decoder; free it after use it

#### GstVideo.VideoDecoder.get_buffer_pool

    def GstVideo.VideoDecoder.get_buffer_pool (self):
        #python wrapper for 'gst_video_decoder_get_buffer_pool'

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Gst.BufferPool) –

the instance of the Gst.BufferPool used by the decoder; free it after use it

#### gst_video_decoder_get_estimate_rate

    gint
    gst_video_decoder_get_estimate_rate (GstVideoDecoder * dec)

Parameters:

`dec` –

a GstVideoDecoder

Returns –

currently configured byte to time conversion setting

#### GstVideo.VideoDecoder.prototype.get_estimate_rate

    function GstVideo.VideoDecoder.prototype.get_estimate_rate(): {
        // javascript wrapper for 'gst_video_decoder_get_estimate_rate'
    }

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Number) –

currently configured byte to time conversion setting

#### GstVideo.VideoDecoder.get_estimate_rate

    def GstVideo.VideoDecoder.get_estimate_rate (self):
        #python wrapper for 'gst_video_decoder_get_estimate_rate'

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (int) –

currently configured byte to time conversion setting

#### gst_video_decoder_get_frame

    GstVideoCodecFrame *
    gst_video_decoder_get_frame (GstVideoDecoder * decoder,
                                 int frame_number)

Get a pending unfinished GstVideoCodecFrame

Parameters:

`decoder` –

a GstVideoDecoder

`frame_number` –

system_frame_number of a frame

Returns ( [transfer: full][nullable]) –

pending unfinished GstVideoCodecFrame identified by frame_number.

#### GstVideo.VideoDecoder.prototype.get_frame

    function GstVideo.VideoDecoder.prototype.get_frame(frame_number: Number): {
        // javascript wrapper for 'gst_video_decoder_get_frame'
    }

Get a pending unfinished GstVideo.VideoCodecFrame

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame_number` (Number) –

system_frame_number of a frame

Returns (GstVideo.VideoCodecFrame) –

pending unfinished GstVideo.VideoCodecFrame identified by frame_number.

#### GstVideo.VideoDecoder.get_frame

    def GstVideo.VideoDecoder.get_frame (self, frame_number):
        #python wrapper for 'gst_video_decoder_get_frame'

Get a pending unfinished GstVideo.VideoCodecFrame

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame_number` (int) –

system_frame_number of a frame

Returns (GstVideo.VideoCodecFrame) –

pending unfinished GstVideo.VideoCodecFrame identified by frame_number.

#### gst_video_decoder_get_frames

    GList *
    gst_video_decoder_get_frames (GstVideoDecoder * decoder)

Get all pending unfinished GstVideoCodecFrame

Parameters:

`decoder` –

a GstVideoDecoder

Returns ( [transfer: full][element-typeGstVideoCodecFrame]) –

pending unfinished GstVideoCodecFrame.

#### GstVideo.VideoDecoder.prototype.get_frames

    function GstVideo.VideoDecoder.prototype.get_frames(): {
        // javascript wrapper for 'gst_video_decoder_get_frames'
    }

Get all pending unfinished GstVideo.VideoCodecFrame

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns ([ GstVideo.VideoCodecFrame ]) –

pending unfinished GstVideo.VideoCodecFrame.

#### GstVideo.VideoDecoder.get_frames

    def GstVideo.VideoDecoder.get_frames (self):
        #python wrapper for 'gst_video_decoder_get_frames'

Get all pending unfinished GstVideo.VideoCodecFrame

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns ([ GstVideo.VideoCodecFrame ]) –

pending unfinished GstVideo.VideoCodecFrame.

#### gst_video_decoder_get_input_subframe_index

    guint
    gst_video_decoder_get_input_subframe_index (GstVideoDecoder * decoder,
                                                GstVideoCodecFrame * frame)

Queries the number of the last subframe received by the decoder baseclass in the frame.

Parameters:

`decoder` –

a GstVideoDecoder

`frame` ( [transfer: none]) –

the GstVideoCodecFrame to update

Returns –

the current subframe index received in subframe mode, 1 otherwise.

Since : 1.20

#### GstVideo.VideoDecoder.prototype.get_input_subframe_index

    function GstVideo.VideoDecoder.prototype.get_input_subframe_index(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_get_input_subframe_index'
    }

Queries the number of the last subframe received by the decoder baseclass in the frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to update

Returns (Number) –

the current subframe index received in subframe mode, 1 otherwise.

Since : 1.20

#### GstVideo.VideoDecoder.get_input_subframe_index

    def GstVideo.VideoDecoder.get_input_subframe_index (self, frame):
        #python wrapper for 'gst_video_decoder_get_input_subframe_index'

Queries the number of the last subframe received by the decoder baseclass in the frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to update

Returns (int) –

the current subframe index received in subframe mode, 1 otherwise.

Since : 1.20

#### gst_video_decoder_get_latency

    gst_video_decoder_get_latency (GstVideoDecoder * decoder,
                                   GstClockTime * min_latency,
                                   GstClockTime * max_latency)

Query the configured decoder latency. Results will be returned via min_latency and max_latency.

Parameters:

`decoder` –

a GstVideoDecoder

`min_latency` ( [out][optional]) –

address of variable in which to store the configured minimum latency, or NULL

`max_latency` ( [out][optional]) –

address of variable in which to store the configured mximum latency, or NULL

#### GstVideo.VideoDecoder.prototype.get_latency

    function GstVideo.VideoDecoder.prototype.get_latency(): {
        // javascript wrapper for 'gst_video_decoder_get_latency'
    }

Query the configured decoder latency. Results will be returned via min_latency and max_latency.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

#### GstVideo.VideoDecoder.get_latency

    def GstVideo.VideoDecoder.get_latency (self):
        #python wrapper for 'gst_video_decoder_get_latency'

Query the configured decoder latency. Results will be returned via min_latency and max_latency.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

#### gst_video_decoder_get_max_decode_time

    GstClockTimeDiff
    gst_video_decoder_get_max_decode_time (GstVideoDecoder * decoder,
                                           GstVideoCodecFrame * frame)

Determines maximum possible decoding time for frame that will allow it to decode and arrive in time (as determined by QoS events). In particular, a negative result means decoding in time is no longer possible and should therefore occur as soon/skippy as possible.

Parameters:

`decoder` –

a GstVideoDecoder

`frame` –

a GstVideoCodecFrame

Returns –

max decoding time.

#### GstVideo.VideoDecoder.prototype.get_max_decode_time

    function GstVideo.VideoDecoder.prototype.get_max_decode_time(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_get_max_decode_time'
    }

Determines maximum possible decoding time for frame that will allow it to decode and arrive in time (as determined by QoS events). In particular, a negative result means decoding in time is no longer possible and should therefore occur as soon/skippy as possible.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a GstVideo.VideoCodecFrame

Returns (Number) –

max decoding time.

#### GstVideo.VideoDecoder.get_max_decode_time

    def GstVideo.VideoDecoder.get_max_decode_time (self, frame):
        #python wrapper for 'gst_video_decoder_get_max_decode_time'

Determines maximum possible decoding time for frame that will allow it to decode and arrive in time (as determined by QoS events). In particular, a negative result means decoding in time is no longer possible and should therefore occur as soon/skippy as possible.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a GstVideo.VideoCodecFrame

Returns (int) –

max decoding time.

#### gst_video_decoder_get_max_errors

    gint
    gst_video_decoder_get_max_errors (GstVideoDecoder * dec)

Parameters:

`dec` –

a GstVideoDecoder

Returns –

currently configured decoder tolerated error count.

#### GstVideo.VideoDecoder.prototype.get_max_errors

    function GstVideo.VideoDecoder.prototype.get_max_errors(): {
        // javascript wrapper for 'gst_video_decoder_get_max_errors'
    }

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Number) –

currently configured decoder tolerated error count.

#### GstVideo.VideoDecoder.get_max_errors

    def GstVideo.VideoDecoder.get_max_errors (self):
        #python wrapper for 'gst_video_decoder_get_max_errors'

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (int) –

currently configured decoder tolerated error count.

#### gst_video_decoder_get_needs_format

    gboolean
    gst_video_decoder_get_needs_format (GstVideoDecoder * dec)

Queries decoder required format handling.

Parameters:

`dec` –

a GstVideoDecoder

Returns –

TRUE if required format handling is enabled.

Since : 1.4

#### GstVideo.VideoDecoder.prototype.get_needs_format

    function GstVideo.VideoDecoder.prototype.get_needs_format(): {
        // javascript wrapper for 'gst_video_decoder_get_needs_format'
    }

Queries decoder required format handling.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Number) –

TRUE if required format handling is enabled.

Since : 1.4

#### GstVideo.VideoDecoder.get_needs_format

    def GstVideo.VideoDecoder.get_needs_format (self):
        #python wrapper for 'gst_video_decoder_get_needs_format'

Queries decoder required format handling.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (bool) –

TRUE if required format handling is enabled.

Since : 1.4

#### gst_video_decoder_get_needs_sync_point

    gboolean
    gst_video_decoder_get_needs_sync_point (GstVideoDecoder * dec)

Queries if the decoder requires a sync point before it starts outputting data in the beginning.

Parameters:

`dec` –

a GstVideoDecoder

Returns –

TRUE if a sync point is required in the beginning.

Since : 1.20

#### GstVideo.VideoDecoder.prototype.get_needs_sync_point

    function GstVideo.VideoDecoder.prototype.get_needs_sync_point(): {
        // javascript wrapper for 'gst_video_decoder_get_needs_sync_point'
    }

Queries if the decoder requires a sync point before it starts outputting data in the beginning.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Number) –

TRUE if a sync point is required in the beginning.

Since : 1.20

#### GstVideo.VideoDecoder.get_needs_sync_point

    def GstVideo.VideoDecoder.get_needs_sync_point (self):
        #python wrapper for 'gst_video_decoder_get_needs_sync_point'

Queries if the decoder requires a sync point before it starts outputting data in the beginning.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (bool) –

TRUE if a sync point is required in the beginning.

Since : 1.20

#### gst_video_decoder_get_oldest_frame

    GstVideoCodecFrame *
    gst_video_decoder_get_oldest_frame (GstVideoDecoder * decoder)

Get the oldest pending unfinished GstVideoCodecFrame

Parameters:

`decoder` –

a GstVideoDecoder

Returns ( [transfer: full][nullable]) –

oldest pending unfinished GstVideoCodecFrame.

#### GstVideo.VideoDecoder.prototype.get_oldest_frame

    function GstVideo.VideoDecoder.prototype.get_oldest_frame(): {
        // javascript wrapper for 'gst_video_decoder_get_oldest_frame'
    }

Get the oldest pending unfinished GstVideo.VideoCodecFrame

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (GstVideo.VideoCodecFrame) –

oldest pending unfinished GstVideo.VideoCodecFrame.

#### GstVideo.VideoDecoder.get_oldest_frame

    def GstVideo.VideoDecoder.get_oldest_frame (self):
        #python wrapper for 'gst_video_decoder_get_oldest_frame'

Get the oldest pending unfinished GstVideo.VideoCodecFrame

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (GstVideo.VideoCodecFrame) –

oldest pending unfinished GstVideo.VideoCodecFrame.

#### gst_video_decoder_get_output_state

    GstVideoCodecState *
    gst_video_decoder_get_output_state (GstVideoDecoder * decoder)

Get the GstVideoCodecState currently describing the output stream.

Parameters:

`decoder` –

a GstVideoDecoder

Returns ( [transfer: full][nullable]) –

GstVideoCodecState describing format of video data.

#### GstVideo.VideoDecoder.prototype.get_output_state

    function GstVideo.VideoDecoder.prototype.get_output_state(): {
        // javascript wrapper for 'gst_video_decoder_get_output_state'
    }

Get the GstVideo.VideoCodecState currently describing the output stream.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (GstVideo.VideoCodecState) –

GstVideo.VideoCodecState describing format of video data.

#### GstVideo.VideoDecoder.get_output_state

    def GstVideo.VideoDecoder.get_output_state (self):
        #python wrapper for 'gst_video_decoder_get_output_state'

Get the GstVideo.VideoCodecState currently describing the output stream.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (GstVideo.VideoCodecState) –

GstVideo.VideoCodecState describing format of video data.

#### gst_video_decoder_get_packetized

    gboolean
    gst_video_decoder_get_packetized (GstVideoDecoder * decoder)

Queries whether input data is considered packetized or not by the base class.

Parameters:

`decoder` –

a GstVideoDecoder

Returns –

TRUE if input data is considered packetized.

#### GstVideo.VideoDecoder.prototype.get_packetized

    function GstVideo.VideoDecoder.prototype.get_packetized(): {
        // javascript wrapper for 'gst_video_decoder_get_packetized'
    }

Queries whether input data is considered packetized or not by the base class.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Number) –

TRUE if input data is considered packetized.

#### GstVideo.VideoDecoder.get_packetized

    def GstVideo.VideoDecoder.get_packetized (self):
        #python wrapper for 'gst_video_decoder_get_packetized'

Queries whether input data is considered packetized or not by the base class.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (bool) –

TRUE if input data is considered packetized.

#### gst_video_decoder_get_pending_frame_size

    gsize
    gst_video_decoder_get_pending_frame_size (GstVideoDecoder * decoder)

Returns the number of bytes previously added to the current frame by calling gst_video_decoder_add_to_frame.

Parameters:

`decoder` –

a GstVideoDecoder

Returns –

The number of bytes pending for the current frame

Since : 1.4

#### GstVideo.VideoDecoder.prototype.get_pending_frame_size

    function GstVideo.VideoDecoder.prototype.get_pending_frame_size(): {
        // javascript wrapper for 'gst_video_decoder_get_pending_frame_size'
    }

Returns the number of bytes previously added to the current frame by calling GstVideo.VideoDecoder.prototype.add_to_frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Number) –

The number of bytes pending for the current frame

Since : 1.4

#### GstVideo.VideoDecoder.get_pending_frame_size

    def GstVideo.VideoDecoder.get_pending_frame_size (self):
        #python wrapper for 'gst_video_decoder_get_pending_frame_size'

Returns the number of bytes previously added to the current frame by calling GstVideo.VideoDecoder.add_to_frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (int) –

The number of bytes pending for the current frame

Since : 1.4

#### gst_video_decoder_get_processed_subframe_index

    guint
    gst_video_decoder_get_processed_subframe_index (GstVideoDecoder * decoder,
                                                    GstVideoCodecFrame * frame)

Queries the number of subframes in the frame processed by the decoder baseclass.

Parameters:

`decoder` –

a GstVideoDecoder

`frame` ( [transfer: none]) –

the GstVideoCodecFrame to update

Returns –

the current subframe processed received in subframe mode.

Since : 1.20

#### GstVideo.VideoDecoder.prototype.get_processed_subframe_index

    function GstVideo.VideoDecoder.prototype.get_processed_subframe_index(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_get_processed_subframe_index'
    }

Queries the number of subframes in the frame processed by the decoder baseclass.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to update

Returns (Number) –

the current subframe processed received in subframe mode.

Since : 1.20

#### GstVideo.VideoDecoder.get_processed_subframe_index

    def GstVideo.VideoDecoder.get_processed_subframe_index (self, frame):
        #python wrapper for 'gst_video_decoder_get_processed_subframe_index'

Queries the number of subframes in the frame processed by the decoder baseclass.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to update

Returns (int) –

the current subframe processed received in subframe mode.

Since : 1.20

#### gst_video_decoder_get_qos_proportion

    gdouble
    gst_video_decoder_get_qos_proportion (GstVideoDecoder * decoder)

Parameters:

`decoder` –

a GstVideoDecoder current QoS proportion, or NULL

Returns –

The current QoS proportion.

Since : 1.0.3

#### GstVideo.VideoDecoder.prototype.get_qos_proportion

    function GstVideo.VideoDecoder.prototype.get_qos_proportion(): {
        // javascript wrapper for 'gst_video_decoder_get_qos_proportion'
    }

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder current QoS proportion, or NULL

Returns (Number) –

The current QoS proportion.

Since : 1.0.3

#### GstVideo.VideoDecoder.get_qos_proportion

    def GstVideo.VideoDecoder.get_qos_proportion (self):
        #python wrapper for 'gst_video_decoder_get_qos_proportion'

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder current QoS proportion, or NULL

Returns (float) –

The current QoS proportion.

Since : 1.0.3

#### gst_video_decoder_get_subframe_mode

    gboolean
    gst_video_decoder_get_subframe_mode (GstVideoDecoder * decoder)

Queries whether input data is considered as subframes or not by the base class. If FALSE, each input buffer will be considered as a full frame.

Parameters:

`decoder` –

a GstVideoDecoder

Returns –

TRUE if input data is considered as sub frames.

Since : 1.20

#### GstVideo.VideoDecoder.prototype.get_subframe_mode

    function GstVideo.VideoDecoder.prototype.get_subframe_mode(): {
        // javascript wrapper for 'gst_video_decoder_get_subframe_mode'
    }

Queries whether input data is considered as subframes or not by the base class. If FALSE, each input buffer will be considered as a full frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Number) –

TRUE if input data is considered as sub frames.

Since : 1.20

#### GstVideo.VideoDecoder.get_subframe_mode

    def GstVideo.VideoDecoder.get_subframe_mode (self):
        #python wrapper for 'gst_video_decoder_get_subframe_mode'

Queries whether input data is considered as subframes or not by the base class. If FALSE, each input buffer will be considered as a full frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (bool) –

TRUE if input data is considered as sub frames.

Since : 1.20

#### gst_video_decoder_have_frame

    GstFlowReturn
    gst_video_decoder_have_frame (GstVideoDecoder * decoder)

Gathers all data collected for currently parsed frame, gathers corresponding metadata and passes it along for further processing, i.e. handle_frame.

Parameters:

`decoder` –

a GstVideoDecoder

Returns –

a GstFlowReturn

#### GstVideo.VideoDecoder.prototype.have_frame

    function GstVideo.VideoDecoder.prototype.have_frame(): {
        // javascript wrapper for 'gst_video_decoder_have_frame'
    }

Gathers all data collected for currently parsed frame, gathers corresponding metadata and passes it along for further processing, i.e. handle_frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Gst.FlowReturn) –

a Gst.FlowReturn

#### GstVideo.VideoDecoder.have_frame

    def GstVideo.VideoDecoder.have_frame (self):
        #python wrapper for 'gst_video_decoder_have_frame'

Gathers all data collected for currently parsed frame, gathers corresponding metadata and passes it along for further processing, i.e. handle_frame.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Gst.FlowReturn) –

a Gst.FlowReturn

#### gst_video_decoder_have_last_subframe

    GstFlowReturn
    gst_video_decoder_have_last_subframe (GstVideoDecoder * decoder,
                                          GstVideoCodecFrame * frame)

Indicates that the last subframe has been processed by the decoder in frame. This will release the current frame in video decoder allowing to receive new frames from upstream elements. This method must be called in the subclass handle_frame callback.

Parameters:

`decoder` –

a GstVideoDecoder

`frame` ( [transfer: none]) –

the GstVideoCodecFrame to update

Returns –

a GstFlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### GstVideo.VideoDecoder.prototype.have_last_subframe

    function GstVideo.VideoDecoder.prototype.have_last_subframe(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_have_last_subframe'
    }

Indicates that the last subframe has been processed by the decoder in frame. This will release the current frame in video decoder allowing to receive new frames from upstream elements. This method must be called in the subclass handle_frame callback.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to update

Returns (Gst.FlowReturn) –

a Gst.FlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### GstVideo.VideoDecoder.have_last_subframe

    def GstVideo.VideoDecoder.have_last_subframe (self, frame):
        #python wrapper for 'gst_video_decoder_have_last_subframe'

Indicates that the last subframe has been processed by the decoder in frame. This will release the current frame in video decoder allowing to receive new frames from upstream elements. This method must be called in the subclass handle_frame callback.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to update

Returns (Gst.FlowReturn) –

a Gst.FlowReturn, usually GST_FLOW_OK.

Since : 1.20

#### gst_video_decoder_merge_tags

    gst_video_decoder_merge_tags (GstVideoDecoder * decoder,
                                  const GstTagList * tags,
                                  GstTagMergeMode mode)

Sets the audio decoder tags and how they should be merged with any upstream stream tags. This will override any tags previously-set with gst_audio_decoder_merge_tags.

Note that this is provided for convenience, and the subclass is not required to use this and can still do tag handling on its own.

MT safe.

Parameters:

`decoder` –

a GstVideoDecoder

`tags` ( [nullable]) –

a GstTagList to merge, or NULL to unset previously-set tags

`mode` –

the GstTagMergeMode to use, usually GST_TAG_MERGE_REPLACE

#### GstVideo.VideoDecoder.prototype.merge_tags

    function GstVideo.VideoDecoder.prototype.merge_tags(tags: Gst.TagList, mode: Gst.TagMergeMode): {
        // javascript wrapper for 'gst_video_decoder_merge_tags'
    }

Sets the audio decoder tags and how they should be merged with any upstream stream tags. This will override any tags previously-set with GstAudio.AudioDecoder.prototype.merge_tags.

Note that this is provided for convenience, and the subclass is not required to use this and can still do tag handling on its own.

MT safe.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`tags` (Gst.TagList) –

a Gst.TagList to merge, or NULL to unset previously-set tags

`mode` (Gst.TagMergeMode) –

the Gst.TagMergeMode to use, usually Gst.TagMergeMode.REPLACE

#### GstVideo.VideoDecoder.merge_tags

    def GstVideo.VideoDecoder.merge_tags (self, tags, mode):
        #python wrapper for 'gst_video_decoder_merge_tags'

Sets the audio decoder tags and how they should be merged with any upstream stream tags. This will override any tags previously-set with GstAudio.AudioDecoder.merge_tags.

Note that this is provided for convenience, and the subclass is not required to use this and can still do tag handling on its own.

MT safe.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`tags` (Gst.TagList) –

a Gst.TagList to merge, or NULL to unset previously-set tags

`mode` (Gst.TagMergeMode) –

the Gst.TagMergeMode to use, usually Gst.TagMergeMode.REPLACE

#### gst_video_decoder_negotiate

    gboolean
    gst_video_decoder_negotiate (GstVideoDecoder * decoder)

Negotiate with downstream elements to currently configured GstVideoCodecState. Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if negotiate fails.

Parameters:

`decoder` –

a GstVideoDecoder

Returns –

TRUE if the negotiation succeeded, else FALSE.

#### GstVideo.VideoDecoder.prototype.negotiate

    function GstVideo.VideoDecoder.prototype.negotiate(): {
        // javascript wrapper for 'gst_video_decoder_negotiate'
    }

Negotiate with downstream elements to currently configured GstVideo.VideoCodecState. Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if negotiate fails.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (Number) –

TRUE if the negotiation succeeded, else FALSE.

#### GstVideo.VideoDecoder.negotiate

    def GstVideo.VideoDecoder.negotiate (self):
        #python wrapper for 'gst_video_decoder_negotiate'

Negotiate with downstream elements to currently configured GstVideo.VideoCodecState. Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if negotiate fails.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

Returns (bool) –

TRUE if the negotiation succeeded, else FALSE.

#### gst_video_decoder_proxy_getcaps

    GstCaps *
    gst_video_decoder_proxy_getcaps (GstVideoDecoder * decoder,
                                     GstCaps * caps,
                                     GstCaps * filter)

Returns caps that express caps (or sink template caps if caps == NULL) restricted to resolution/format/... combinations supported by downstream elements.

Parameters:

`decoder` –

a GstVideoDecoder

`caps` ( [nullable]) –

initial caps

`filter` ( [nullable]) –

filter caps

Returns ( [transfer: full]) –

a GstCaps owned by caller

Since : 1.6

#### GstVideo.VideoDecoder.prototype.proxy_getcaps

    function GstVideo.VideoDecoder.prototype.proxy_getcaps(caps: Gst.Caps, filter: Gst.Caps): {
        // javascript wrapper for 'gst_video_decoder_proxy_getcaps'
    }

Returns caps that express caps (or sink template caps if caps == NULL) restricted to resolution/format/... combinations supported by downstream elements.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`caps` (Gst.Caps) –

initial caps

`filter` (Gst.Caps) –

filter caps

Returns (Gst.Caps) –

a Gst.Caps owned by caller

Since : 1.6

#### GstVideo.VideoDecoder.proxy_getcaps

    def GstVideo.VideoDecoder.proxy_getcaps (self, caps, filter):
        #python wrapper for 'gst_video_decoder_proxy_getcaps'

Returns caps that express caps (or sink template caps if caps == NULL) restricted to resolution/format/... combinations supported by downstream elements.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`caps` (Gst.Caps) –

initial caps

`filter` (Gst.Caps) –

filter caps

Returns (Gst.Caps) –

a Gst.Caps owned by caller

Since : 1.6

#### gst_video_decoder_release_frame

    gst_video_decoder_release_frame (GstVideoDecoder * dec,
                                     GstVideoCodecFrame * frame)

Similar to gst_video_decoder_drop_frame, but simply releases frame without any processing other than removing it from list of pending frames, after which it is considered finished and released.

Parameters:

`dec` –

a GstVideoDecoder

`frame` ( [transfer: full]) –

the GstVideoCodecFrame to release

Since : 1.2.2

#### GstVideo.VideoDecoder.prototype.release_frame

    function GstVideo.VideoDecoder.prototype.release_frame(frame: GstVideo.VideoCodecFrame): {
        // javascript wrapper for 'gst_video_decoder_release_frame'
    }

Similar to GstVideo.VideoDecoder.prototype.drop_frame, but simply releases frame without any processing other than removing it from list of pending frames, after which it is considered finished and released.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to release

Since : 1.2.2

#### GstVideo.VideoDecoder.release_frame

    def GstVideo.VideoDecoder.release_frame (self, frame):
        #python wrapper for 'gst_video_decoder_release_frame'

Similar to GstVideo.VideoDecoder.drop_frame, but simply releases frame without any processing other than removing it from list of pending frames, after which it is considered finished and released.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

the GstVideo.VideoCodecFrame to release

Since : 1.2.2

#### gst_video_decoder_request_sync_point

    gst_video_decoder_request_sync_point (GstVideoDecoder * dec,
                                          GstVideoCodecFrame * frame,
                                          GstVideoDecoderRequestSyncPointFlags flags)

Allows the GstVideoDecoder subclass to request from the base class that a new sync should be requested from upstream, and that frame was the frame when the subclass noticed that a new sync point is required. A reason for the subclass to do this could be missing reference frames, for example.

The base class will then request a new sync point from upstream as long as the time that passed since the last one is exceeding min-force-key-unit-interval.

The subclass can signal via flags how the frames until the next sync point should be handled:

- If GST_VIDEO_DECODER_REQUEST_SYNC_POINT_DISCARD_INPUT is selected then all following input frames until the next sync point are discarded. This can be useful if the lack of a sync point will prevent all further decoding and the decoder implementation is not very robust in handling missing references frames.
- If GST_VIDEO_DECODER_REQUEST_SYNC_POINT_CORRUPT_OUTPUT is selected then all output frames following frame are marked as corrupted via GST_BUFFER_FLAG_CORRUPTED. Corrupted frames can be automatically dropped by the base class, see discard-corrupted-frames. Subclasses can manually mark frames as corrupted via GST_VIDEO_CODEC_FRAME_FLAG_CORRUPTED before calling gst_video_decoder_finish_frame.

Parameters:

`dec` –

a GstVideoDecoder

`frame` –

a GstVideoCodecFrame

`flags` –

GstVideoDecoderRequestSyncPointFlags

Since : 1.20

#### GstVideo.VideoDecoder.prototype.request_sync_point

    function GstVideo.VideoDecoder.prototype.request_sync_point(frame: GstVideo.VideoCodecFrame, flags: GstVideo.VideoDecoderRequestSyncPointFlags): {
        // javascript wrapper for 'gst_video_decoder_request_sync_point'
    }

Allows the GstVideo.VideoDecoder subclass to request from the base class that a new sync should be requested from upstream, and that frame was the frame when the subclass noticed that a new sync point is required. A reason for the subclass to do this could be missing reference frames, for example.

The base class will then request a new sync point from upstream as long as the time that passed since the last one is exceeding min-force-key-unit-interval.

The subclass can signal via flags how the frames until the next sync point should be handled:

- If GstVideo.VideoDecoderRequestSyncPointFlags.DISCARD_INPUT is selected then all following input frames until the next sync point are discarded. This can be useful if the lack of a sync point will prevent all further decoding and the decoder implementation is not very robust in handling missing references frames.
- If GstVideo.VideoDecoderRequestSyncPointFlags.CORRUPT_OUTPUT is selected then all output frames following frame are marked as corrupted via Gst.BufferFlags.CORRUPTED. Corrupted frames can be automatically dropped by the base class, see discard-corrupted-frames. Subclasses can manually mark frames as corrupted via GstVideo.VideoCodecFrameFlags.CORRUPTED before calling GstVideo.VideoDecoder.prototype.finish_frame.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a GstVideo.VideoCodecFrame

`flags` (GstVideo.VideoDecoderRequestSyncPointFlags) –

GstVideo.VideoDecoderRequestSyncPointFlags

Since : 1.20

#### GstVideo.VideoDecoder.request_sync_point

    def GstVideo.VideoDecoder.request_sync_point (self, frame, flags):
        #python wrapper for 'gst_video_decoder_request_sync_point'

Allows the GstVideo.VideoDecoder subclass to request from the base class that a new sync should be requested from upstream, and that frame was the frame when the subclass noticed that a new sync point is required. A reason for the subclass to do this could be missing reference frames, for example.

The base class will then request a new sync point from upstream as long as the time that passed since the last one is exceeding min_force_key_unit_interval.

The subclass can signal via flags how the frames until the next sync point should be handled:

- If GstVideo.VideoDecoderRequestSyncPointFlags.DISCARD_INPUT is selected then all following input frames until the next sync point are discarded. This can be useful if the lack of a sync point will prevent all further decoding and the decoder implementation is not very robust in handling missing references frames.
- If GstVideo.VideoDecoderRequestSyncPointFlags.CORRUPT_OUTPUT is selected then all output frames following frame are marked as corrupted via Gst.BufferFlags.CORRUPTED. Corrupted frames can be automatically dropped by the base class, see discard_corrupted_frames. Subclasses can manually mark frames as corrupted via GstVideo.VideoCodecFrameFlags.CORRUPTED before calling GstVideo.VideoDecoder.finish_frame.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`frame` (GstVideo.VideoCodecFrame) –

a GstVideo.VideoCodecFrame

`flags` (GstVideo.VideoDecoderRequestSyncPointFlags) –

GstVideo.VideoDecoderRequestSyncPointFlags

Since : 1.20

#### gst_video_decoder_set_estimate_rate

    gst_video_decoder_set_estimate_rate (GstVideoDecoder * dec,
                                         gboolean enabled)

Allows baseclass to perform byte to time estimated conversion.

Parameters:

`dec` –

a GstVideoDecoder

`enabled` –

whether to enable byte to time conversion

#### GstVideo.VideoDecoder.prototype.set_estimate_rate

    function GstVideo.VideoDecoder.prototype.set_estimate_rate(enabled: Number): {
        // javascript wrapper for 'gst_video_decoder_set_estimate_rate'
    }

Allows baseclass to perform byte to time estimated conversion.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`enabled` (Number) –

whether to enable byte to time conversion

#### GstVideo.VideoDecoder.set_estimate_rate

    def GstVideo.VideoDecoder.set_estimate_rate (self, enabled):
        #python wrapper for 'gst_video_decoder_set_estimate_rate'

Allows baseclass to perform byte to time estimated conversion.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`enabled` (bool) –

whether to enable byte to time conversion

#### gst_video_decoder_set_interlaced_output_state

    GstVideoCodecState *
    gst_video_decoder_set_interlaced_output_state (GstVideoDecoder * decoder,
                                                   GstVideoFormat fmt,
                                                   GstVideoInterlaceMode interlace_mode,
                                                   guint width,
                                                   guint height,
                                                   GstVideoCodecState * reference)

Same as gst_video_decoder_set_output_state() but also allows you to also set the interlacing mode.

Parameters:

`decoder` –

a GstVideoDecoder

`fmt` –

a GstVideoFormat

`interlace_mode` –

A GstVideoInterlaceMode

`width` –

The width in pixels

`height` –

The height in pixels

`reference` ( [nullable][transfer: none]) –

An optional reference GstVideoCodecState

Returns ( [transfer: full][nullable]) –

the newly configured output state.

Since : 1.16.

#### GstVideo.VideoDecoder.prototype.set_interlaced_output_state

    function GstVideo.VideoDecoder.prototype.set_interlaced_output_state(fmt: GstVideo.VideoFormat, interlace_mode: GstVideo.VideoInterlaceMode, width: Number, height: Number, reference: GstVideo.VideoCodecState): {
        // javascript wrapper for 'gst_video_decoder_set_interlaced_output_state'
    }

Same as GstVideo.VideoDecoder.prototype.set_output_state() but also allows you to also set the interlacing mode.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`fmt` (GstVideo.VideoFormat) –

a GstVideo.VideoFormat

`interlace_mode` (GstVideo.VideoInterlaceMode) –

A GstVideo.VideoInterlaceMode

`width` (Number) –

The width in pixels

`height` (Number) –

The height in pixels

`reference` (GstVideo.VideoCodecState) –

An optional reference GstVideo.VideoCodecState

Returns (GstVideo.VideoCodecState) –

the newly configured output state.

Since : 1.16.

#### GstVideo.VideoDecoder.set_interlaced_output_state

    def GstVideo.VideoDecoder.set_interlaced_output_state (self, fmt, interlace_mode, width, height, reference):
        #python wrapper for 'gst_video_decoder_set_interlaced_output_state'

Same as GstVideo.VideoDecoder.set_output_state() but also allows you to also set the interlacing mode.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`fmt` (GstVideo.VideoFormat) –

a GstVideo.VideoFormat

`interlace_mode` (GstVideo.VideoInterlaceMode) –

A GstVideo.VideoInterlaceMode

`width` (int) –

The width in pixels

`height` (int) –

The height in pixels

`reference` (GstVideo.VideoCodecState) –

An optional reference GstVideo.VideoCodecState

Returns (GstVideo.VideoCodecState) –

the newly configured output state.

Since : 1.16.

#### gst_video_decoder_set_latency

    gst_video_decoder_set_latency (GstVideoDecoder * decoder,
                                   GstClockTime min_latency,
                                   GstClockTime max_latency)

Lets GstVideoDecoder sub-classes tell the baseclass what the decoder latency is. If the provided values changed from previously provided ones, this will also post a LATENCY message on the bus so the pipeline can reconfigure its global latency.

Parameters:

`decoder` –

a GstVideoDecoder

`min_latency` –

minimum latency

`max_latency` –

maximum latency

#### GstVideo.VideoDecoder.prototype.set_latency

    function GstVideo.VideoDecoder.prototype.set_latency(min_latency: Number, max_latency: Number): {
        // javascript wrapper for 'gst_video_decoder_set_latency'
    }

Lets GstVideo.VideoDecoder sub-classes tell the baseclass what the decoder latency is. If the provided values changed from previously provided ones, this will also post a LATENCY message on the bus so the pipeline can reconfigure its global latency.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`min_latency` (Number) –

minimum latency

`max_latency` (Number) –

maximum latency

#### GstVideo.VideoDecoder.set_latency

    def GstVideo.VideoDecoder.set_latency (self, min_latency, max_latency):
        #python wrapper for 'gst_video_decoder_set_latency'

Lets GstVideo.VideoDecoder sub-classes tell the baseclass what the decoder latency is. If the provided values changed from previously provided ones, this will also post a LATENCY message on the bus so the pipeline can reconfigure its global latency.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`min_latency` (int) –

minimum latency

`max_latency` (int) –

maximum latency

#### gst_video_decoder_set_max_errors

    gst_video_decoder_set_max_errors (GstVideoDecoder * dec,
                                      gint num)

Sets numbers of tolerated decoder errors, where a tolerated one is then only warned about, but more than tolerated will lead to fatal error. You can set -1 for never returning fatal errors. Default is set to GST_VIDEO_DECODER_MAX_ERRORS.

The '-1' option was added in 1.4

Parameters:

`dec` –

a GstVideoDecoder

`num` –

max tolerated errors

#### GstVideo.VideoDecoder.prototype.set_max_errors

    function GstVideo.VideoDecoder.prototype.set_max_errors(num: Number): {
        // javascript wrapper for 'gst_video_decoder_set_max_errors'
    }

Sets numbers of tolerated decoder errors, where a tolerated one is then only warned about, but more than tolerated will lead to fatal error. You can set -1 for never returning fatal errors. Default is set to GST_VIDEO_DECODER_MAX_ERRORS.

The '-1' option was added in 1.4

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`num` (Number) –

max tolerated errors

#### GstVideo.VideoDecoder.set_max_errors

    def GstVideo.VideoDecoder.set_max_errors (self, num):
        #python wrapper for 'gst_video_decoder_set_max_errors'

Sets numbers of tolerated decoder errors, where a tolerated one is then only warned about, but more than tolerated will lead to fatal error. You can set -1 for never returning fatal errors. Default is set to GST_VIDEO_DECODER_MAX_ERRORS.

The '-1' option was added in 1.4

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`num` (int) –

max tolerated errors

#### gst_video_decoder_set_needs_format

    gst_video_decoder_set_needs_format (GstVideoDecoder * dec,
                                        gboolean enabled)

Configures decoder format needs. If enabled, subclass needs to be negotiated with format caps before it can process any data. It will then never be handed any data before it has been configured. Otherwise, it might be handed data without having been configured and is then expected being able to do so either by default or based on the input data.

Parameters:

`dec` –

a GstVideoDecoder

`enabled` –

new state

Since : 1.4

#### GstVideo.VideoDecoder.prototype.set_needs_format

    function GstVideo.VideoDecoder.prototype.set_needs_format(enabled: Number): {
        // javascript wrapper for 'gst_video_decoder_set_needs_format'
    }

Configures decoder format needs. If enabled, subclass needs to be negotiated with format caps before it can process any data. It will then never be handed any data before it has been configured. Otherwise, it might be handed data without having been configured and is then expected being able to do so either by default or based on the input data.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`enabled` (Number) –

new state

Since : 1.4

#### GstVideo.VideoDecoder.set_needs_format

    def GstVideo.VideoDecoder.set_needs_format (self, enabled):
        #python wrapper for 'gst_video_decoder_set_needs_format'

Configures decoder format needs. If enabled, subclass needs to be negotiated with format caps before it can process any data. It will then never be handed any data before it has been configured. Otherwise, it might be handed data without having been configured and is then expected being able to do so either by default or based on the input data.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`enabled` (bool) –

new state

Since : 1.4

#### gst_video_decoder_set_needs_sync_point

    gst_video_decoder_set_needs_sync_point (GstVideoDecoder * dec,
                                            gboolean enabled)

Configures whether the decoder requires a sync point before it starts outputting data in the beginning. If enabled, the base class will discard all non-sync point frames in the beginning and after a flush and does not pass it to the subclass.

If the first frame is not a sync point, the base class will request a sync point via the force-key-unit event.

Parameters:

`dec` –

a GstVideoDecoder

`enabled` –

new state

Since : 1.20

#### GstVideo.VideoDecoder.prototype.set_needs_sync_point

    function GstVideo.VideoDecoder.prototype.set_needs_sync_point(enabled: Number): {
        // javascript wrapper for 'gst_video_decoder_set_needs_sync_point'
    }

Configures whether the decoder requires a sync point before it starts outputting data in the beginning. If enabled, the base class will discard all non-sync point frames in the beginning and after a flush and does not pass it to the subclass.

If the first frame is not a sync point, the base class will request a sync point via the force-key-unit event.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`enabled` (Number) –

new state

Since : 1.20

#### GstVideo.VideoDecoder.set_needs_sync_point

    def GstVideo.VideoDecoder.set_needs_sync_point (self, enabled):
        #python wrapper for 'gst_video_decoder_set_needs_sync_point'

Configures whether the decoder requires a sync point before it starts outputting data in the beginning. If enabled, the base class will discard all non-sync point frames in the beginning and after a flush and does not pass it to the subclass.

If the first frame is not a sync point, the base class will request a sync point via the force-key-unit event.

Parameters:

`dec` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`enabled` (bool) –

new state

Since : 1.20

#### gst_video_decoder_set_output_state

    GstVideoCodecState *
    gst_video_decoder_set_output_state (GstVideoDecoder * decoder,
                                        GstVideoFormat fmt,
                                        guint width,
                                        guint height,
                                        GstVideoCodecState * reference)

Creates a new GstVideoCodecState with the specified fmt, width and height as the output state for the decoder. Any previously set output state on decoder will be replaced by the newly created one.

If the subclass wishes to copy over existing fields (like pixel aspec ratio, or framerate) from an existing GstVideoCodecState, it can be provided as a reference.

If the subclass wishes to override some fields from the output state (like pixel-aspect-ratio or framerate) it can do so on the returned GstVideoCodecState.

The new output state will only take effect (set on pads and buffers) starting from the next call to gst_video_decoder_finish_frame().

Parameters:

`decoder` –

a GstVideoDecoder

`fmt` –

a GstVideoFormat

`width` –

The width in pixels

`height` –

The height in pixels

`reference` ( [nullable][transfer: none]) –

An optional reference GstVideoCodecState

Returns ( [transfer: full][nullable]) –

the newly configured output state.

#### GstVideo.VideoDecoder.prototype.set_output_state

    function GstVideo.VideoDecoder.prototype.set_output_state(fmt: GstVideo.VideoFormat, width: Number, height: Number, reference: GstVideo.VideoCodecState): {
        // javascript wrapper for 'gst_video_decoder_set_output_state'
    }

Creates a new GstVideo.VideoCodecState with the specified fmt, width and height as the output state for the decoder. Any previously set output state on decoder will be replaced by the newly created one.

If the subclass wishes to copy over existing fields (like pixel aspec ratio, or framerate) from an existing GstVideo.VideoCodecState, it can be provided as a reference.

If the subclass wishes to override some fields from the output state (like pixel-aspect-ratio or framerate) it can do so on the returned GstVideo.VideoCodecState.

The new output state will only take effect (set on pads and buffers) starting from the next call to GstVideo.VideoDecoder.prototype.finish_frame().

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`fmt` (GstVideo.VideoFormat) –

a GstVideo.VideoFormat

`width` (Number) –

The width in pixels

`height` (Number) –

The height in pixels

`reference` (GstVideo.VideoCodecState) –

An optional reference GstVideo.VideoCodecState

Returns (GstVideo.VideoCodecState) –

the newly configured output state.

#### GstVideo.VideoDecoder.set_output_state

    def GstVideo.VideoDecoder.set_output_state (self, fmt, width, height, reference):
        #python wrapper for 'gst_video_decoder_set_output_state'

Creates a new GstVideo.VideoCodecState with the specified fmt, width and height as the output state for the decoder. Any previously set output state on decoder will be replaced by the newly created one.

If the subclass wishes to copy over existing fields (like pixel aspec ratio, or framerate) from an existing GstVideo.VideoCodecState, it can be provided as a reference.

If the subclass wishes to override some fields from the output state (like pixel-aspect-ratio or framerate) it can do so on the returned GstVideo.VideoCodecState.

The new output state will only take effect (set on pads and buffers) starting from the next call to GstVideo.VideoDecoder.finish_frame().

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`fmt` (GstVideo.VideoFormat) –

a GstVideo.VideoFormat

`width` (int) –

The width in pixels

`height` (int) –

The height in pixels

`reference` (GstVideo.VideoCodecState) –

An optional reference GstVideo.VideoCodecState

Returns (GstVideo.VideoCodecState) –

the newly configured output state.

#### gst_video_decoder_set_packetized

    gst_video_decoder_set_packetized (GstVideoDecoder * decoder,
                                      gboolean packetized)

Allows baseclass to consider input data as packetized or not. If the input is packetized, then the parse method will not be called.

Parameters:

`decoder` –

a GstVideoDecoder

`packetized` –

whether the input data should be considered as packetized.

#### GstVideo.VideoDecoder.prototype.set_packetized

    function GstVideo.VideoDecoder.prototype.set_packetized(packetized: Number): {
        // javascript wrapper for 'gst_video_decoder_set_packetized'
    }

Allows baseclass to consider input data as packetized or not. If the input is packetized, then the parse method will not be called.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`packetized` (Number) –

whether the input data should be considered as packetized.

#### GstVideo.VideoDecoder.set_packetized

    def GstVideo.VideoDecoder.set_packetized (self, packetized):
        #python wrapper for 'gst_video_decoder_set_packetized'

Allows baseclass to consider input data as packetized or not. If the input is packetized, then the parse method will not be called.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`packetized` (bool) –

whether the input data should be considered as packetized.

#### gst_video_decoder_set_subframe_mode

    gst_video_decoder_set_subframe_mode (GstVideoDecoder * decoder,
                                         gboolean subframe_mode)

If this is set to TRUE, it informs the base class that the subclass can receive the data at a granularity lower than one frame.

Note that in this mode, the subclass has two options. It can either require the presence of a GST_VIDEO_BUFFER_FLAG_MARKER to mark the end of a frame. Or it can operate in such a way that it will decode a single frame at a time. In this second case, every buffer that arrives to the element is considered part of the same frame until gst_video_decoder_finish_frame is called.

In either case, the same GstVideoCodecFrame will be passed to the GstVideoDecoderClass:handle_frame vmethod repeatedly with a different GstVideoCodecFrame:input_buffer every time until the end of the frame has been signaled using either method. This method must be called during the decoder subclass set_format call.

Parameters:

`decoder` –

a GstVideoDecoder

`subframe_mode` –

whether the input data should be considered as subframes.

Since : 1.20

#### GstVideo.VideoDecoder.prototype.set_subframe_mode

    function GstVideo.VideoDecoder.prototype.set_subframe_mode(subframe_mode: Number): {
        // javascript wrapper for 'gst_video_decoder_set_subframe_mode'
    }

If this is set to TRUE, it informs the base class that the subclass can receive the data at a granularity lower than one frame.

Note that in this mode, the subclass has two options. It can either require the presence of a GST_VIDEO_BUFFER_FLAG_MARKER to mark the end of a frame. Or it can operate in such a way that it will decode a single frame at a time. In this second case, every buffer that arrives to the element is considered part of the same frame until GstVideo.VideoDecoder.prototype.finish_frame is called.

In either case, the same GstVideo.VideoCodecFrame will be passed to the GstVideoDecoderClass:handle_frame vmethod repeatedly with a different GstVideoCodecFrame:input_buffer every time until the end of the frame has been signaled using either method. This method must be called during the decoder subclass set_format call.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`subframe_mode` (Number) –

whether the input data should be considered as subframes.

Since : 1.20

#### GstVideo.VideoDecoder.set_subframe_mode

    def GstVideo.VideoDecoder.set_subframe_mode (self, subframe_mode):
        #python wrapper for 'gst_video_decoder_set_subframe_mode'

If this is set to TRUE, it informs the base class that the subclass can receive the data at a granularity lower than one frame.

Note that in this mode, the subclass has two options. It can either require the presence of a GST_VIDEO_BUFFER_FLAG_MARKER to mark the end of a frame. Or it can operate in such a way that it will decode a single frame at a time. In this second case, every buffer that arrives to the element is considered part of the same frame until GstVideo.VideoDecoder.finish_frame is called.

In either case, the same GstVideo.VideoCodecFrame will be passed to the GstVideoDecoderClass:handle_frame vmethod repeatedly with a different GstVideoCodecFrame:input_buffer every time until the end of the frame has been signaled using either method. This method must be called during the decoder subclass set_format call.

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`subframe_mode` (bool) –

whether the input data should be considered as subframes.

Since : 1.20

#### gst_video_decoder_set_use_default_pad_acceptcaps

    gst_video_decoder_set_use_default_pad_acceptcaps (GstVideoDecoder * decoder,
                                                      gboolean use)

Lets GstVideoDecoder sub-classes decide if they want the sink pad to use the default pad query handler to reply to accept-caps queries.

By setting this to true it is possible to further customize the default handler with GST_PAD_SET_ACCEPT_INTERSECT and GST_PAD_SET_ACCEPT_TEMPLATE

Parameters:

`decoder` –

a GstVideoDecoder

`use` –

if the default pad accept-caps query handling should be used

Since : 1.6

#### GstVideo.VideoDecoder.prototype.set_use_default_pad_acceptcaps

    function GstVideo.VideoDecoder.prototype.set_use_default_pad_acceptcaps(use: Number): {
        // javascript wrapper for 'gst_video_decoder_set_use_default_pad_acceptcaps'
    }

Lets GstVideo.VideoDecoder sub-classes decide if they want the sink pad to use the default pad query handler to reply to accept-caps queries.

By setting this to true it is possible to further customize the default handler with GST_PAD_SET_ACCEPT_INTERSECT (not introspectable) and GST_PAD_SET_ACCEPT_TEMPLATE (not introspectable)

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`use` (Number) –

if the default pad accept-caps query handling should be used

Since : 1.6

#### GstVideo.VideoDecoder.set_use_default_pad_acceptcaps

    def GstVideo.VideoDecoder.set_use_default_pad_acceptcaps (self, use):
        #python wrapper for 'gst_video_decoder_set_use_default_pad_acceptcaps'

Lets GstVideo.VideoDecoder sub-classes decide if they want the sink pad to use the default pad query handler to reply to accept-caps queries.

By setting this to true it is possible to further customize the default handler with GST_PAD_SET_ACCEPT_INTERSECT (not introspectable) and GST_PAD_SET_ACCEPT_TEMPLATE (not introspectable)

Parameters:

`decoder` (GstVideo.VideoDecoder) –

a GstVideo.VideoDecoder

`use` (bool) –

if the default pad accept-caps query handling should be used

Since : 1.6

### Properties

#### automatic-request-sync-point-flags

    “automatic-request-sync-point-flags” GstVideoDecoderRequestSyncPointFlags *

GstVideoDecoderRequestSyncPointFlags to use for the automatically requested sync points if `automatic-request-sync-points` is enabled.

Flags : Read / Write

Since : 1.20

#### automatic-request-sync-point-flags

    “automatic-request-sync-point-flags” GstVideo.VideoDecoderRequestSyncPointFlags

GstVideoDecoderRequestSyncPointFlags to use for the automatically requested sync points if `automatic-request-sync-points` is enabled.

Flags : Read / Write

Since : 1.20

#### automatic_request_sync_point_flags

    “self.props.automatic_request_sync_point_flags” GstVideo.VideoDecoderRequestSyncPointFlags

GstVideoDecoderRequestSyncPointFlags to use for the automatically requested sync points if `automatic-request-sync-points` is enabled.

Flags : Read / Write

Since : 1.20

#### automatic-request-sync-points

    “automatic-request-sync-points” gboolean

If set to TRUE the decoder will automatically request sync points when it seems like a good idea, e.g. if the first frames are not key frames or if packet loss was reported by upstream.

Flags : Read / Write

Since : 1.20

#### automatic-request-sync-points

    “automatic-request-sync-points” Number

If set to TRUE the decoder will automatically request sync points when it seems like a good idea, e.g. if the first frames are not key frames or if packet loss was reported by upstream.

Flags : Read / Write

Since : 1.20

#### automatic_request_sync_points

    “self.props.automatic_request_sync_points” bool

If set to TRUE the decoder will automatically request sync points when it seems like a good idea, e.g. if the first frames are not key frames or if packet loss was reported by upstream.

Flags : Read / Write

Since : 1.20

#### discard-corrupted-frames

    “discard-corrupted-frames” gboolean

If set to TRUE the decoder will discard frames that are marked as corrupted instead of outputting them.

Flags : Read / Write

Since : 1.20

#### discard-corrupted-frames

    “discard-corrupted-frames” Number

If set to TRUE the decoder will discard frames that are marked as corrupted instead of outputting them.

Flags : Read / Write

Since : 1.20

#### discard_corrupted_frames

    “self.props.discard_corrupted_frames” bool

If set to TRUE the decoder will discard frames that are marked as corrupted instead of outputting them.

Flags : Read / Write

Since : 1.20

#### max-errors

    “max-errors” gint

Maximum number of tolerated consecutive decode errors. See gst_video_decoder_set_max_errors for more details.

Flags : Read / Write

Since : 1.18

#### max-errors

    “max-errors” Number

Maximum number of tolerated consecutive decode errors. See GstVideo.VideoDecoder.prototype.set_max_errors for more details.

Flags : Read / Write

Since : 1.18

#### max_errors

    “self.props.max_errors” int

Maximum number of tolerated consecutive decode errors. See GstVideo.VideoDecoder.set_max_errors for more details.

Flags : Read / Write

Since : 1.18

#### min-force-key-unit-interval

    “min-force-key-unit-interval” guint64

Minimum interval between force-key-unit events sent upstream by the decoder. Setting this to 0 will cause every event to be handled, setting this to GST_CLOCK_TIME_NONE will cause every event to be ignored.

See gst_video_event_new_upstream_force_key_unit for more details about force-key-unit events.

Flags : Read / Write

Since : 1.20

#### min-force-key-unit-interval

    “min-force-key-unit-interval” Number

Minimum interval between force-key-unit events sent upstream by the decoder. Setting this to 0 will cause every event to be handled, setting this to Gst.CLOCK_TIME_NONE will cause every event to be ignored.

See GstVideo.prototype.video_event_new_upstream_force_key_unit for more details about force-key-unit events.

Flags : Read / Write

Since : 1.20

#### min_force_key_unit_interval

    “self.props.min_force_key_unit_interval” int

Minimum interval between force-key-unit events sent upstream by the decoder. Setting this to 0 will cause every event to be handled, setting this to Gst.CLOCK_TIME_NONE will cause every event to be ignored.

See GstVideo.video_event_new_upstream_force_key_unit for more details about force-key-unit events.

Flags : Read / Write

Since : 1.20

#### qos

    “qos” gboolean

If set to TRUE the decoder will handle QoS events received from downstream elements. This includes dropping output frames which are detected as late using the metrics reported by those events.

Flags : Read / Write

Since : 1.18

#### qos

    “qos” Number

If set to TRUE the decoder will handle QoS events received from downstream elements. This includes dropping output frames which are detected as late using the metrics reported by those events.

Flags : Read / Write

Since : 1.18

#### qos

    “self.props.qos” bool

If set to TRUE the decoder will handle QoS events received from downstream elements. This includes dropping output frames which are detected as late using the metrics reported by those events.

Flags : Read / Write

Since : 1.18

### Virtual Methods

#### close

    gboolean
    close (GstVideoDecoder * decoder)

Optional. Called when the element changes to GST_STATE_NULL. Allows closing external resources.

Parameters:

`decoder` –
No description available
Returns –
No description available

#### vfunc_close

    function vfunc_close(decoder: GstVideo.VideoDecoder): {
        // javascript implementation of the 'close' virtual method
    }

Optional. Called when the element changes to GST_STATE_NULL. Allows closing external resources.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Number) –
No description available

#### do_close

    def do_close (decoder):
        #python implementation of the 'close' virtual method

Optional. Called when the element changes to GST_STATE_NULL. Allows closing external resources.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (bool) –
No description available

#### decide_allocation

    gboolean
    decide_allocation (GstVideoDecoder * decoder,
                       GstQuery * query)

Optional. Setup the allocation parameters for allocating output buffers. The passed in query contains the result of the downstream allocation query. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` –
No description available
`query` –
No description available
Returns –
No description available

#### vfunc_decide_allocation

    function vfunc_decide_allocation(decoder: GstVideo.VideoDecoder, query: Gst.Query): {
        // javascript implementation of the 'decide_allocation' virtual method
    }

Optional. Setup the allocation parameters for allocating output buffers. The passed in query contains the result of the downstream allocation query. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`query` (Gst.Query) –
No description available
Returns (Number) –
No description available

#### do_decide_allocation

    def do_decide_allocation (decoder, query):
        #python implementation of the 'decide_allocation' virtual method

Optional. Setup the allocation parameters for allocating output buffers. The passed in query contains the result of the downstream allocation query. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`query` (Gst.Query) –
No description available
Returns (bool) –
No description available

#### drain

    GstFlowReturn
    drain (GstVideoDecoder * decoder)

Optional. Called to request subclass to decode any data it can at this point, but that more data may arrive after. (e.g. at segment end). Sub-classes should be prepared to handle new data afterward, or seamless segment processing will break. Since: 1.6

Parameters:

`decoder` –
No description available
Returns –
No description available

#### vfunc_drain

    function vfunc_drain(decoder: GstVideo.VideoDecoder): {
        // javascript implementation of the 'drain' virtual method
    }

Optional. Called to request subclass to decode any data it can at this point, but that more data may arrive after. (e.g. at segment end). Sub-classes should be prepared to handle new data afterward, or seamless segment processing will break. Since: 1.6

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_drain

    def do_drain (decoder):
        #python implementation of the 'drain' virtual method

Optional. Called to request subclass to decode any data it can at this point, but that more data may arrive after. (e.g. at segment end). Sub-classes should be prepared to handle new data afterward, or seamless segment processing will break. Since: 1.6

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### finish

    GstFlowReturn
    finish (GstVideoDecoder * decoder)

Optional. Called to request subclass to dispatch any pending remaining data at EOS. Sub-classes can refuse to decode new data after.

Parameters:

`decoder` –
No description available
Returns –
No description available

#### vfunc_finish

    function vfunc_finish(decoder: GstVideo.VideoDecoder): {
        // javascript implementation of the 'finish' virtual method
    }

Optional. Called to request subclass to dispatch any pending remaining data at EOS. Sub-classes can refuse to decode new data after.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_finish

    def do_finish (decoder):
        #python implementation of the 'finish' virtual method

Optional. Called to request subclass to dispatch any pending remaining data at EOS. Sub-classes can refuse to decode new data after.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### flush

    gboolean
    flush (GstVideoDecoder * decoder)

Optional. Flush all remaining data from the decoder without pushing it downstream. Since: 1.2

Parameters:

`decoder` –
No description available
Returns –
No description available

#### vfunc_flush

    function vfunc_flush(decoder: GstVideo.VideoDecoder): {
        // javascript implementation of the 'flush' virtual method
    }

Optional. Flush all remaining data from the decoder without pushing it downstream. Since: 1.2

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Number) –
No description available

#### do_flush

    def do_flush (decoder):
        #python implementation of the 'flush' virtual method

Optional. Flush all remaining data from the decoder without pushing it downstream. Since: 1.2

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (bool) –
No description available

#### getcaps

    GstCaps *
    getcaps (GstVideoDecoder * decoder,
             GstCaps * filter)

Optional. Allows for a custom sink getcaps implementation. If not implemented, default returns gst_video_decoder_proxy_getcaps applied to sink template caps.

Parameters:

`decoder` –
No description available
`filter` –
No description available
Returns –
No description available

#### vfunc_getcaps

    function vfunc_getcaps(decoder: GstVideo.VideoDecoder, filter: Gst.Caps): {
        // javascript implementation of the 'getcaps' virtual method
    }

Optional. Allows for a custom sink getcaps implementation. If not implemented, default returns gst_video_decoder_proxy_getcaps applied to sink template caps.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`filter` (Gst.Caps) –
No description available
Returns (Gst.Caps) –
No description available

#### do_getcaps

    def do_getcaps (decoder, filter):
        #python implementation of the 'getcaps' virtual method

Optional. Allows for a custom sink getcaps implementation. If not implemented, default returns gst_video_decoder_proxy_getcaps applied to sink template caps.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`filter` (Gst.Caps) –
No description available
Returns (Gst.Caps) –
No description available

#### handle_frame

    GstFlowReturn
    handle_frame (GstVideoDecoder * decoder,
                  GstVideoCodecFrame * frame)

Provides input data frame to subclass. In subframe mode, the subclass needs to take ownership of GstVideoCodecFrame.input_buffer as it will be modified by the base class on the next subframe buffer receiving.

Parameters:

`decoder` –
No description available
`frame` –
No description available
Returns –
No description available

#### vfunc_handle_frame

    function vfunc_handle_frame(decoder: GstVideo.VideoDecoder, frame: GstVideo.VideoCodecFrame): {
        // javascript implementation of the 'handle_frame' virtual method
    }

Provides input data frame to subclass. In subframe mode, the subclass needs to take ownership of GstVideoCodecFrame.input_buffer as it will be modified by the base class on the next subframe buffer receiving.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`frame` (GstVideo.VideoCodecFrame) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_handle_frame

    def do_handle_frame (decoder, frame):
        #python implementation of the 'handle_frame' virtual method

Provides input data frame to subclass. In subframe mode, the subclass needs to take ownership of GstVideoCodecFrame.input_buffer as it will be modified by the base class on the next subframe buffer receiving.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`frame` (GstVideo.VideoCodecFrame) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### handle_missing_data

    gboolean
    handle_missing_data (GstVideoDecoder * decoder,
                         GstClockTime timestamp,
                         GstClockTime duration)

Parameters:

`decoder` –

The GstVideoDecoder

`timestamp` –

Timestamp of the missing data

`duration` –

Duration of the missing data

Returns –

TRUE if the decoder should be drained afterwards.

Since : 1.20

#### vfunc_handle_missing_data

    function vfunc_handle_missing_data(decoder: GstVideo.VideoDecoder, timestamp: Number, duration: Number): {
        // javascript implementation of the 'handle_missing_data' virtual method
    }

Parameters:

`decoder` (GstVideo.VideoDecoder) –

The GstVideo.VideoDecoder

`timestamp` (Number) –

Timestamp of the missing data

`duration` (Number) –

Duration of the missing data

Returns (Number) –

TRUE if the decoder should be drained afterwards.

Since : 1.20

#### do_handle_missing_data

    def do_handle_missing_data (decoder, timestamp, duration):
        #python implementation of the 'handle_missing_data' virtual method

Parameters:

`decoder` (GstVideo.VideoDecoder) –

The GstVideo.VideoDecoder

`timestamp` (int) –

Timestamp of the missing data

`duration` (int) –

Duration of the missing data

Returns (bool) –

TRUE if the decoder should be drained afterwards.

Since : 1.20

#### negotiate

    gboolean
    negotiate (GstVideoDecoder * decoder)

Optional. Negotiate with downstream and configure buffer pools, etc. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` –
No description available
Returns –
No description available

#### vfunc_negotiate

    function vfunc_negotiate(decoder: GstVideo.VideoDecoder): {
        // javascript implementation of the 'negotiate' virtual method
    }

Optional. Negotiate with downstream and configure buffer pools, etc. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Number) –
No description available

#### do_negotiate

    def do_negotiate (decoder):
        #python implementation of the 'negotiate' virtual method

Optional. Negotiate with downstream and configure buffer pools, etc. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (bool) –
No description available

#### open

    gboolean
    open (GstVideoDecoder * decoder)

Optional. Called when the element changes to GST_STATE_READY. Allows opening external resources.

Parameters:

`decoder` –
No description available
Returns –
No description available

#### vfunc_open

    function vfunc_open(decoder: GstVideo.VideoDecoder): {
        // javascript implementation of the 'open' virtual method
    }

Optional. Called when the element changes to GST_STATE_READY. Allows opening external resources.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Number) –
No description available

#### do_open

    def do_open (decoder):
        #python implementation of the 'open' virtual method

Optional. Called when the element changes to GST_STATE_READY. Allows opening external resources.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (bool) –
No description available

#### parse

    GstFlowReturn
    parse (GstVideoDecoder * decoder,
           GstVideoCodecFrame * frame,
           GstAdapter * adapter,
           gboolean at_eos)

Required for non-packetized input. Allows chopping incoming data into manageable units (frames) for subsequent decoding.

Parameters:

`decoder` –
No description available
`frame` –
No description available
`adapter` –
No description available
`at_eos` –
No description available
Returns –
No description available

#### vfunc_parse

    function vfunc_parse(decoder: GstVideo.VideoDecoder, frame: GstVideo.VideoCodecFrame, adapter: GstBase.Adapter, at_eos: Number): {
        // javascript implementation of the 'parse' virtual method
    }

Required for non-packetized input. Allows chopping incoming data into manageable units (frames) for subsequent decoding.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`frame` (GstVideo.VideoCodecFrame) –
No description available
`adapter` (GstBase.Adapter) –
No description available
`at_eos` (Number) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### do_parse

    def do_parse (decoder, frame, adapter, at_eos):
        #python implementation of the 'parse' virtual method

Required for non-packetized input. Allows chopping incoming data into manageable units (frames) for subsequent decoding.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`frame` (GstVideo.VideoCodecFrame) –
No description available
`adapter` (GstBase.Adapter) –
No description available
`at_eos` (bool) –
No description available
Returns (Gst.FlowReturn) –
No description available

#### propose_allocation

    gboolean
    propose_allocation (GstVideoDecoder * decoder,
                        GstQuery * query)

Optional. Propose buffer allocation parameters for upstream elements. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` –
No description available
`query` –
No description available
Returns –
No description available

#### vfunc_propose_allocation

    function vfunc_propose_allocation(decoder: GstVideo.VideoDecoder, query: Gst.Query): {
        // javascript implementation of the 'propose_allocation' virtual method
    }

Optional. Propose buffer allocation parameters for upstream elements. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`query` (Gst.Query) –
No description available
Returns (Number) –
No description available

#### do_propose_allocation

    def do_propose_allocation (decoder, query):
        #python implementation of the 'propose_allocation' virtual method

Optional. Propose buffer allocation parameters for upstream elements. Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`query` (Gst.Query) –
No description available
Returns (bool) –
No description available

#### reset

    gboolean
    reset (GstVideoDecoder * decoder,
           gboolean hard)

Optional. Allows subclass (decoder) to perform post-seek semantics reset. Deprecated.

Parameters:

`decoder` –
No description available
`hard` –
No description available
Returns –
No description available

#### vfunc_reset

    function vfunc_reset(decoder: GstVideo.VideoDecoder, hard: Number): {
        // javascript implementation of the 'reset' virtual method
    }

Optional. Allows subclass (decoder) to perform post-seek semantics reset. Deprecated.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`hard` (Number) –
No description available
Returns (Number) –
No description available

#### do_reset

    def do_reset (decoder, hard):
        #python implementation of the 'reset' virtual method

Optional. Allows subclass (decoder) to perform post-seek semantics reset. Deprecated.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`hard` (bool) –
No description available
Returns (bool) –
No description available

#### set_format

    gboolean
    set_format (GstVideoDecoder * decoder,
                GstVideoCodecState * state)

Notifies subclass of incoming data format (caps).

Parameters:

`decoder` –
No description available
`state` –
No description available
Returns –
No description available

#### vfunc_set_format

    function vfunc_set_format(decoder: GstVideo.VideoDecoder, state: GstVideo.VideoCodecState): {
        // javascript implementation of the 'set_format' virtual method
    }

Notifies subclass of incoming data format (caps).

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`state` (GstVideo.VideoCodecState) –
No description available
Returns (Number) –
No description available

#### do_set_format

    def do_set_format (decoder, state):
        #python implementation of the 'set_format' virtual method

Notifies subclass of incoming data format (caps).

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`state` (GstVideo.VideoCodecState) –
No description available
Returns (bool) –
No description available

#### sink_event

    gboolean
    sink_event (GstVideoDecoder * decoder,
                GstEvent * event)

Optional. Event handler on the sink pad. This function should return TRUE if the event was handled and should be discarded (i.e. not unref'ed). Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` –
No description available
`event` –
No description available
Returns –
No description available

#### vfunc_sink_event

    function vfunc_sink_event(decoder: GstVideo.VideoDecoder, event: Gst.Event): {
        // javascript implementation of the 'sink_event' virtual method
    }

Optional. Event handler on the sink pad. This function should return TRUE if the event was handled and should be discarded (i.e. not unref'ed). Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`event` (Gst.Event) –
No description available
Returns (Number) –
No description available

#### do_sink_event

    def do_sink_event (decoder, event):
        #python implementation of the 'sink_event' virtual method

Optional. Event handler on the sink pad. This function should return TRUE if the event was handled and should be discarded (i.e. not unref'ed). Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`event` (Gst.Event) –
No description available
Returns (bool) –
No description available

#### sink_query

    gboolean
    sink_query (GstVideoDecoder * decoder,
                GstQuery * query)

Optional. Query handler on the sink pad. This function should return TRUE if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler. Since: 1.4

Parameters:

`decoder` –
No description available
`query` –
No description available
Returns –
No description available

#### vfunc_sink_query

    function vfunc_sink_query(decoder: GstVideo.VideoDecoder, query: Gst.Query): {
        // javascript implementation of the 'sink_query' virtual method
    }

Optional. Query handler on the sink pad. This function should return TRUE if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler. Since: 1.4

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`query` (Gst.Query) –
No description available
Returns (Number) –
No description available

#### do_sink_query

    def do_sink_query (decoder, query):
        #python implementation of the 'sink_query' virtual method

Optional. Query handler on the sink pad. This function should return TRUE if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler. Since: 1.4

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`query` (Gst.Query) –
No description available
Returns (bool) –
No description available

#### src_event

    gboolean
    src_event (GstVideoDecoder * decoder,
               GstEvent * event)

Optional. Event handler on the source pad. This function should return TRUE if the event was handled and should be discarded (i.e. not unref'ed). Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` –
No description available
`event` –
No description available
Returns –
No description available

#### vfunc_src_event

    function vfunc_src_event(decoder: GstVideo.VideoDecoder, event: Gst.Event): {
        // javascript implementation of the 'src_event' virtual method
    }

Optional. Event handler on the source pad. This function should return TRUE if the event was handled and should be discarded (i.e. not unref'ed). Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`event` (Gst.Event) –
No description available
Returns (Number) –
No description available

#### do_src_event

    def do_src_event (decoder, event):
        #python implementation of the 'src_event' virtual method

Optional. Event handler on the source pad. This function should return TRUE if the event was handled and should be discarded (i.e. not unref'ed). Subclasses should chain up to the parent implementation to invoke the default handler.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`event` (Gst.Event) –
No description available
Returns (bool) –
No description available

#### src_query

    gboolean
    src_query (GstVideoDecoder * decoder,
               GstQuery * query)

Optional. Query handler on the source pad. This function should return TRUE if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler. Since: 1.4

Parameters:

`decoder` –
No description available
`query` –
No description available
Returns –
No description available

#### vfunc_src_query

    function vfunc_src_query(decoder: GstVideo.VideoDecoder, query: Gst.Query): {
        // javascript implementation of the 'src_query' virtual method
    }

Optional. Query handler on the source pad. This function should return TRUE if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler. Since: 1.4

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`query` (Gst.Query) –
No description available
Returns (Number) –
No description available

#### do_src_query

    def do_src_query (decoder, query):
        #python implementation of the 'src_query' virtual method

Optional. Query handler on the source pad. This function should return TRUE if the query could be performed. Subclasses should chain up to the parent implementation to invoke the default handler. Since: 1.4

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`query` (Gst.Query) –
No description available
Returns (bool) –
No description available

#### start

    gboolean
    start (GstVideoDecoder * decoder)

Optional. Called when the element starts processing. Allows opening external resources.

Parameters:

`decoder` –
No description available
Returns –
No description available

#### vfunc_start

    function vfunc_start(decoder: GstVideo.VideoDecoder): {
        // javascript implementation of the 'start' virtual method
    }

Optional. Called when the element starts processing. Allows opening external resources.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Number) –
No description available

#### do_start

    def do_start (decoder):
        #python implementation of the 'start' virtual method

Optional. Called when the element starts processing. Allows opening external resources.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (bool) –
No description available

#### stop

    gboolean
    stop (GstVideoDecoder * decoder)

Optional. Called when the element stops processing. Allows closing external resources.

Parameters:

`decoder` –
No description available
Returns –
No description available

#### vfunc_stop

    function vfunc_stop(decoder: GstVideo.VideoDecoder): {
        // javascript implementation of the 'stop' virtual method
    }

Optional. Called when the element stops processing. Allows closing external resources.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (Number) –
No description available

#### do_stop

    def do_stop (decoder):
        #python implementation of the 'stop' virtual method

Optional. Called when the element stops processing. Allows closing external resources.

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
Returns (bool) –
No description available

#### transform_meta

    gboolean
    transform_meta (GstVideoDecoder * decoder,
                    GstVideoCodecFrame * frame,
                    GstMeta * meta)

Optional. Transform the metadata on the input buffer to the output buffer. By default this method is copies all meta without tags and meta with only the "video" tag. subclasses can implement this method and return TRUE if the metadata is to be copied. Since: 1.6

Parameters:

`decoder` –
No description available
`frame` –
No description available
`meta` –
No description available
Returns –
No description available

#### vfunc_transform_meta

    function vfunc_transform_meta(decoder: GstVideo.VideoDecoder, frame: GstVideo.VideoCodecFrame, meta: Gst.Meta): {
        // javascript implementation of the 'transform_meta' virtual method
    }

Optional. Transform the metadata on the input buffer to the output buffer. By default this method is copies all meta without tags and meta with only the "video" tag. subclasses can implement this method and return TRUE if the metadata is to be copied. Since: 1.6

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`frame` (GstVideo.VideoCodecFrame) –
No description available
`meta` (Gst.Meta) –
No description available
Returns (Number) –
No description available

#### do_transform_meta

    def do_transform_meta (decoder, frame, meta):
        #python implementation of the 'transform_meta' virtual method

Optional. Transform the metadata on the input buffer to the output buffer. By default this method is copies all meta without tags and meta with only the "video" tag. subclasses can implement this method and return TRUE if the metadata is to be copied. Since: 1.6

Parameters:

`decoder` (GstVideo.VideoDecoder) –
No description available
`frame` (GstVideo.VideoCodecFrame) –
No description available
`meta` (Gst.Meta) –
No description available
Returns (bool) –
No description available

## Function Macros

### GST_VIDEO_DECODER_CAST

    #define GST_VIDEO_DECODER_CAST(obj) ((GstVideoDecoder *)(obj))

### GST_VIDEO_DECODER_ERROR

    #define GST_VIDEO_DECODER_ERROR(el, w, domain, code, text, debug, ret) \
    G_STMT_START {                                                              \
      gchar *__txt = _gst_element_error_printf text;                            \
      gchar *__dbg = _gst_element_error_printf debug;                           \
      GstVideoDecoder *__dec = GST_VIDEO_DECODER (el);                   \
      ret = _gst_video_decoder_error (__dec, w, GST_ ## domain ## _ERROR,    \
          GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,            \
          GST_FUNCTION, __LINE__);                                              \
    } G_STMT_END

Utility function that video decoder elements can use in case they encountered a data processing error that may be fatal for the current "data unit" but need not prevent subsequent decoding. Such errors are counted and if there are too many, as configured in the context's max_errors, the pipeline will post an error message and the application will be requested to stop further media processing. Otherwise, it is considered a "glitch" and only a warning is logged. In either case, ret is set to the proper value to return to upstream/caller (indicating either GST_FLOW_ERROR or GST_FLOW_OK).

Parameters:

`el` –

the base video decoder element that generates the error

`w` –

element defined weight of the error, added to error count

`domain` –

like CORE, LIBRARY, RESOURCE or STREAM (see Core Library-GstGError)

`code` –

error code defined for that domain (see Core Library-GstGError)

`text` –

the message to display (format string and args enclosed in parentheses)

`debug` –

debugging information for the message (format string and args enclosed in parentheses)

`ret` –

variable to receive return value

### GST_VIDEO_DECODER_INPUT_SEGMENT

    #define GST_VIDEO_DECODER_INPUT_SEGMENT(obj)     (GST_VIDEO_DECODER_CAST (obj)->input_segment)

Gives the segment of the element.

Parameters:

`obj` –

base decoder instance

### GST_VIDEO_DECODER_OUTPUT_SEGMENT

    #define GST_VIDEO_DECODER_OUTPUT_SEGMENT(obj)     (GST_VIDEO_DECODER_CAST (obj)->output_segment)

Gives the segment of the element.

Parameters:

`obj` –

base decoder instance

### GST_VIDEO_DECODER_SINK_PAD

    #define GST_VIDEO_DECODER_SINK_PAD(obj)        (((GstVideoDecoder *) (obj))->sinkpad)

Gives the pointer to the sink GstPad object of the element.

Parameters:

`obj` –

a GstVideoDecoder

### GST_VIDEO_DECODER_SRC_PAD

    #define GST_VIDEO_DECODER_SRC_PAD(obj)         (((GstVideoDecoder *) (obj))->srcpad)

Gives the pointer to the source GstPad object of the element.

Parameters:

`obj` –

a GstVideoDecoder

### GST_VIDEO_DECODER_STREAM_LOCK

    #define GST_VIDEO_DECODER_STREAM_LOCK(decoder) g_rec_mutex_lock (&GST_VIDEO_DECODER (decoder)->stream_lock)

Obtain a lock to protect the decoder function from concurrent access.

Parameters:

`decoder` –

video decoder instance

### GST_VIDEO_DECODER_STREAM_UNLOCK

    #define GST_VIDEO_DECODER_STREAM_UNLOCK(decoder) g_rec_mutex_unlock (&GST_VIDEO_DECODER (decoder)->stream_lock)

Release the lock that protects the decoder function from concurrent access.

Parameters:

`decoder` –

video decoder instance

## Enumerations

### GstVideoDecoderRequestSyncPointFlags

Flags to be used in combination with gst_video_decoder_request_sync_point. See the function documentation for more details.

##### Members

`GST_VIDEO_DECODER_REQUEST_SYNC_POINT_DISCARD_INPUT` (1) –

discard all following input until the next sync point.

`GST_VIDEO_DECODER_REQUEST_SYNC_POINT_CORRUPT_OUTPUT` (2) –

discard all following output until the next sync point.

Since : 1.20

### GstVideo.VideoDecoderRequestSyncPointFlags

Flags to be used in combination with GstVideo.VideoDecoder.prototype.request_sync_point. See the function documentation for more details.

##### Members

`GstVideo.VideoDecoderRequestSyncPointFlags.DISCARD_INPUT` (1) –

discard all following input until the next sync point.

`GstVideo.VideoDecoderRequestSyncPointFlags.CORRUPT_OUTPUT` (2) –

discard all following output until the next sync point.

Since : 1.20

### GstVideo.VideoDecoderRequestSyncPointFlags

Flags to be used in combination with GstVideo.VideoDecoder.request_sync_point. See the function documentation for more details.

##### Members

`GstVideo.VideoDecoderRequestSyncPointFlags.DISCARD_INPUT` (1) –

discard all following input until the next sync point.

`GstVideo.VideoDecoderRequestSyncPointFlags.CORRUPT_OUTPUT` (2) –

discard all following output until the next sync point.

Since : 1.20

## Constants

### GST_TYPE_VIDEO_DECODER

    #define GST_TYPE_VIDEO_DECODER \
      (gst_video_decoder_get_type())

### GST_VIDEO_DECODER_FLOW_NEED_DATA

    #define GST_VIDEO_DECODER_FLOW_NEED_DATA GST_FLOW_CUSTOM_SUCCESS

Returned while parsing to indicate more data is needed.

### GST_VIDEO_DECODER_MAX_ERRORS

    #define GST_VIDEO_DECODER_MAX_ERRORS     -1

Default maximum number of errors tolerated before signaling error.

### GstVideo.VIDEO_DECODER_MAX_ERRORS

Default maximum number of errors tolerated before signaling error.

### GstVideo.VIDEO_DECODER_MAX_ERRORS

Default maximum number of errors tolerated before signaling error.

### GST_VIDEO_DECODER_SINK_NAME

    #define GST_VIDEO_DECODER_SINK_NAME    "sink"

The name of the templates for the sink pad.

### GstVideo.VIDEO_DECODER_SINK_NAME

The name of the templates for the sink pad.

### GstVideo.VIDEO_DECODER_SINK_NAME

The name of the templates for the sink pad.

### GST_VIDEO_DECODER_SRC_NAME

    #define GST_VIDEO_DECODER_SRC_NAME     "src"

The name of the templates for the source pad.

### GstVideo.VIDEO_DECODER_SRC_NAME

The name of the templates for the source pad.

### GstVideo.VIDEO_DECODER_SRC_NAME

The name of the templates for the source pad.

The results of the search are