PushSrc

This class is mostly useful for elements that cannot do random access, or at least very slowly. The source usually prefers to push out a fixed size buffer.

Subclasses usually operate in a format that is different from the default GST_FORMAT_BYTES format of #GstBaseSrc.

Classes extending this base class will usually be scheduled in a push based mode. If the peer accepts to operate without offsets and within the limits of the allowed block size, this class can operate in getrange based mode automatically. To make this possible, the subclass should implement and override the SCHEDULING query.

The subclass should extend the methods from the baseclass in addition to the ::create method.

Seeking, flushing, scheduling and sync is all handled by this base class.

Constructors

this
this(GstPushSrc* gstPushSrc, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

getPushSrcStruct
GstPushSrc* getPushSrcStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

Static functions

getType
GType getType()

Variables

gstPushSrc
GstPushSrc* gstPushSrc;

the main Gtk struct

Inherited Members

From BaseSrc

gstBaseSrc
GstBaseSrc* gstBaseSrc;

the main Gtk struct

getBaseSrcStruct
GstBaseSrc* getBaseSrcStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getAllocator
void getAllocator(Allocator allocator, AllocationParams params)

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

getBlocksize
uint getBlocksize()

Get the number of bytes that @src will push out with each buffer.

getBufferPool
BufferPool getBufferPool()
getDoTimestamp
bool getDoTimestamp()

Query if @src timestamps outgoing buffers based on the current running_time.

isAsync
bool isAsync()

Get the current async behaviour of @src. See also gst_base_src_set_async().

isLive
bool isLive()

Check if an element is in live mode.

newSeamlessSegment
bool newSeamlessSegment(long start, long stop, long time)

Prepare a new seamless segment for emission downstream. This function must only be called by derived sub-classes, and only from the create() function, as the stream-lock needs to be held.

queryLatency
bool queryLatency(bool live, GstClockTime minLatency, GstClockTime maxLatency)

Query the source for the latency parameters. @live will be %TRUE when @src is configured as a live source. @min_latency and @max_latency will be set to the difference between the running time and the timestamp of the first buffer.

setAsync
void setAsync(bool async)

Configure async behaviour in @src, no state change will block. The open, close, start, stop, play and pause virtual methods will be executed in a different thread and are thus allowed to perform blocking operations. Any blocking operation should be unblocked with the unlock vmethod.

setAutomaticEos
void setAutomaticEos(bool automaticEos)

If @automatic_eos is %TRUE, @src will automatically go EOS if a buffer after the total size is returned. By default this is %TRUE but sources that can't return an authoritative size and only know that they're EOS when trying to read more should set this to %FALSE.

setBlocksize
void setBlocksize(uint blocksize)

Set the number of bytes that @src will push out with each buffer. When @blocksize is set to -1, a default length will be used.

setCaps
bool setCaps(Caps caps)

Set new caps on the basesrc source pad.

setDoTimestamp
void setDoTimestamp(bool timestamp)

Configure @src to automatically timestamp outgoing buffers based on the current running_time of the pipeline. This property is mostly useful for live sources.

setDynamicSize
void setDynamicSize(bool dynamic)

If not @dynamic, size is only updated when needed, such as when trying to read past current tracked size. Otherwise, size is checked for upon each read.

setFormat
void setFormat(GstFormat format)

Sets the default format of the source. This will be the format used for sending SEGMENT events and for performing seeks.

setLive
void setLive(bool live)

If the element listens to a live source, @live should be set to %TRUE.

startComplete
void startComplete(GstFlowReturn ret)

Complete an asynchronous start operation. When the subclass overrides the start method, it should call gst_base_src_start_complete() when the start operation completes either from the same thread or from an asynchronous helper thread.

startWait
GstFlowReturn startWait()

Wait until the start operation completes.

submitBufferList
void submitBufferList(BufferList bufferList)

Subclasses can call this from their create virtual method implementation to submit a buffer list to be pushed out later. This is useful in cases where the create function wants to produce multiple buffers to be pushed out in one go in form of a #GstBufferList, which can reduce overhead drastically, especially for packetised inputs (for data streams where the packetisation/chunking is not important it is usually more efficient to return larger buffers instead).

waitPlaying
GstFlowReturn waitPlaying()

If the #GstBaseSrcClass.create() 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 produce the remaining data.

Meta