AbstractOptionalproperties: Partial<GstBase.BaseSink.ConstructorProps>Internal$signalsCompile-time signal type information.
This instance property is generated only for TypeScript type checking. It is not defined at runtime and should not be accessed in JS code.
Static$gtypeIf set to true, the basesink will perform asynchronous state changes.
When set to false, the sink will not signal the parent when it prerolls.
Use this option when dealing with sparse streams or when synchronisation is
not required.
The amount of bytes to pull when operating in pull mode.
Enable the last-sample property. If false, basesink doesn't keep a
reference to the last buffer arrived and the last-sample property is always
set to null. This can be useful if you need buffers to be released as soon
as possible, eg. if you're using a buffer pool.
Enable the last-sample property. If false, basesink doesn't keep a
reference to the last buffer arrived and the last-sample property is always
set to null. This can be useful if you need buffers to be released as soon
as possible, eg. if you're using a buffer pool.
Read-Onlylast_The last buffer that arrived in the sink and was used for preroll or for
rendering. This property can be used to generate thumbnails. This property
can be null when the sink has not yet received a buffer.
Read-OnlylastThe last buffer that arrived in the sink and was used for preroll or for
rendering. This property can be used to generate thumbnails. This property
can be null when the sink has not yet received a buffer.
Since 1.2max_Since 1.2maxSince 1.16processing_Since 1.16processingThe additional delay between synchronisation and actual rendering of the media. This property will add additional latency to the device in order to make other sinks compensate for the delay.
The additional delay between synchronisation and actual rendering of the media. This property will add additional latency to the device in order to make other sinks compensate for the delay.
Read-OnlySince 1.18statsVarious GstBase.BaseSink statistics. This property returns a Gst.Structure
with name application/x-gst-base-sink-stats with the following fields:
The time to insert between buffers. This property can be used to control the maximum amount of buffers per second to render. Setting this property to a value bigger than 0 will make the sink create THROTTLE QoS events.
The time to insert between buffers. This property can be used to control the maximum amount of buffers per second to render. Setting this property to a value bigger than 0 will make the sink create THROTTLE QoS events.
Controls the final synchronisation, a negative value will render the buffer earlier while a positive value delays playback. This property can be used to fix synchronisation in bad files.
Controls the final synchronisation, a negative value will render the buffer earlier while a positive value delays playback. This property can be used to fix synchronisation in bad files.
The parent of the object. Please note, that when changing the 'parent' property, we don't emit GObject.Object::notify and Gst.Object.SignalSignatures.deep_notify | Gst.Object::deep-notify signals due to locking issues. In some cases one can use Gst.Bin.SignalSignatures.element_added | Gst.Bin::element-added or Gst.Bin.SignalSignatures.element_removed | Gst.Bin::element-removed signals on the parent to achieve a similar effect.
SignalconnectSignalconnect_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.
This function should be called with the PREROLL_LOCK held.
the mini object that caused the preroll
Gst.FlowReturn.OK if the preroll completed and processing can continue. Any other return value should be returned from the render vmethod.
SignalemitGet the number of bytes that the sink will pull when it is operating in pull mode.
the number of bytes sink will pull in pull mode.
Checks if sink is currently configured to drop buffers which are outside
the current segment
true if the sink is configured to drop buffers outside the current segment.
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.
The Gst.Caps on the sample can be used to determine the type of the buffer.
Free-function: gst_sample_unref
a Gst.Sample. gst_sample_unref() after usage. This function returns null when no buffer has arrived in the sink yet or when the sink is not in PAUSED or PLAYING.
Get the currently configured latency.
The configured latency.
Get the maximum amount of bits per second that the sink will render.
the maximum number of bits per second sink will render.
Gets the max lateness value. See gst_base_sink_set_max_lateness() for
more details.
The maximum time in nanoseconds that a buffer can be late before it is dropped and not rendered. A value of -1 means an unlimited time.
Get the processing deadline of sink. see
gst_base_sink_set_processing_deadline() for more information about
the processing deadline.
the processing deadline
Get the render delay of sink. see gst_base_sink_set_render_delay() for more
information about the render delay.
the render delay of sink.
Return various GstBase.BaseSink statistics. This function returns a Gst.Structure
with name application/x-gst-base-sink-stats with the following fields:
pointer to Gst.Structure
Checks if sink is currently configured to synchronize against the
clock.
true if the sink is configured to synchronize against the clock.
Get the time that will be inserted between frames to control the maximum buffers per second.
the number of nanoseconds sink will put between frames.
Get the synchronisation offset of sink.
The synchronisation offset.
Checks if sink is currently configured to perform asynchronous state
changes to PAUSED.
true if the sink is configured to perform asynchronous state changes.
Checks if sink is currently configured to store the last received sample in
the last-sample property.
true if the sink is configured to store the last received sample.
Checks if sink is currently configured to send Quality-of-Service events
upstream.
true if the sink is configured to perform Quality-of-Service.
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.
If both live and upstream_live are true, the sink will want to compensate
for the latency introduced by the upstream elements by setting the
min_latency to a strictly positive value.
This function is mostly used by subclasses.
true if the query succeeded.
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.
the new async value.
Set the number of bytes that the sink will pull when it is operating in pull mode.
the blocksize in bytes
Configure sink to drop buffers which are outside the current segment
drop buffers outside the segment
Configures sink to store the last received sample in the last-sample
property.
the new enable-last-sample value.
Set the maximum amount of bits per second that the sink will render.
the max_bitrate in bits per second
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.
the new max lateness value.
Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer. This is added to the latency of live pipelines.
This function is usually called by subclasses.
the new processing deadline in nanoseconds.
Configures sink to send Quality-of-Service events upstream.
the new qos value.
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.
After calling this function, this sink will report additional latency and other sinks will adjust their latency to delay the rendering of their media.
This function is usually called by subclasses.
the new delay
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.
the new sync value.
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.
the throttle time in nanoseconds
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.
the new offset
Virtualvfunc_Subclasses should override this when they can provide an alternate method of spawning a thread to drive the pipeline in pull mode. Should start or stop the pulling thread, depending on the value of the "active" argument. Called after actually activating the sink pad in pull mode. The default implementation starts a task on the sink pad.
Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Called to prepare the buffer for render and preroll. This
function is called before synchronisation is performed.
Virtualvfunc_Called to prepare the buffer list for render_list. This
function is called before synchronisation is performed.
Virtualvfunc_Virtualvfunc_Virtualvfunc_Virtualvfunc_Called when a buffer should be presented or output, at the correct moment if the GstBase.BaseSink has been set to sync to the clock.
Virtualvfunc_Same as render but used with buffer lists instead of
buffers.
Virtualvfunc_Virtualvfunc_Start processing. Ideal for opening resources in the subclass
Virtualvfunc_Stop processing. Subclasses should use this to close resources.
Virtualvfunc_Unlock any pending access to the resource. Subclasses should
unblock any blocked function ASAP and call gst_base_sink_wait_preroll()
Virtualvfunc_Clear the previous unlock request. Subclasses should clear
any state they set during GstBase.BaseSinkClass.SignalSignatures.unlock | GstBase.BaseSinkClass::unlock, and be ready to
continue where they left off after gst_base_sink_wait_preroll(),
gst_base_sink_wait() or gst_wait_sink_wait_clock() return or
GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render is called again.
Virtualvfunc_Override this to implement custom logic to wait for the event time (for events like EOS and GAP). Subclasses should always first chain up to the default implementation.
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.
This function should only be called with the PREROLL_LOCK held (like when receiving an EOS event in the ::event vmethod or when handling buffers in ::render).
The time argument should be the running_time of when the timeout should happen
and will be adjusted with any latency and offset configured in the sink.
the running_time to be reached
Gst.FlowReturn
This function will block until time is reached. It is usually called by
subclasses that use their own internal synchronisation.
If time is not valid, no synchronisation is done and Gst.ClockReturn.BADTIME is
returned. Likewise, if synchronisation is disabled in the element or there
is no clock, no synchronisation is done and Gst.ClockReturn.BADTIME is returned.
This function should only be called with the PREROLL_LOCK held, like when receiving an EOS event in the GstBase.BaseSinkClass.SignalSignatures.event | GstBase.BaseSinkClass::event vmethod or when receiving a buffer in the GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render vmethod.
The time argument should be the running_time of when this method should
return and is not adjusted with any latency or offset configured in the
sink.
the running_time to be reached
Gst.ClockReturn
If the GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::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.
If the GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render method can block on something else than the clock, it must also be ready to unblock immediately on the GstBase.BaseSinkClass.SignalSignatures.unlock | GstBase.BaseSinkClass::unlock method and cause the GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render method to immediately call this function. In this case, the subclass must be prepared to continue rendering where it left off if this function returns Gst.FlowReturn.OK.
This function will block until a state change to PLAYING happens (in which case this function returns Gst.FlowReturn.OK) or the processing must be stopped due to a state change to READY or a FLUSH event (in which case this function returns Gst.FlowReturn.FLUSHING).
This function should only be called with the PREROLL_LOCK held, like in the render function.
Gst.FlowReturn.OK if the preroll completed and processing can continue. Any other return value should be returned from the render vmethod.
Abort the state change of the element. This function is used by elements that do asynchronous state changes and find out something is wrong.
This function should be called with the STATE_LOCK held.
MT safe.
Attach the Gst.ControlBinding to the object. If there already was a Gst.ControlBinding for this property it will be replaced.
The object's reference count will be incremented, and any floating
reference will be removed (see gst_object_ref_sink())
the Gst.ControlBinding that should be used
false if the given binding has not been setup for this object or has been setup for a non suitable property, true otherwise.
Adds a pad (link point) to element. pad's parent will be set to element;
see gst_object_set_parent() for refcounting information.
Pads are automatically activated when added in the PAUSED or PLAYING state.
The pad and the element should be unlocked when calling this function.
This function will emit the Gst.Element.SignalSignatures.pad_added | Gst.Element::pad-added signal on the element.
true if the pad could be added. This function can fail when a pad with the same name already existed or the pad already had another parent. MT safe.
name of property to watch for changes, or NULL to watch all properties
whether to include the new property value in the message
a watch id, which can be used in connection with gst_element_remove_property_notify_watch() to remove the watch again.
name of property to watch for changes, or NULL to watch all properties
whether to include the new property value in the message
a watch id, which can be used in connection with gst_element_remove_property_notify_watch() to remove the watch again.
Creates a binding between source_property on source and target_property
on target.
Whenever the source_property is changed the target_property is
updated using the same value. For instance:
g_object_bind_property (action, "active", widget, "sensitive", 0);
Will result in the "sensitive" property of the widget GObject.Object instance to be updated with the same value of the "active" property of the action GObject.Object instance.
If flags contains GObject.BindingFlags.BIDIRECTIONAL then the binding will be mutual:
if target_property on target changes then the source_property on source
will be updated as well.
The binding will automatically be removed when either the source or the
target instances are finalized. To remove the binding without affecting the
source and the target you can just call g_object_unref() on the returned
GObject.Binding instance.
Removing the binding by calling g_object_unref() on it must only be done if
the binding, source and target are only used from a single thread and it
is clear that both source and target outlive the binding. Especially it
is not safe to rely on this if the binding, source or target can be
finalized from different threads. Keep another reference to the binding and
use g_binding_unbind() instead to be on the safe side.
A GObject.Object can have multiple bindings.
the property on source to bind
the target GObject.Object
the property on target to bind
flags to pass to GObject.Binding
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Complete version of g_object_bind_property().
Creates a binding between source_property on source and target_property
on target, allowing you to set the transformation functions to be used by
the binding.
If flags contains GObject.BindingFlags.BIDIRECTIONAL then the binding will be mutual:
if target_property on target changes then the source_property on source
will be updated as well. The transform_from function is only used in case
of bidirectional bindings, otherwise it will be ignored
The binding will automatically be removed when either the source or the
target instances are finalized. This will release the reference that is
being held on the GObject.Binding instance; if you want to hold on to the
GObject.Binding instance, you will need to hold a reference to it.
To remove the binding, call g_binding_unbind().
A GObject.Object can have multiple bindings.
The same user_data parameter will be used for both transform_to
and transform_from transformation functions; the notify function will
be called once, when the binding is removed. If you need different data
for each transformation function, please use
g_object_bind_property_with_closures() instead.
the property on source to bind
the target GObject.Object
the property on target to bind
flags to pass to GObject.Binding
Optionaltransform_to: BindingTransformFuncthe transformation function from the source to the target, or null to use the default
Optionaltransform_from: BindingTransformFuncthe transformation function from the target to the source, or null to use the default
Optionalnotify: DestroyNotifya function to call when disposing the binding, to free resources used by the transformation functions, or null if not required
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Creates a binding between source_property on source and target_property
on target, allowing you to set the transformation functions to be used by
the binding.
This function is the language bindings friendly version of
g_object_bind_property_full(), using GClosures instead of
function pointers.
the property on source to bind
the target GObject.Object
the property on target to bind
flags to pass to GObject.Binding
a GObject.Closure wrapping the transformation function from the source to the target, or null to use the default
a GObject.Closure wrapping the transformation function from the target to the source, or null to use the default
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Blocks a handler of an instance so it will not be called during any signal emissions
Handler ID of the handler to be blocked
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_set_state() or indirectly e.g. via SEEK
events.
Calling those functions directly from the streaming thread will cause deadlocks in many situations, as they might involve waiting for the streaming thread to shut down from this very streaming thread.
MT safe.
Function to call asynchronously from another thread
Perform transition on element.
This function must be called with STATE_LOCK held and is mainly used internally.
the requested transition
the Gst.StateChangeReturn of the state transition.
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.StateChangeReturn.SUCCESS from the state change function.
If after calling this method the element still has not reached the pending state, the next state change is performed.
This method is used internally and should normally not be called by plugins or applications.
This function must be called with STATE_LOCK held.
The previous state return value
The result of the commit state change. MT safe.
Creates a pad for each pad template that is always available. This function is only useful during object initialization of subclasses of Gst.Element.
Creates a stream-id for element by combining the upstream information with
the stream_id.
This function generates an unique stream-id by getting the upstream
stream-start event stream ID and appending stream_id to it. If the element
has no sinkpad it will generate an upstream stream-id by doing an URI query
on the element and in the worst case just uses a random number. Source
elements that don't implement the URI handler interface should ideally
generate a unique, deterministic stream-id manually instead.
Since stream IDs are sorted alphabetically, any numbers in the stream ID should be printed with a fixed number of characters, preceded by 0's, such as by using the format %03u instead of %u.
The stream-id
A stream-id for element.
Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
Handler ID of the handler to be disconnected
This function is intended for GObject.Object implementations to re-enforce
a floating object reference. Doing this is seldom
required: all GInitiallyUnowneds are created with a floating reference
which usually just needs to be sunken by calling g_object_ref_sink().
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.
function to call for each pad
false if element had no pads or if one of the calls to func returned false.
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.
function to call for each sink pad
false if element had no sink pads or if one of the calls to func returned false.
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.
function to call for each source pad
false if element had no source pads or if one of the calls to func returned false.
Increases the freeze count on object. If the freeze count is
non-zero, the emission of "notify" signals on object is
stopped. The signals are queued until the freeze count is decreased
to zero. Duplicate notifications are squashed so that at most one
GObject.Object::notify signal is emitted for each property modified while the
object is frozen.
This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.
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.
the base time of the element. MT safe.
Returns the bus of the element. Note that only a Gst.Pipeline will provide a bus for the application.
the element's Gst.Bus. unref after usage. MT safe.
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.
This function will first attempt to find a compatible unlinked ALWAYS pad,
and if none can be found, it will request a compatible REQUEST pad by looking
at the templates of element.
the Gst.Pad to which a link can be made, or null if one cannot be found. gst_object_unref() after usage.
Retrieves a pad template from element that is compatible with compattempl.
Pads from compatible templates can be linked together.
the Gst.PadTemplate to find a compatible template for
a compatible Gst.PadTemplate, or null if none was found. No unreferencing is necessary.
Gets the context with context_type set on the element or NULL.
MT safe.
a name of a context to retrieve
A Gst.Context or NULL
Gets the context with context_type set on the element or NULL.
a name of a context to retrieve
A Gst.Context or NULL
Gets the corresponding Gst.ControlBinding for the property. This should be unreferenced again after use.
name of the property
the Gst.ControlBinding for property_name or null if the property is not controlled.
Obtain the control-rate for this object. Audio processing Gst.Element
objects will use this rate to sub-divide their processing loop and call
gst_object_sync_values() in between. The length of the processing segment
should be up to control-rate nanoseconds.
If the object is not under property control, this will return
GST_CLOCK_TIME_NONE. This allows the element to avoid the sub-dividing.
The control-rate is not expected to change if the element is in Gst.State.PAUSED or Gst.State.PLAYING.
the control rate in nanoseconds
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.
the clock time of the element, or GST_CLOCK_TIME_NONE if there is no clock.
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.
the running time of the element, or GST_CLOCK_TIME_NONE if the element has no clock or its base time has not been set.
Gets a named field from the objects table of associations (see g_object_set_data()).
name of the key for that association
the data if found, or null if no such data exists.
Retrieves the factory that was used to create this element.
the Gst.ElementFactory used for creating this element or null if element has not been registered (static element). no refcounting is needed.
Gets a number of GValues for the given controlled property starting at the
requested time. The array values need to hold enough space for n_values of
GObject.Value.
This function is useful if one wants to e.g. draw a graph of the control curve or apply a control curve sample by sample.
the name of the property to get
the time that should be processed
the time spacing between subsequent values
array to put control-values in
true if the given array could be filled, false otherwise
Get metadata with key in klass.
the key to get
the metadata for key.
Returns a copy of the name of object.
Caller should g_free() the return value after usage.
For a nameless object, this returns null, which you can safely g_free()
as well.
Free-function: g_free
the name of object. g_free() after usage. MT safe. This function grabs and releases object's LOCK.
Retrieves a padtemplate from element with the given name.
the name of the Gst.PadTemplate to get.
the Gst.PadTemplate with the given name, or null if none was found. No unreferencing is necessary.
Retrieves a list of the pad templates associated with element. The
list must not be modified by the calling code.
the GLib.List of pad templates.
Generates a string describing the path of object in
the object hierarchy. Only useful (or used) for debugging.
Free-function: g_free
a string describing the path of object. You must g_free() the string after usage. MT safe. Grabs and releases the Gst.Object's LOCK for all objects in the hierarchy.
Gets a property of an object.
The value can be:
In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
The name of the property to get
Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
This function gets back user data pointers stored via
g_object_set_qdata().
A GLib.Quark, naming the user data pointer
The user data pointer set, or null
The name of this function is confusing to people learning GStreamer.
gst_element_request_pad_simple() aims at making it more explicit it is
a simplified gst_element_request_pad().
the name of the request Gst.Pad to retrieve.
requested Gst.Pad if found, otherwise null. Release after usage.
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.
Usually the start_time is managed by a toplevel element such as Gst.Pipeline.
MT safe.
the start time of the element.
Gets the state of the element.
For elements that performed an ASYNC state change, as reported by
gst_element_set_state(), this function will block up to the
specified timeout value for the state change to complete.
If the element completes the state change or goes into
an error, this function returns immediately with a return value of
Gst.StateChangeReturn.SUCCESS or Gst.StateChangeReturn.FAILURE respectively.
For elements that did not return Gst.StateChangeReturn.ASYNC, this function returns the current and pending state immediately.
This function returns Gst.StateChangeReturn.NO_PREROLL if the element successfully changed its state but is not able to provide data yet. This mostly happens for live sources that only produce data in Gst.State.PLAYING. While the state change return is equivalent to Gst.StateChangeReturn.SUCCESS, it is returned to the application to signal that some sink elements might not be able to complete their state change because an element is not producing data to complete the preroll. When setting the element to playing, the preroll will complete and playback will start.
a Gst.ClockTime to specify the timeout for an async state change or GST_CLOCK_TIME_NONE for infinite timeout.
Gst.StateChangeReturn.SUCCESS if the element has no more pending state and the last state change succeeded, Gst.StateChangeReturn.ASYNC if the element is still performing a state change or Gst.StateChangeReturn.FAILURE if the last state change failed. MT safe.
Gets the value for the given controlled property at the requested time.
the name of the property to get
the time the control-change should be read from
the GValue of the property at the given time, or null if the property isn't controlled.
Gets n_properties properties for an object.
Obtained properties will be set to values. All properties must be valid.
Warnings will be emitted and undefined behaviour may result if invalid
properties are passed in.
the names of each property to get
the values of each property to get
Check if the object has active controlled properties.
true if the object has active controlled properties
Check if object has an ancestor ancestor somewhere up in
the hierarchy. One can e.g. check if a Gst.Element is inside a Gst.Pipeline.
a Gst.Object to check as ancestor
true if ancestor is an ancestor of object.
Check if object has an ancestor ancestor somewhere up in
the hierarchy. One can e.g. check if a Gst.Element is inside a Gst.Pipeline.
a Gst.Object to check as ancestor
true if ancestor is an ancestor of object. MT safe. Grabs and releases object's locks.
Check if parent is the parent of object.
E.g. a Gst.Element can check if it owns a given Gst.Pad.
a Gst.Object to check as parent
false if either object or parent is null. true if parent is the parent of object. Otherwise false. MT safe. Grabs and releases object's locks.
Checks whether object has a floating reference.
true if object has a floating reference
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.
MT safe.
true, if the element's state is locked.
Retrieves an iterator of element's pads. The iterator should
be freed after usage. Also more specialized iterators exists such as
gst_element_iterate_src_pads() or gst_element_iterate_sink_pads().
The order of pads returned by the iterator will be the order in which the pads were added to the element.
the Gst.Iterator of Gst.Pad. MT safe.
Retrieves an iterator of element's sink pads.
The order of pads returned by the iterator will be the order in which the pads were added to the element.
the Gst.Iterator of Gst.Pad. MT safe.
Retrieves an iterator of element's source pads.
The order of pads returned by the iterator will be the order in which the pads were added to the element.
the Gst.Iterator of Gst.Pad. MT safe.
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.
Make sure you have added your elements to a bin or pipeline with
gst_bin_add() before trying to link them.
the Gst.Element containing the destination pad.
true if the elements could be linked, false otherwise.
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.
Make sure you have added your elements to a bin or pipeline with
gst_bin_add() before trying to link them.
true if the pads could be linked, false otherwise.
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.
the name of the Gst.Pad in source element or null for any pad.
the Gst.Element containing the destination pad.
Optionaldestpadname: stringthe name of the Gst.Pad in destination element, or null for any pad.
true if the pads could be linked, false otherwise.
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.
the name of the Gst.Pad in source element or null for any pad.
the Gst.Element containing the destination pad.
Optionaldestpadname: stringthe name of the Gst.Pad in destination element or null for any pad.
Optionalfilter: Gst.Capsthe Gst.Caps to filter the link, or null for no filter.
true if the pads could be linked, false otherwise.
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.
Calling gst_element_link_pads_full() with flags == Gst.PadLinkCheck.DEFAULT
is the same as calling gst_element_link_pads() and the recommended way of
linking pads with safety checks applied.
This is a convenience function for gst_pad_link_full().
the name of the Gst.Pad in source element or null for any pad.
the Gst.Element containing the destination pad.
the name of the Gst.Pad in destination element, or null for any pad.
the Gst.PadLinkCheck to be performed when linking pads.
true if the pads could be linked, false otherwise.
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_get_state() will return Gst.StateChangeReturn.ASYNC.
An ASYNC_START message is posted. If the element was PLAYING, it will go to PAUSED. The element will be restored to its PLAYING state by the parent pipeline when it prerolls again.
This is mostly used for elements that lost their preroll buffer in the Gst.State.PAUSED or Gst.State.PLAYING state after a flush, they will go to their pending state again when a new preroll buffer is queued. This function can only be called when the element is currently not in error or an async state change.
This function is used internally and should normally not be called from plugins or applications.
Post an error, warning or info message on the bus from inside an element.
type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
#GST_MESSAGE_INFO.
MT safe.
the Gst.MessageType
the GStreamer GError domain this message belongs to
the GError code belonging to the domain
an allocated text string to be used as a replacement for the default message connected to code, or null
an allocated debug message to be used as a replacement for the default debugging information, or null
the source code file where the error was generated
the source code function where the error was generated
the source code line where the error was generated
Post an error, warning or info message on the bus from inside an element.
type must be of #GST_MESSAGE_ERROR, #GST_MESSAGE_WARNING or
#GST_MESSAGE_INFO.
the Gst.MessageType
the GStreamer GError domain this message belongs to
the GError code belonging to the domain
an allocated text string to be used as a replacement for the default message connected to code, or null
an allocated debug message to be used as a replacement for the default debugging information, or null
the source code file where the error was generated
the source code function where the error was generated
the source code line where the error was generated
optional details structure
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.
This function emits the Gst.Element.SignalSignatures.no_more_pads | Gst.Element::no-more-pads signal.
MT safe.
Emits a "notify" signal for the property property_name on object.
When possible, eg. when signaling a property change from within the class
that registered the property, you should use g_object_notify_by_pspec()
instead.
Note that emission of the notify signal may be blocked with
g_object_freeze_notify(). In this case, the signal emissions are queued
and will be emitted (in reverse order) when g_object_thaw_notify() is
called.
the name of a property installed on the class of object.
Emits a "notify" signal for the property specified by pspec on object.
This function omits the property name lookup, hence it is faster than
g_object_notify().
One way to avoid using g_object_notify() from within the
class that registered the properties, and using g_object_notify_by_pspec()
instead, is to store the GParamSpec used with
g_object_class_install_property() inside a static array, e.g.:
typedef enum
{
PROP_FOO = 1,
PROP_LAST
} MyObjectProperty;
static GParamSpec *properties[PROP_LAST];
static void
my_object_class_init (MyObjectClass *klass)
{
properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
0, 100,
50,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (gobject_class,
PROP_FOO,
properties[PROP_FOO]);
}
and then notify a change on the "foo" property with:
g_object_notify_by_pspec (self, properties[PROP_FOO]);
the GObject.ParamSpec of a property installed on the class of object.
Post a message on the element's Gst.Bus. 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.
a Gst.Message to post
true if the message was successfully posted. The function returns false if the element did not have a bus. MT safe.
Performs a query on the given element.
For elements that don't implement a query handler, this function forwards the query to a random srcpad or to the peer of a random linked sinkpad of this element.
Please note that some queries might need a running pipeline to work.
true if the query could be performed. MT safe.
Queries an element to convert src_val in src_format to dest_format.
a Gst.Format to convert from.
a value to convert.
the Gst.Format to convert to.
true if the query could be performed.
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.
If the duration changes for some reason, you will get a DURATION_CHANGED message on the pipeline bus, in which case you should re-query the duration using this function.
the Gst.Format requested
true if the query could be performed.
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.
If one repeatedly calls this function one can also create a query and reuse
it in gst_element_query().
the Gst.Format requested
true if the query could be performed.
Increase the reference count of object, and possibly remove the
floating reference, if object has a floating reference.
In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.
Since GLib 2.56, the type of object will be propagated to the return type
under the same conditions as for g_object_ref().
object
Makes the element free the previously requested pad as obtained
with gst_element_request_pad().
This does not unref the pad. If the pad was created by using
gst_element_request_pad(), gst_element_release_request_pad() needs to be
followed by gst_object_unref() to free the pad.
MT safe.
Removes the corresponding Gst.ControlBinding. If it was the last ref of the binding, it will be disposed.
the binding
true if the binding could be removed.
Removes pad from element. pad will be destroyed if it has not been
referenced elsewhere using gst_object_unparent().
This function is used by plugin developers and should not be used
by applications. Pads that were dynamically requested from elements
with gst_element_request_pad() should be released with the
gst_element_release_request_pad() function instead.
Pads are not automatically deactivated so elements should perform the needed
steps to deactivate the pad in case this pad is removed in the PAUSED or
PLAYING state. See gst_pad_set_active() for more information about
deactivating pads.
The pad and the element should be unlocked when calling this function.
This function will emit the Gst.Element.SignalSignatures.pad_removed | Gst.Element::pad-removed signal on the element.
true if the pad could be removed. Can return false if the pad does not belong to the provided element. MT safe.
watch id to remove
Retrieves a request pad from the element according to the provided template.
Pad templates can be looked up using
gst_element_factory_get_static_pad_templates().
The pad should be released with gst_element_release_request_pad().
a Gst.PadTemplate of which we want a pad of.
Optionalname: stringthe name of the request Gst.Pad to retrieve. Can be null.
Optionalcaps: Gst.Capsthe caps of the pad we want to request. Can be null.
requested Gst.Pad if found, otherwise null. Release after usage.
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_release_request_pad().
This method is slower than manually getting the pad template and calling
gst_element_request_pad() if the pads should have a specific name (e.g.
name is "src_1" instead of "src_%u").
Note that this function was introduced in GStreamer 1.20 in order to provide
a better name to gst_element_get_request_pad(). Prior to 1.20, users
should use gst_element_get_request_pad() which provides the same
functionality.
the name of the request Gst.Pad to retrieve.
requested Gst.Pad if found, otherwise null. Release after usage.
Releases all references to other objects. This can be used to break reference cycles.
This function should only be called from object system implementations.
Sends a seek event to an element. See gst_event_new_seek() for the details of
the parameters. The seek event is sent to the element using
gst_element_send_event().
MT safe.
The new playback rate
The format of the seek values
The optional seek flags.
The type and flags for the new start position
The value of the new start position
The type and flags for the new stop position
The value of the new stop position
true if the event was handled. Flushing seeks will trigger a preroll, which will emit Gst.MessageType.ASYNC_DONE.
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_seek().
In a completely prerolled PAUSED or PLAYING pipeline, seeking is always
guaranteed to return true on a seekable media type or false when the media
type is certainly not seekable (such as a live stream).
Some elements allow for seeking in the READY state, in this
case they will store the seek event and execute it when they are put to
PAUSED. If the element supports seek in READY, it will always return true when
it receives the event in the READY state.
a Gst.Format to execute the seek in, such as #GST_FORMAT_TIME
seek options; playback applications will usually want to use GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT here
position to seek to (relative to the start); if you are doing a seek in #GST_FORMAT_TIME this value is in nanoseconds - multiply with #GST_SECOND to convert seconds to nanoseconds or with #GST_MSECOND to convert milliseconds to nanoseconds.
true if the seek operation succeeded. Flushing seeks will trigger a preroll, which will emit Gst.MessageType.ASYNC_DONE.
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.
This function takes ownership of the provided event so you should
gst_event_ref() it if you want to reuse the event after this call.
MT safe.
true if the event was handled. Events that trigger a preroll (such as flushing seeks and steps) will emit Gst.MessageType.ASYNC_DONE.
Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
Object containing the properties to set
Set the base time of an element. See gst_element_get_base_time().
MT safe.
the base time to set.
Sets the clock for the element. This function increases the refcount on the clock. Any previously set clock on the object is unreffed.
true if the element accepted the clock. An element can refuse a clock when it, for example, is not able to slave its internal clock to the clock or when it requires a specific clock to operate. MT safe.
Sets the context of the element. Increases the refcount of the context.
MT safe.
the Gst.Context to set.
This function is used to disable the control bindings on a property for
some time, i.e. gst_object_sync_values() will do nothing for the
property.
property to disable
boolean that specifies whether to disable the controller or not.
This function is used to disable all controlled properties of the object for
some time, i.e. gst_object_sync_values() will do nothing.
boolean that specifies whether to disable the controller or not.
Change the control-rate for this object. Audio processing Gst.Element
objects will use this rate to sub-divide their processing loop and call
gst_object_sync_values() in between. The length of the processing segment
should be up to control-rate nanoseconds.
The control-rate should not change if the element is in Gst.State.PAUSED or Gst.State.PLAYING.
the new control-rate in nanoseconds.
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
If the object already had an association with that name, the old association will be destroyed.
Internally, the key is converted to a GLib.Quark using g_quark_from_string().
This means a copy of key is kept permanently (even after object has been
finalized) — so it is recommended to only use a small, bounded set of values
for key in your program, to avoid the GLib.Quark storage growing unbounded.
name of the key
Optionaldata: anydata to associate with that key
Locks the state of an element, so state changes of the parent don't affect this element anymore.
Note that this is racy if the state lock of the parent bin is not taken. The parent bin might've just checked the flag in another thread and as the next step proceed to change the child element's state.
MT safe.
true to lock the element's state
true if the state was changed, false if bad parameters were given or the elements state-locking needed no change.
Sets the name of object, or gives object a guaranteed unique
name (if name is null).
This function makes a copy of the provided name, so the caller
retains ownership of the name it sent.
Optionalname: stringnew name of object
true if the name could be set. Since Objects that have a parent cannot be renamed, this function returns false in those cases. MT safe. This function grabs and releases object's LOCK.
Sets the parent of object to parent. The object's reference count will
be incremented, and any floating reference will be removed (see gst_object_ref_sink()).
true if parent could be set or false when object already had a parent or object and parent are the same. MT safe. Grabs and releases object's LOCK.
Sets a property on an object.
The name of the property to set
The value to set the property to
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.
Toplevel elements like Gst.Pipeline will manage the start_time and base_time on its children. Setting the start_time to #GST_CLOCK_TIME_NONE on such a toplevel element will disable the distribution of the base_time to the children and can be useful if the application manages the base_time itself, for example if you want to synchronize capture from multiple pipelines, and you can also ensure that the pipelines have the same clock.
MT safe.
the base time to set.
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.
This function can return #GST_STATE_CHANGE_ASYNC, in which case the
element will perform the remainder of the state change asynchronously in
another thread.
An application can use gst_element_get_state() to wait for the completion
of the state change or it can wait for a Gst.MessageType.ASYNC_DONE or
Gst.MessageType.STATE_CHANGED on the bus.
State changes to Gst.State.READY or Gst.State.NULL never return #GST_STATE_CHANGE_ASYNC.
Result of the state change using Gst.StateChangeReturn. MT safe.
Remove a specified datum from the object's data associations, without invoking the association's destroy handler.
name of the key
the data if found, or null if no such data exists.
This function gets back user data pointers stored via
g_object_set_qdata() and removes the data from object
without invoking its destroy() function (if any was
set).
Usually, calling this function is only required to update
user data pointers with a destroy notifier, for example:
void
object_add_to_user_list (GObject *object,
const gchar *new_string)
{
// the quark, naming the object data
GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
// retrieve the old string list
GList *list = g_object_steal_qdata (object, quark_string_list);
// prepend new string
list = g_list_prepend (list, g_strdup (new_string));
// this changed 'list', so we need to set it again
g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
}
static void
free_string_list (gpointer data)
{
GList *node, *list = data;
for (node = list; node; node = node->next)
g_free (node->data);
g_list_free (list);
}
Using g_object_get_qdata() in the above example, instead of
g_object_steal_qdata() would have left the destroy function set,
and thus the partial string list would have been freed upon
g_object_set_qdata_full().
A GLib.Quark, naming the user data pointer
The user data pointer set, or null
Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
Name of the signal to stop emission of
Returns a suggestion for timestamps where buffers should be split to get best controller results.
Returns the suggested timestamp or GST_CLOCK_TIME_NONE if no control-rate was set.
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.
true, if the element's state could be synced to the parent's state. MT safe.
Sets the properties of the object, according to the GstControlSources that
(maybe) handle them and for the given timestamp.
If this function fails, it is most likely the application developers fault. Most probably the control sources are not setup correctly.
the time that should be processed
true if the controller values could be applied to the object properties, false otherwise
Reverts the effect of a previous call to
g_object_freeze_notify(). The freeze count is decreased on object
and when it reaches zero, queued "notify" signals are emitted.
Duplicate notifications for each property are squashed so that at most one GObject.Object::notify signal is emitted for each property, in the reverse order in which they have been queued.
It is an error to call this function when the freeze count is zero.
Unblocks a handler so it will be called again during any signal emissions
Handler ID of the handler to be unblocked
Unlinks all source pads of the source element with all sink pads of the sink element to which they are linked.
If the link has been made using gst_element_link(), it could have created an
requestpad, which has to be released using gst_element_release_request_pad().
the sink Gst.Element to unlink.
Unlinks the two named pads of the source and destination elements.
This is a convenience function for gst_pad_unlink().
the name of the Gst.Pad in source element.
a Gst.Element containing the destination pad.
the name of the Gst.Pad in destination element.
Clear the parent of object, removing the associated reference.
This function decreases the refcount of object.
MT safe. Grabs and releases object's lock.
Decrements the reference count on object. If reference count hits
zero, destroy object. This function does not take the lock
on object as it relies on atomic refcounting.
The unref method should never be called with the LOCK held since this might deadlock the dispose function.
Virtualvfunc_Perform transition on element.
This function must be called with STATE_LOCK held and is mainly used internally.
the requested transition
Virtualvfunc_the constructed function is called by g_object_new() as the
final step of the object creation process. At the point of the call, all
construction properties have been set on the object. The purpose of this
call is to allow for object initialisation steps that can only be performed
after construction properties have been set. constructed implementors
should chain up to the constructed call of their parent class to allow it
to complete its initialisation.
Virtualvfunc_Virtualvfunc_Virtualvfunc_the dispose function is supposed to drop all references to other
objects, but keep the instance otherwise intact, so that client method
invocations still work. It may be run multiple times (due to reference
loops). Before returning, dispose should chain up to the dispose method
of the parent class.
Virtualvfunc_instance finalization function, should finish the finalization of
the instance begun in dispose and chain up to the finalize method of the
parent class.
Virtualvfunc_Virtualvfunc_Gets the state of the element.
For elements that performed an ASYNC state change, as reported by
gst_element_set_state(), this function will block up to the
specified timeout value for the state change to complete.
If the element completes the state change or goes into
an error, this function returns immediately with a return value of
Gst.StateChangeReturn.SUCCESS or Gst.StateChangeReturn.FAILURE respectively.
For elements that did not return Gst.StateChangeReturn.ASYNC, this function returns the current and pending state immediately.
This function returns Gst.StateChangeReturn.NO_PREROLL if the element successfully changed its state but is not able to provide data yet. This mostly happens for live sources that only produce data in Gst.State.PLAYING. While the state change return is equivalent to Gst.StateChangeReturn.SUCCESS, it is returned to the application to signal that some sink elements might not be able to complete their state change because an element is not producing data to complete the preroll. When setting the element to playing, the preroll will complete and playback will start.
a Gst.ClockTime to specify the timeout for an async state change or GST_CLOCK_TIME_NONE for infinite timeout.
Virtualvfunc_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.
This function emits the Gst.Element.SignalSignatures.no_more_pads | Gst.Element::no-more-pads signal.
MT safe.
Virtualvfunc_Emits a "notify" signal for the property property_name on object.
When possible, eg. when signaling a property change from within the class
that registered the property, you should use g_object_notify_by_pspec()
instead.
Note that emission of the notify signal may be blocked with
g_object_freeze_notify(). In this case, the signal emissions are queued
and will be emitted (in reverse order) when g_object_thaw_notify() is
called.
Virtualvfunc_Virtualvfunc_Virtualvfunc_Post a message on the element's Gst.Bus. 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.
a Gst.Message to post
Virtualvfunc_Virtualvfunc_Virtualvfunc_Retrieves a request pad from the element according to the provided template.
Pad templates can be looked up using
gst_element_factory_get_static_pad_templates().
The pad should be released with gst_element_release_request_pad().
a Gst.PadTemplate of which we want a pad of.
Optionalname: stringthe name of the request Gst.Pad to retrieve. Can be null.
Optionalcaps: Gst.Capsthe caps of the pad we want to request. Can be null.
Virtualvfunc_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.
This function takes ownership of the provided event so you should
gst_event_ref() it if you want to reuse the event after this call.
MT safe.
Virtualvfunc_Virtualvfunc_Virtualvfunc_Sets the context of the element. Increases the refcount of the context.
MT safe.
the Gst.Context to set.
Virtualvfunc_the generic setter for all properties of this type. Should be
overridden for every type with properties. If implementations of
set_property don't emit property change notification explicitly, this will
be done implicitly by the type system. However, if the notify signal is
emitted explicitly, the type system will not emit it a second time.
Virtualvfunc_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.
This function can return #GST_STATE_CHANGE_ASYNC, in which case the
element will perform the remainder of the state change asynchronously in
another thread.
An application can use gst_element_get_state() to wait for the completion
of the state change or it can wait for a Gst.MessageType.ASYNC_DONE or
Gst.MessageType.STATE_CHANGED on the bus.
State changes to Gst.State.READY or Gst.State.NULL never return #GST_STATE_CHANGE_ASYNC.
Virtualvfunc_This function essentially limits the life time of the closure to
the life time of the object. That is, when the object is finalized,
the closure is invalidated by calling g_closure_invalidate() on
it, in order to prevent invocations of the closure with a finalized
(nonexisting) object. Also, g_object_ref() and g_object_unref() are
added as marshal guards to the closure, to ensure that an extra
reference count is held on object during invocation of the
closure. Usually, this function will be called on closures that
use this object as closure data.
GObject.Closure to watch
Static_Staticadd_the key to set
the value to set
Staticadd_a Gst.PadTemplate to add to the element class.
Staticadd_the key to set
the value to set
Staticadd_Gst.StaticPadTemplate to add as pad template to the element class.
Staticadd_Gst.StaticPadTemplate to add as pad template to the element class.
The GObject.GType of the pad to create
Staticcheck_Checks to see if there is any object named name in list. This function
does not do any locking of any kind. You might want to protect the
provided list with the lock of the owner of the list. This function
will lock each Gst.Object in the list to compare the name, so be
careful when passing a list with a locked object.
a list of Gst.Object to check through
the name to search for
Staticcompat_Optionaldata: anyStaticdefault_A default deep_notify signal callback for an object. The user data should contain a pointer to an array of strings that should be excluded from the notify. The default handler will print the new value of the property using g_print.
MT safe. This function grabs and releases object's LOCK for getting its
path string.
the GObject.Object that signalled the notify.
a Gst.Object that initiated the notify.
a GObject.ParamSpec of the property.
Optionalexcluded_props: string[]a set of user-specified properties to exclude or null to show all changes.
Staticfind_Staticget_the key to get
Staticget_the name of the Gst.PadTemplate to get.
Staticget_Staticinstall_Staticinstall_the id for the new property
the GObject.ParamSpec for the new property
Staticinterface_Find the GObject.ParamSpec with the given name for an
interface. Generally, the interface vtable passed in as g_iface
will be the default vtable from g_type_default_interface_ref(), or,
if you know the interface has already been loaded,
g_type_default_interface_peek().
any interface vtable for the interface, or the default vtable for the interface
name of a property to look up.
Staticinterface_Add a property to an interface; this is only useful for interfaces
that are added to GObject-derived types. Adding a property to an
interface forces all objects classes with that interface to have a
compatible property. The compatible property could be a newly
created GObject.ParamSpec, but normally
g_object_class_override_property() will be used so that the object
class only needs to provide an implementation and inherits the
property description, default value, bounds, and so forth from the
interface property.
This function is meant to be called from the interface's default
vtable initialization function (the class_init member of
GObject.TypeInfo.) It must not be called after after class_init has
been called for any object types implementing this interface.
If pspec is a floating reference, it will be consumed.
any interface vtable for the interface, or the default vtable for the interface.
the GObject.ParamSpec for the new property
Staticinterface_Lists the properties of an interface.Generally, the interface
vtable passed in as g_iface will be the default vtable from
g_type_default_interface_ref(), or, if you know the interface has
already been loaded, g_type_default_interface_peek().
any interface vtable for the interface, or the default vtable for the interface
Staticlist_Staticmake_StaticnewvStaticoverride_the new property ID
the name of a property registered in a parent class or in an interface of this class.
StaticregisterCreate a new elementfactory capable of instantiating objects of the
type and add the factory to plugin.
Gst.Plugin to register the element with, or null for a static element.
name of elements of this type
rank of element (higher rank means more importance when autoplugging)
GType of element to register
StaticreplaceAtomically modifies a pointer to point to a new object.
The reference count of oldobj is decreased and the reference count of
newobj is increased.
Either newobj and the value pointed to by oldobj may be null.
Optionaloldobj: Gst.Objectpointer to a place of a Gst.Object to replace
Optionalnewobj: Gst.Objecta new Gst.Object
Staticset_The long English name of the element. E.g. "File Sink"
String describing the type of element, as an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs for more details and common types. E.g: "Sink/File"
Sentence describing the purpose of the element. E.g: "Write stream to a file"
Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>"
Staticset_The long English name of the element. E.g. "File Sink"
String describing the type of element, as an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs for more details and common types. E.g: "Sink/File"
Sentence describing the purpose of the element. E.g: "Write stream to a file"
Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>"
Staticstate_Gets a string representing the given state change result.
a Gst.StateChangeReturn to get the name of.
Staticstate_Statictype_Marks type as "documentation should be skipped".
Can be useful for dynamically registered element to be excluded from
plugin documentation system.
Example:
GType my_type;
GTypeInfo my_type_info;
// Fill "my_type_info"
...
my_type = g_type_register_static (GST_TYPE_MY_ELEMENT, "my-type-name",
&my_type_info, 0);
gst_element_type_set_skip_documentation (my_type);
gst_element_register (plugin, "my-plugin-feature-name", rank, my_type);
a GObject.GType of element
GstBase.BaseSink is the base class for sink elements in GStreamer, such as xvimagesink or filesink. It is a layer on top of Gst.Element that provides a simplified interface to plugin writers. GstBase.BaseSink handles many details for you, for example: preroll, clock synchronization, state changes, activation in push or pull mode, and queries.
In most cases, when writing sink elements, there is no need to implement class methods from Gst.Element or to set functions on pads, because the GstBase.BaseSink infrastructure should be sufficient.
GstBase.BaseSink provides support for exactly one sink pad, which should be named "sink". A sink implementation (subclass of GstBase.BaseSink) should install a pad template in its class_init function, like so:
GstBase.BaseSink will handle the prerolling correctly. This means that it will return Gst.StateChangeReturn.ASYNC from a state change to PAUSED until the first buffer arrives in this element. The base class will call the GstBase.BaseSinkClass.SignalSignatures.preroll | GstBase.BaseSinkClass::preroll vmethod with this preroll buffer and will then commit the state change to the next asynchronously pending state.
When the element is set to PLAYING, GstBase.BaseSink will synchronise on the clock using the times returned from GstBase.BaseSinkClass.SignalSignatures.get_times | GstBase.BaseSinkClass::get_times. If this function returns
GST_CLOCK_TIME_NONEfor the start time, no synchronisation will be done. Synchronisation can be disabled entirely by setting the object GstBase.BaseSink.sync property tofalse.After synchronisation the virtual method GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render will be called. Subclasses should minimally implement this method.
Subclasses that synchronise on the clock in the GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render method are supported as well. These classes typically receive a buffer in the render method and can then potentially block on the clock while rendering. A typical example is an audiosink. These subclasses can use
gst_base_sink_wait_preroll()to perform the blocking wait.Upon receiving the EOS event in the PLAYING state, GstBase.BaseSink will wait for the clock to reach the time indicated by the stop time of the last GstBase.BaseSinkClass.SignalSignatures.get_times | GstBase.BaseSinkClass::get_times call before posting an EOS message. When the element receives EOS in PAUSED, preroll completes, the event is queued and an EOS message is posted when going to PLAYING.
GstBase.BaseSink will internally use the Gst.EventType.SEGMENT events to schedule synchronisation and clipping of buffers. Buffers that fall completely outside of the current segment are dropped. Buffers that fall partially in the segment are rendered (and prerolled). Subclasses should do any subbuffer clipping themselves when needed.
GstBase.BaseSink will by default report the current playback position in Gst.Format.TIME based on the current clock time and segment information. If no clock has been set on the element, the query will be forwarded upstream.
The GstBase.BaseSinkClass.SignalSignatures.set_caps | GstBase.BaseSinkClass::set_caps function will be called when the subclass should configure itself to process a specific media type.
The GstBase.BaseSinkClass.SignalSignatures.start | GstBase.BaseSinkClass::start and GstBase.BaseSinkClass.SignalSignatures.stop | GstBase.BaseSinkClass::stop virtual methods will be called when resources should be allocated. Any GstBase.BaseSinkClass.SignalSignatures.preroll | GstBase.BaseSinkClass::preroll, GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render and GstBase.BaseSinkClass.SignalSignatures.set_caps | GstBase.BaseSinkClass::set_caps function will be called between the GstBase.BaseSinkClass.SignalSignatures.start | GstBase.BaseSinkClass::start and GstBase.BaseSinkClass.SignalSignatures.stop | GstBase.BaseSinkClass::stop calls.
The GstBase.BaseSinkClass.SignalSignatures.event | GstBase.BaseSinkClass::event virtual method will be called when an event is received by GstBase.BaseSink. Normally this method should only be overridden by very specific elements (such as file sinks) which need to handle the newsegment event specially.
The GstBase.BaseSinkClass.SignalSignatures.unlock | GstBase.BaseSinkClass::unlock method is called when the elements should unblock any blocking operations they perform in the GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render method. This is mostly useful when the GstBase.BaseSinkClass.SignalSignatures.render | GstBase.BaseSinkClass::render method performs a blocking write on a file descriptor, for example.
The GstBase.BaseSink.max_lateness property affects how the sink deals with buffers that arrive too late in the sink. A buffer arrives too late in the sink when the presentation time (as a combination of the last segment, buffer timestamp and element base_time) plus the duration is before the current time of the clock. If the frame is later than max-lateness, the sink will drop the buffer without calling the render method. This feature is disabled if sync is disabled, the GstBase.BaseSinkClass.SignalSignatures.get_times | GstBase.BaseSinkClass::get_times method does not return a valid start time or max-lateness is set to -1 (the default). Subclasses can use
gst_base_sink_set_max_lateness()to configure the max-lateness value.The GstBase.BaseSink.qos property will enable the quality-of-service features of the basesink which gather statistics about the real-time performance of the clock synchronisation. For each buffer received in the sink, statistics are gathered and a QOS event is sent upstream with these numbers. This information can then be used by upstream elements to reduce their processing rate, for example.
The GstBase.BaseSink.async property can be used to instruct the sink to never perform an ASYNC state change. This feature is mostly usable when dealing with non-synchronized streams or sparse streams.