VideoDecoder

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 gstvideo.video_decoder.VideoDecoder.setSubframeMode, 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 gstvideo.video_decoder.VideoDecoder.haveLastSubframe 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 gstvideo.video_decoder.VideoDecoder.haveFrame 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.
class VideoDecoder : Element {}

Members

Functions

addToFrame
void addToFrame(int nBytes)

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

allocateOutputBuffer
gst.buffer.Buffer allocateOutputBuffer()

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

allocateOutputFrame
gst.types.FlowReturn allocateOutputFrame(gstvideo.video_codec_frame.VideoCodecFrame 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.

allocateOutputFrameWithParams
gst.types.FlowReturn allocateOutputFrameWithParams(gstvideo.video_codec_frame.VideoCodecFrame frame, gst.types.BufferPoolAcquireParams params)

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

dropFrame
gst.types.FlowReturn dropFrame(gstvideo.video_codec_frame.VideoCodecFrame frame)

Similar to gstvideo.video_decoder.VideoDecoder.finishFrame, 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.

dropSubframe
gst.types.FlowReturn dropSubframe(gstvideo.video_codec_frame.VideoCodecFrame frame)

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

finishFrame
gst.types.FlowReturn finishFrame(gstvideo.video_codec_frame.VideoCodecFrame 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.

finishSubframe
gst.types.FlowReturn finishSubframe(gstvideo.video_codec_frame.VideoCodecFrame 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.

getAllocator
void getAllocator(gst.allocator.Allocator allocator, gst.allocation_params.AllocationParams params)

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

getBufferPool
gst.buffer_pool.BufferPool getBufferPool()
getEstimateRate
int getEstimateRate()
getFrame
gstvideo.video_codec_frame.VideoCodecFrame getFrame(int frameNumber)

Get a pending unfinished #GstVideoCodecFrame

getFrames
gstvideo.video_codec_frame.VideoCodecFrame[] getFrames()

Get all pending unfinished #GstVideoCodecFrame

getInputSubframeIndex
uint getInputSubframeIndex(gstvideo.video_codec_frame.VideoCodecFrame frame)

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

getLatency
void getLatency(gst.types.ClockTime minLatency, gst.types.ClockTime maxLatency)

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

getMaxDecodeTime
gst.types.ClockTimeDiff getMaxDecodeTime(gstvideo.video_codec_frame.VideoCodecFrame 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.

getMaxErrors
int getMaxErrors()
getNeedsFormat
bool getNeedsFormat()

Queries decoder required format handling.

getNeedsSyncPoint
bool getNeedsSyncPoint()

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

getOldestFrame
gstvideo.video_codec_frame.VideoCodecFrame getOldestFrame()

Get the oldest pending unfinished #GstVideoCodecFrame

getOutputState
gstvideo.video_codec_state.VideoCodecState getOutputState()

Get the #GstVideoCodecState currently describing the output stream.

getPacketized
bool getPacketized()

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

getPendingFrameSize
size_t getPendingFrameSize()

Returns the number of bytes previously added to the current frame by calling gstvideo.video_decoder.VideoDecoder.addToFrame.

getProcessedSubframeIndex
uint getProcessedSubframeIndex(gstvideo.video_codec_frame.VideoCodecFrame frame)

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

getQosProportion
double getQosProportion()
getSubframeMode
bool getSubframeMode()

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.

haveFrame
gst.types.FlowReturn haveFrame()

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

haveLastSubframe
gst.types.FlowReturn haveLastSubframe(gstvideo.video_codec_frame.VideoCodecFrame 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.

mergeTags
void mergeTags(gst.tag_list.TagList tags, gst.types.TagMergeMode 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 gstaudio.audio_decoder.AudioDecoder.mergeTags.

negotiate
bool negotiate()

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

proxyGetcaps
gst.caps.Caps proxyGetcaps(gst.caps.Caps caps, gst.caps.Caps filter)

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

releaseFrame
void releaseFrame(gstvideo.video_codec_frame.VideoCodecFrame frame)

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

requestSyncPoint
void requestSyncPoint(gstvideo.video_codec_frame.VideoCodecFrame frame, gstvideo.types.VideoDecoderRequestSyncPointFlags 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.

setEstimateRate
void setEstimateRate(bool enabled)

Allows baseclass to perform byte to time estimated conversion.

setInterlacedOutputState
gstvideo.video_codec_state.VideoCodecState setInterlacedOutputState(gstvideo.types.VideoFormat fmt, gstvideo.types.VideoInterlaceMode interlaceMode, uint width, uint height, gstvideo.video_codec_state.VideoCodecState reference)

Same as #gstvideo.video_decoder.VideoDecoder.setOutputState but also allows you to also set the interlacing mode.

setLatency
void setLatency(gst.types.ClockTime minLatency, gst.types.ClockTime maxLatency)

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.

setMaxErrors
void setMaxErrors(int 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.

setNeedsFormat
void setNeedsFormat(bool 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.

setNeedsSyncPoint
void setNeedsSyncPoint(bool 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.

setOutputState
gstvideo.video_codec_state.VideoCodecState setOutputState(gstvideo.types.VideoFormat fmt, uint width, uint height, gstvideo.video_codec_state.VideoCodecState 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.

setPacketized
void setPacketized(bool packetized)

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

setSubframeMode
void setSubframeMode(bool subframeMode)

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.

setUseDefaultPadAcceptcaps
void setUseDefaultPadAcceptcaps(bool 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.

Inherited Members

From Element

makeFromUri
gst.element.Element makeFromUri(gst.types.URIType type, string uri, string elementname)

Creates an element for handling the given URI.

register
bool register(gst.plugin.Plugin plugin, string name, uint rank, gobject.types.GType type)

Create a new elementfactory capable of instantiating objects of the type and add the factory to plugin.

stateChangeReturnGetName
string stateChangeReturnGetName(gst.types.StateChangeReturn stateRet)

Gets a string representing the given state change result.

stateGetName
string stateGetName(gst.types.State state)

Gets a string representing the given state.

typeSetSkipDocumentation
void typeSetSkipDocumentation(gobject.types.GType type)

Marks type as "documentation should be skipped". Can be useful for dynamically registered element to be excluded from plugin documentation system.

abortState
void abortState()

Abort the state change of the element. This function is used by elements that do asynchronous state changes and find out something is wrong.

addPad
bool addPad(gst.pad.Pad pad)

Adds a pad (link point) to element. pad's parent will be set to element; see gst.object.ObjectGst.setParent for refcounting information.

addPropertyDeepNotifyWatch
gulong addPropertyDeepNotifyWatch(string propertyName, bool includeValue)
addPropertyNotifyWatch
gulong addPropertyNotifyWatch(string propertyName, bool includeValue)
callAsync
void callAsync(gst.types.ElementCallAsyncFunc func)

Calls func from another thread and passes user_data to it. This is to be used for cases when a state change has to be performed from a streaming thread, directly via gst.element.Element.setState or indirectly e.g. via SEEK events.

changeState
gst.types.StateChangeReturn changeState(gst.types.StateChange transition)

Perform transition on element.

continueState
gst.types.StateChangeReturn continueState(gst.types.StateChangeReturn ret)

Commit the state change of the element and proceed to the next pending state if any. This function is used by elements that do asynchronous state changes. The core will normally call this method automatically when an element returned gst.types.StateChangeReturn.Success from the state change function.

createAllPads
void createAllPads()

Creates a pad for each pad template that is always available. This function is only useful during object initialization of subclasses of #GstElement.

decorateStreamId
string decorateStreamId(string streamId)

Creates a stream-id for element by combining the upstream information with the stream_id.

foreachPad
bool foreachPad(gst.types.ElementForeachPadFunc func)

Call func with user_data for each of element's pads. func will be called exactly once for each pad that exists at the time of this call, unless one of the calls to func returns false in which case we will stop iterating pads and return early. If new pads are added or pads are removed while pads are being iterated, this will not be taken into account until next time this function is used.

foreachSinkPad
bool foreachSinkPad(gst.types.ElementForeachPadFunc func)

Call func with user_data for each of element's sink pads. func will be called exactly once for each sink pad that exists at the time of this call, unless one of the calls to func returns false in which case we will stop iterating pads and return early. If new sink pads are added or sink pads are removed while the sink pads are being iterated, this will not be taken into account until next time this function is used.

foreachSrcPad
bool foreachSrcPad(gst.types.ElementForeachPadFunc func)

Call func with user_data for each of element's source pads. func will be called exactly once for each source pad that exists at the time of this call, unless one of the calls to func returns false in which case we will stop iterating pads and return early. If new source pads are added or source pads are removed while the source pads are being iterated, this will not be taken into account until next time this function is used.

getBaseTime
gst.types.ClockTime getBaseTime()

Returns the base time of the element. The base time is the absolute time of the clock when this element was last put to PLAYING. Subtracting the base time from the clock time gives the running time of the element.

getBus
gst.bus.Bus getBus()

Returns the bus of the element. Note that only a #GstPipeline will provide a bus for the application.

getClock
gst.clock.Clock getClock()

Gets the currently configured clock of the element. This is the clock as was last set with gst.element.Element.setClock.

getCompatiblePad
gst.pad.Pad getCompatiblePad(gst.pad.Pad pad, gst.caps.Caps caps)

Looks for an unlinked pad to which the given pad can link. It is not guaranteed that linking the pads will work, though it should work in most cases.

getCompatiblePadTemplate
gst.pad_template.PadTemplate getCompatiblePadTemplate(gst.pad_template.PadTemplate compattempl)

Retrieves a pad template from element that is compatible with compattempl. Pads from compatible templates can be linked together.

getContext
gst.context.Context getContext(string contextType)

Gets the context with context_type set on the element or NULL.

getContextUnlocked
gst.context.Context getContextUnlocked(string contextType)

Gets the context with context_type set on the element or NULL.

getContexts
gst.context.Context[] getContexts()

Gets the contexts set on the element.

getCurrentClockTime
gst.types.ClockTime getCurrentClockTime()

Returns the current clock time of the element, as in, the time of the element's clock, or GST_CLOCK_TIME_NONE if there is no clock.

getCurrentRunningTime
gst.types.ClockTime getCurrentRunningTime()

Returns the running time of the element. The running time is the element's clock time minus its base time. Will return GST_CLOCK_TIME_NONE if the element has no clock, or if its base time has not been set.

getFactory
gst.element_factory.ElementFactory getFactory()

Retrieves the factory that was used to create this element.

getMetadata
string getMetadata(string key)

Get metadata with key in klass.

getPadTemplate
gst.pad_template.PadTemplate getPadTemplate(string name)

Retrieves a padtemplate from element with the given name.

getPadTemplateList
gst.pad_template.PadTemplate[] getPadTemplateList()

Retrieves a list of the pad templates associated with element. The list must not be modified by the calling code.

getRequestPad
gst.pad.Pad getRequestPad(string name)

The name of this function is confusing to people learning GStreamer. gst.element.Element.requestPadSimple aims at making it more explicit it is a simplified gst.element.Element.requestPad.

getStartTime
gst.types.ClockTime getStartTime()

Returns the start time of the element. The start time is the running time of the clock when this element was last put to PAUSED.

getState
gst.types.StateChangeReturn getState(gst.types.State state, gst.types.State pending, gst.types.ClockTime timeout)

Gets the state of the element.

getStaticPad
gst.pad.Pad getStaticPad(string name)

Retrieves a pad from element by name. This version only retrieves already-existing (i.e. 'static') pads.

isLockedState
bool isLockedState()

Checks if the state of an element is locked. If the state of an element is locked, state changes of the parent don't affect the element. This way you can leave currently unused elements inside bins. Just lock their state before changing the state from #GST_STATE_NULL.

iteratePads
gst.iterator.Iterator iteratePads()

Retrieves an iterator of element's pads. The iterator should be freed after usage. Also more specialized iterators exists such as gst.element.Element.iterateSrcPads or gst.element.Element.iterateSinkPads.

iterateSinkPads
gst.iterator.Iterator iterateSinkPads()

Retrieves an iterator of element's sink pads.

iterateSrcPads
gst.iterator.Iterator iterateSrcPads()

Retrieves an iterator of element's source pads.

link
bool link(gst.element.Element dest)

Links src to dest. The link must be from source to destination; the other direction will not be tried. The function looks for existing pads that aren't linked yet. It will request new pads if necessary. Such pads need to be released manually when unlinking. If multiple links are possible, only one is established.

linkFiltered
bool linkFiltered(gst.element.Element dest, gst.caps.Caps filter)

Links src to dest using the given caps as filtercaps. The link must be from source to destination; the other direction will not be tried. The function looks for existing pads that aren't linked yet. It will request new pads if necessary. If multiple links are possible, only one is established.

linkPads
bool linkPads(string srcpadname, gst.element.Element dest, string destpadname)

Links the two named pads of the source and destination elements. Side effect is that if one of the pads has no parent, it becomes a child of the parent of the other element. If they have different parents, the link fails.

linkPadsFiltered
bool linkPadsFiltered(string srcpadname, gst.element.Element dest, string destpadname, gst.caps.Caps filter)

Links the two named pads of the source and destination elements. Side effect is that if one of the pads has no parent, it becomes a child of the parent of the other element. If they have different parents, the link fails. If caps is not null, makes sure that the caps of the link is a subset of caps.

linkPadsFull
bool linkPadsFull(string srcpadname, gst.element.Element dest, string destpadname, gst.types.PadLinkCheck flags)

Links the two named pads of the source and destination elements. Side effect is that if one of the pads has no parent, it becomes a child of the parent of the other element. If they have different parents, the link fails.

lostState
void lostState()

Brings the element to the lost state. The current state of the element is copied to the pending state so that any call to gst.element.Element.getState will return gst.types.StateChangeReturn.Async.

messageFull
void messageFull(gst.types.MessageType type, glib.types.Quark domain, int code, string text, string debug_, string file, string function_, int line)

Post an error, warning or info message on the bus from inside an element.

messageFullWithDetails
void messageFullWithDetails(gst.types.MessageType type, glib.types.Quark domain, int code, string text, string debug_, string file, string function_, int line, gst.structure.Structure structure)

Post an error, warning or info message on the bus from inside an element.

noMorePads
void noMorePads()

Use this function to signal that the element does not expect any more pads to show up in the current pipeline. This function should be called whenever pads have been added by the element itself. Elements with #GST_PAD_SOMETIMES pad templates use this in combination with autopluggers to figure out that the element is done initializing its pads.

postMessage
bool postMessage(gst.message.Message message)

Post a message on the element's #GstBus. This function takes ownership of the message; if you want to access the message after this call, you should add an additional reference before calling.

provideClock
gst.clock.Clock provideClock()

Get the clock provided by the given element. > An element is only required to provide a clock in the PAUSED > state. Some elements can provide a clock in other states.

query
bool query(gst.query.Query query)

Performs a query on the given element.

queryConvert
bool queryConvert(gst.types.Format srcFormat, long srcVal, gst.types.Format destFormat, long destVal)

Queries an element to convert src_val in src_format to dest_format.

queryDuration
bool queryDuration(gst.types.Format format, long duration)

Queries an element (usually top-level pipeline or playbin element) for the total stream duration in nanoseconds. This query will only work once the pipeline is prerolled (i.e. reached PAUSED or PLAYING state). The application will receive an ASYNC_DONE message on the pipeline bus when that is the case.

queryPosition
bool queryPosition(gst.types.Format format, long cur)

Queries an element (usually top-level pipeline or playbin element) for the stream position in nanoseconds. This will be a value between 0 and the stream duration (if the stream duration is known). This query will usually only work once the pipeline is prerolled (i.e. reached PAUSED or PLAYING state). The application will receive an ASYNC_DONE message on the pipeline bus when that is the case.

releaseRequestPad
void releaseRequestPad(gst.pad.Pad pad)

Makes the element free the previously requested pad as obtained with gst.element.Element.requestPad.

removePad
bool removePad(gst.pad.Pad pad)

Removes pad from element. pad will be destroyed if it has not been referenced elsewhere using gst.object.ObjectGst.unparent.

removePropertyNotifyWatch
void removePropertyNotifyWatch(gulong watchId)
requestPad
gst.pad.Pad requestPad(gst.pad_template.PadTemplate templ, string name, gst.caps.Caps caps)

Retrieves a request pad from the element according to the provided template. Pad templates can be looked up using gst.element_factory.ElementFactory.getStaticPadTemplates.

requestPadSimple
gst.pad.Pad requestPadSimple(string name)

Retrieves a pad from the element by name (e.g. "src_\d"). This version only retrieves request pads. The pad should be released with gst.element.Element.releaseRequestPad.

seek
bool seek(double rate, gst.types.Format format, gst.types.SeekFlags flags, gst.types.SeekType startType, long start, gst.types.SeekType stopType, long stop)

Sends a seek event to an element. See gst.event.Event.newSeek for the details of the parameters. The seek event is sent to the element using gst.element.Element.sendEvent.

seekSimple
bool seekSimple(gst.types.Format format, gst.types.SeekFlags seekFlags, long seekPos)

Simple API to perform a seek on the given element, meaning it just seeks to the given position relative to the start of the stream. For more complex operations like segment seeks (e.g. for looping) or changing the playback rate or seeking relative to the last configured playback segment you should use gst.element.Element.seek.

sendEvent
bool sendEvent(gst.event.Event event)

Sends an event to an element. If the element doesn't implement an event handler, the event will be pushed on a random linked sink pad for downstream events or a random linked source pad for upstream events.

setBaseTime
void setBaseTime(gst.types.ClockTime time)

Set the base time of an element. See gst.element.Element.getBaseTime.

setBus
void setBus(gst.bus.Bus bus)

Sets the bus of the element. Increases the refcount on the bus. For internal use only, unless you're testing elements.

setClock
bool setClock(gst.clock.Clock clock)

Sets the clock for the element. This function increases the refcount on the clock. Any previously set clock on the object is unreffed.

setContext
void setContext(gst.context.Context context)

Sets the context of the element. Increases the refcount of the context.

setLockedState
bool setLockedState(bool lockedState)

Locks the state of an element, so state changes of the parent don't affect this element anymore.

setStartTime
void setStartTime(gst.types.ClockTime time)

Set the start time of an element. The start time of the element is the running time of the element when it last went to the PAUSED state. In READY or after a flushing seek, it is set to 0.

setState
gst.types.StateChangeReturn setState(gst.types.State state)

Sets the state of the element. This function will try to set the requested state by going through all the intermediary states and calling the class's state change function for each.

syncStateWithParent
bool syncStateWithParent()

Tries to change the state of the element to the same as its parent. If this function returns false, the state of element is undefined.

unlink
void unlink(gst.element.Element dest)

Unlinks all source pads of the source element with all sink pads of the sink element to which they are linked.

unlinkPads
void unlinkPads(string srcpadname, gst.element.Element dest, string destpadname)

Unlinks the two named pads of the source and destination elements.

connectNoMorePads
ulong connectNoMorePads(T callback, Flag!"After" after)

Connect to NoMorePads signal.

connectPadAdded
ulong connectPadAdded(T callback, Flag!"After" after)

Connect to PadAdded signal.

connectPadRemoved
ulong connectPadRemoved(T callback, Flag!"After" after)

Connect to PadRemoved signal.