VideoSink

Provides useful functions and a base class for video sinks.

GstVideoSink will configure the default base sink to drop frames that arrive later than 20ms as this is considered the default threshold for observing out-of-sync frames.

class VideoSink : BaseSink {}

Inherited Members

From BaseSink

doPreroll
gst.types.FlowReturn doPreroll(gst.mini_object.MiniObject obj)

If the sink spawns its own thread for pulling buffers from upstream it should call this method after it has pulled a buffer. If the element needed to preroll, this function will perform the preroll and will then block until the element state is changed.

getBlocksize
uint getBlocksize()

Get the number of bytes that the sink will pull when it is operating in pull mode.

getDropOutOfSegment
bool getDropOutOfSegment()

Checks if sink is currently configured to drop buffers which are outside the current segment

getLastSample
gst.sample.Sample getLastSample()

Get the last sample that arrived in the sink and was used for preroll or for rendering. This property can be used to generate thumbnails.

getLatency
gst.types.ClockTime getLatency()

Get the currently configured latency.

getMaxBitrate
ulong getMaxBitrate()

Get the maximum amount of bits per second that the sink will render.

getMaxLateness
long getMaxLateness()

Gets the max lateness value. See gstbase.base_sink.BaseSink.setMaxLateness for more details.

getProcessingDeadline
gst.types.ClockTime getProcessingDeadline()

Get the processing deadline of sink. see gstbase.base_sink.BaseSink.setProcessingDeadline for more information about the processing deadline.

getRenderDelay
gst.types.ClockTime getRenderDelay()

Get the render delay of sink. see gstbase.base_sink.BaseSink.setRenderDelay for more information about the render delay.

getStats
gst.structure.Structure getStats()

Return various #GstBaseSink statistics. This function returns a #GstStructure with name application/x-gst-base-sink-stats with the following fields:

getSync
bool getSync()

Checks if sink is currently configured to synchronize against the clock.

getThrottleTime
ulong getThrottleTime()

Get the time that will be inserted between frames to control the maximum buffers per second.

getTsOffset
gst.types.ClockTimeDiff getTsOffset()

Get the synchronisation offset of sink.

isAsyncEnabled
bool isAsyncEnabled()

Checks if sink is currently configured to perform asynchronous state changes to PAUSED.

isLastSampleEnabled
bool isLastSampleEnabled()

Checks if sink is currently configured to store the last received sample in the last-sample property.

isQosEnabled
bool isQosEnabled()

Checks if sink is currently configured to send Quality-of-Service events upstream.

queryLatency
bool queryLatency(bool live, bool upstreamLive, gst.types.ClockTime minLatency, gst.types.ClockTime maxLatency)

Query the sink for the latency parameters. The latency will be queried from the upstream elements. live will be true if sink is configured to synchronize against the clock. upstream_live will be true if an upstream element is live.

setAsyncEnabled
void setAsyncEnabled(bool enabled)

Configures sink to perform all state changes asynchronously. When async is disabled, the sink will immediately go to PAUSED instead of waiting for a preroll buffer. This feature is useful if the sink does not synchronize against the clock or when it is dealing with sparse streams.

setBlocksize
void setBlocksize(uint blocksize)

Set the number of bytes that the sink will pull when it is operating in pull mode.

setDropOutOfSegment
void setDropOutOfSegment(bool dropOutOfSegment)

Configure sink to drop buffers which are outside the current segment

setLastSampleEnabled
void setLastSampleEnabled(bool enabled)

Configures sink to store the last received sample in the last-sample property.

setMaxBitrate
void setMaxBitrate(ulong maxBitrate)

Set the maximum amount of bits per second that the sink will render.

setMaxLateness
void setMaxLateness(long maxLateness)

Sets the new max lateness value to max_lateness. This value is used to decide if a buffer should be dropped or not based on the buffer timestamp and the current clock time. A value of -1 means an unlimited time.

setProcessingDeadline
void setProcessingDeadline(gst.types.ClockTime processingDeadline)

Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer. This is added to the latency of live pipelines.

setQosEnabled
void setQosEnabled(bool enabled)

Configures sink to send Quality-of-Service events upstream.

setRenderDelay
void setRenderDelay(gst.types.ClockTime delay)

Set the render delay in sink to delay. The render delay is the time between actual rendering of a buffer and its synchronisation time. Some devices might delay media rendering which can be compensated for with this function.

setSync
void setSync(bool sync)

Configures sink to synchronize on the clock or not. When sync is false, incoming samples will be played as fast as possible. If sync is true, the timestamps of the incoming buffers will be used to schedule the exact render time of its contents.

setThrottleTime
void setThrottleTime(ulong throttle)

Set the time that will be inserted between rendered buffers. This can be used to control the maximum buffers per second that the sink will render.

setTsOffset
void setTsOffset(gst.types.ClockTimeDiff offset)

Adjust the synchronisation of sink with offset. A negative value will render buffers earlier than their timestamp. A positive value will delay rendering. This function can be used to fix playback of badly timestamped buffers.

wait
gst.types.FlowReturn wait(gst.types.ClockTime time, gst.types.ClockTimeDiff jitter)

This function will wait for preroll to complete and will then block until time is reached. It is usually called by subclasses that use their own internal synchronisation but want to let some synchronization (like EOS) be handled by the base class.

waitClock
gst.types.ClockReturn waitClock(gst.types.ClockTime time, gst.types.ClockTimeDiff jitter)

This function will block until time is reached. It is usually called by subclasses that use their own internal synchronisation.

waitPreroll
gst.types.FlowReturn waitPreroll()

If the #GstBaseSinkClass::render method performs its own synchronisation against the clock it must unblock when going from PLAYING to the PAUSED state and call this method before continuing to render the remaining data.