GstBaseSrcClass

Subclasses can override any of the available virtual methods or not, as needed. At the minimum, the @create method should be overridden to produce buffers.

Members

Variables

GstReserved
void*[20] GstReserved;
alloc
GstFlowReturn function(GstBaseSrc* src, ulong offset, uint size, GstBuffer** buf) alloc;

Ask the subclass to allocate a buffer with for offset and size. The default implementation will create a new buffer from the negotiated allocator.

create
GstFlowReturn function(GstBaseSrc* src, ulong offset, uint size, GstBuffer** buf) create;

Ask the subclass to create a buffer with offset and size. When the subclass returns GST_FLOW_OK, it MUST return a buffer of the requested size unless fewer bytes are available because an EOS condition is near. No buffer should be returned when the return value is different from GST_FLOW_OK. A return value of GST_FLOW_EOS signifies that the end of stream is reached. The default implementation will call #GstBaseSrcClass::alloc and then call #GstBaseSrcClass::fill.

decideAllocation
bool function(GstBaseSrc* src, GstQuery* query) decideAllocation;

configure the allocation query

doSeek
bool function(GstBaseSrc* src, GstSegment* segment) doSeek;

Perform seeking on the resource to the indicated segment.

event
bool function(GstBaseSrc* src, GstEvent* event) event;

Override this to implement custom event handling.

fill
GstFlowReturn function(GstBaseSrc* src, ulong offset, uint size, GstBuffer* buf) fill;

Ask the subclass to fill the buffer with data for offset and size. The passed buffer is guaranteed to hold the requested amount of bytes.

fixate
GstCaps* function(GstBaseSrc* src, GstCaps* caps) fixate;

Called during negotiation if caps need fixating. Implement instead of setting a fixate function on the source pad.

getCaps
GstCaps* function(GstBaseSrc* src, GstCaps* filter) getCaps;

Called to get the caps to report

getSize
bool function(GstBaseSrc* src, ulong* size) getSize;

Return the total size of the resource, in the format set by gstbase.base_src.BaseSrc.setFormat.

getTimes
void function(GstBaseSrc* src, GstBuffer* buffer, GstClockTime* start, GstClockTime* end) getTimes;

Given a buffer, return the start and stop time when it should be pushed out. The base class will sync on the clock using these times.

isSeekable
bool function(GstBaseSrc* src) isSeekable;

Check if the source can seek

negotiate
bool function(GstBaseSrc* src) negotiate;

Negotiated the caps with the peer.

parentClass
GstElementClass parentClass;

Element parent class

prepareSeekSegment
bool function(GstBaseSrc* src, GstEvent* seek, GstSegment* segment) prepareSeekSegment;

Prepare the #GstSegment that will be passed to the #GstBaseSrcClass::do_seek vmethod for executing a seek request. Sub-classes should override this if they support seeking in formats other than the configured native format. By default, it tries to convert the seek arguments to the configured native format and prepare a segment in that format.

query
bool function(GstBaseSrc* src, GstQuery* query) query;

Handle a requested query.

setCaps
bool function(GstBaseSrc* src, GstCaps* caps) setCaps;

Notify subclass of changed output caps

start
bool function(GstBaseSrc* src) start;

Start processing. Subclasses should open resources and prepare to produce data. Implementation should call gstbase.base_src.BaseSrc.startComplete when the operation completes, either from the current thread or any other thread that finishes the start operation asynchronously.

stop
bool function(GstBaseSrc* src) stop;

Stop processing. Subclasses should use this to close resources.

unlock
bool function(GstBaseSrc* src) unlock;

Unlock any pending access to the resource. Subclasses should unblock any blocked function ASAP. In particular, any create() function in progress should be unblocked and should return GST_FLOW_FLUSHING. Any future #GstBaseSrcClass::create function call should also return GST_FLOW_FLUSHING until the #GstBaseSrcClass::unlock_stop function has been called.

unlockStop
bool function(GstBaseSrc* src) unlockStop;

Clear the previous unlock request. Subclasses should clear any state they set during #GstBaseSrcClass::unlock, such as clearing command queues.