Trait gstreamer::prelude::GstObjectExt
source · pub trait GstObjectExt: IsA<Object> + Sealed + 'static {
Show 21 methods
// Provided methods
fn add_control_binding(
&self,
binding: &impl IsA<ControlBinding>,
) -> Result<(), BoolError> { ... }
fn default_error(&self, error: &Error, debug: Option<&str>) { ... }
fn control_binding(&self, property_name: &str) -> Option<ControlBinding> { ... }
fn control_rate(&self) -> Option<ClockTime> { ... }
fn name(&self) -> GString { ... }
fn parent(&self) -> Option<Object> { ... }
fn path_string(&self) -> GString { ... }
fn value(
&self,
property_name: &str,
timestamp: impl Into<Option<ClockTime>>,
) -> Option<Value> { ... }
fn has_active_control_bindings(&self) -> bool { ... }
fn has_ancestor(&self, ancestor: &impl IsA<Object>) -> bool { ... }
fn has_as_ancestor(&self, ancestor: &impl IsA<Object>) -> bool { ... }
fn has_as_parent(&self, parent: &impl IsA<Object>) -> bool { ... }
fn remove_control_binding(&self, binding: &impl IsA<ControlBinding>) -> bool { ... }
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool) { ... }
fn set_control_bindings_disabled(&self, disabled: bool) { ... }
fn set_control_rate(&self, control_rate: impl Into<Option<ClockTime>>) { ... }
fn set_parent(&self, parent: &impl IsA<Object>) -> Result<(), BoolError> { ... }
fn suggest_next_sync(&self) -> Option<ClockTime> { ... }
fn sync_values(&self, timestamp: ClockTime) -> Result<(), BoolError> { ... }
fn unparent(&self) { ... }
fn connect_parent_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Trait containing all Object
methods.
§Implementors
Allocator
, BufferPool
, Bus
, Clock
, ControlBinding
, ControlSource
, DeviceMonitor
, DeviceProvider
, Device
, Element
, Object
, PadTemplate
, Pad
, PluginFeature
, Plugin
, Registry
, StreamCollection
, Stream
, TaskPool
, Task
, Tracer
Provided Methods§
sourcefn add_control_binding(
&self,
binding: &impl IsA<ControlBinding>,
) -> Result<(), BoolError>
fn add_control_binding( &self, binding: &impl IsA<ControlBinding>, ) -> Result<(), BoolError>
Attach the ControlBinding
to the object. If there already was a
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()
)
§binding
the ControlBinding
that should be used
§Returns
false
if the given binding
has not been setup for this object or
has been setup for a non suitable property, true
otherwise.
sourcefn default_error(&self, error: &Error, debug: Option<&str>)
fn default_error(&self, error: &Error, debug: Option<&str>)
sourcefn control_binding(&self, property_name: &str) -> Option<ControlBinding>
fn control_binding(&self, property_name: &str) -> Option<ControlBinding>
Gets the corresponding ControlBinding
for the property. This should be
unreferenced again after use.
§property_name
name of the property
§Returns
the ControlBinding
for
property_name
or None
if the property is not controlled.
sourcefn control_rate(&self) -> Option<ClockTime>
fn control_rate(&self) -> Option<ClockTime>
Obtain the control-rate for this self
. Audio processing Element
objects will use this rate to sub-divide their processing loop and call
sync_values()
in between. The length of the processing segment
should be up to control
-rate nanoseconds.
If the self
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
State::Paused
or State::Playing
.
§Returns
the control rate in nanoseconds
sourcefn path_string(&self) -> GString
fn path_string(&self) -> GString
sourcefn value(
&self,
property_name: &str,
timestamp: impl Into<Option<ClockTime>>,
) -> Option<Value>
fn value( &self, property_name: &str, timestamp: impl Into<Option<ClockTime>>, ) -> Option<Value>
sourcefn has_active_control_bindings(&self) -> bool
fn has_active_control_bindings(&self) -> bool
sourcefn has_ancestor(&self, ancestor: &impl IsA<Object>) -> bool
fn has_ancestor(&self, ancestor: &impl IsA<Object>) -> bool
sourcefn has_as_ancestor(&self, ancestor: &impl IsA<Object>) -> bool
fn has_as_ancestor(&self, ancestor: &impl IsA<Object>) -> bool
sourcefn has_as_parent(&self, parent: &impl IsA<Object>) -> bool
fn has_as_parent(&self, parent: &impl IsA<Object>) -> bool
sourcefn remove_control_binding(&self, binding: &impl IsA<ControlBinding>) -> bool
fn remove_control_binding(&self, binding: &impl IsA<ControlBinding>) -> bool
Removes the corresponding ControlBinding
. If it was the
last ref of the binding, it will be disposed.
§binding
the binding
§Returns
true
if the binding could be removed.
sourcefn set_control_binding_disabled(&self, property_name: &str, disabled: bool)
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool)
This function is used to disable the control bindings on a property for
some time, i.e. sync_values()
will do nothing for the
property.
§property_name
property to disable
§disabled
boolean that specifies whether to disable the controller or not.
sourcefn set_control_bindings_disabled(&self, disabled: bool)
fn set_control_bindings_disabled(&self, disabled: bool)
This function is used to disable all controlled properties of the self
for
some time, i.e. sync_values()
will do nothing.
§disabled
boolean that specifies whether to disable the controller or not.
sourcefn set_control_rate(&self, control_rate: impl Into<Option<ClockTime>>)
fn set_control_rate(&self, control_rate: impl Into<Option<ClockTime>>)
Change the control-rate for this self
. Audio processing Element
objects will use this rate to sub-divide their processing loop and call
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 State::Paused
or
State::Playing
.
§control_rate
the new control-rate in nanoseconds.
sourcefn set_parent(&self, parent: &impl IsA<Object>) -> Result<(), BoolError>
fn set_parent(&self, parent: &impl IsA<Object>) -> Result<(), BoolError>
Sets the parent of self
to parent
. The object’s reference count will
be incremented, and any floating reference will be removed (see gst_object_ref_sink()
).
§parent
new parent of object
§Returns
true
if parent
could be set or false
when self
already had a parent or self
and parent
are the same.
MT safe. Grabs and releases self
’s LOCK.
sourcefn suggest_next_sync(&self) -> Option<ClockTime>
fn suggest_next_sync(&self) -> Option<ClockTime>
Returns a suggestion for timestamps where buffers should be split to get best controller results.
§Returns
Returns the suggested timestamp or GST_CLOCK_TIME_NONE
if no control-rate was set.
sourcefn sync_values(&self, timestamp: ClockTime) -> Result<(), BoolError>
fn sync_values(&self, timestamp: ClockTime) -> Result<(), BoolError>
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.
§timestamp
the time that should be processed
§Returns
true
if the controller values could be applied to the object
properties, false
otherwise
sourcefn unparent(&self)
fn unparent(&self)
Clear the parent of self
, removing the associated reference.
This function decreases the refcount of self
.
MT safe. Grabs and releases self
’s lock.