GstVideoEncoderClass

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 @get_caps are likely needed as well.

struct GstVideoEncoderClass {}

Members

Variables

GstReserved
void*[16] GstReserved;
close
bool function(GstVideoEncoder* encoder) close;

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

decideAllocation
bool function(GstVideoEncoder* encoder, GstQuery* query) decideAllocation;

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.

elementClass
GstElementClass elementClass;
finish
GstFlowReturn function(GstVideoEncoder* encoder) finish;

Optional. Called to request subclass to dispatch any pending remaining data (e.g. at EOS).

flush
bool function(GstVideoEncoder* encoder) flush;

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

getcaps
GstCaps* function(GstVideoEncoder* enc, GstCaps* filter) getcaps;

Optional. Allows for a custom sink getcaps implementation (e.g. for multichannel input specification). If not implemented, default returns gst_video_encoder_proxy_getcaps applied to sink template caps.

handleFrame
GstFlowReturn function(GstVideoEncoder* encoder, GstVideoCodecFrame* frame) handleFrame;

Provides input frame to subclass.

negotiate
bool function(GstVideoEncoder* encoder) negotiate;

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

open
bool function(GstVideoEncoder* encoder) open;

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

prePush
GstFlowReturn function(GstVideoEncoder* encoder, GstVideoCodecFrame* frame) prePush;

Optional. Allows subclass to push frame downstream in whatever shape or form it deems appropriate. If not provided, provided encoded frame data is simply pushed downstream.

proposeAllocation
bool function(GstVideoEncoder* encoder, GstQuery* query) proposeAllocation;

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

reset
bool function(GstVideoEncoder* encoder, bool hard) reset;

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

setFormat
bool function(GstVideoEncoder* encoder, GstVideoCodecState* state) setFormat;

Optional. Notifies subclass of incoming data format. GstVideoCodecState fields have already been set according to provided caps.

sinkEvent
bool function(GstVideoEncoder* encoder, GstEvent* event) sinkEvent;

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.

sinkQuery
bool function(GstVideoEncoder* encoder, GstQuery* query) sinkQuery;

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

srcEvent
bool function(GstVideoEncoder* encoder, GstEvent* event) srcEvent;

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.

srcQuery
bool function(GstVideoEncoder* encoder, GstQuery* query) srcQuery;

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

start
bool function(GstVideoEncoder* encoder) start;

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

stop
bool function(GstVideoEncoder* encoder) stop;

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

transformMeta
bool function(GstVideoEncoder* encoder, GstVideoCodecFrame* frame, GstMeta* meta) transformMeta;

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