Struct gstreamer_pbutils::Discoverer [−][src]
pub struct Discoverer(_);
Expand description
The Discoverer
is a utility object which allows to get as much
information as possible from one or many URIs.
It provides two APIs, allowing usage in blocking or non-blocking mode.
The blocking mode just requires calling discover_uri()
with the URI one wishes to discover.
The non-blocking mode requires a running glib::MainLoop
iterating a
glib::MainContext
, where one connects to the various signals, appends the
URIs to be processed (through discover_uri_async()
) and then
asks for the discovery to begin (through start()
).
By default this will use the GLib default main context unless you have
set a custom context using glib::MainContext::push_thread_default()
.
All the information is returned in a DiscovererInfo
structure.
Implements
Implementations
Creates a new Discoverer
with the provided timeout.
timeout
timeout per file, in nanoseconds. Allowed are values between
one second (GST_SECOND
) and one hour (3600 * GST_SECOND
)
Returns
The new Discoverer
.
If an error occurred when creating the discoverer, err
will be set
accordingly and None
will be returned. If err
is set, the caller must
free it when no longer needed using g_error_free()
.
Appends the given uri
to the list of URIs to discoverer. The actual
discovery of the uri
will only take place if start()
has
been called.
A copy of uri
will be made internally, so the caller can safely g_free()
afterwards.
uri
the URI to add.
Returns
true
if the uri
was successfully appended to the list of pending
uris, else false
Allow asynchronous discovering of URIs to take place.
A glib::MainLoop
must be available for Discoverer
to properly work in
asynchronous mode.
Stop the discovery of any pending URIs and clears the list of pending URIS (if any).
v1_16
only.v1_16
only.pub fn connect_discovered<F: Fn(&Self, &DiscovererInfo, Option<&Error>) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
pub fn connect_discovered<F: Fn(&Self, &DiscovererInfo, Option<&Error>) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]Will be emitted in async mode when all information on a URI could be discovered, or an error occurred.
When an error occurs, info
might still contain some partial information,
depending on the circumstances of the error.
info
the results DiscovererInfo
error
glib::Error
, which will be non-NULL
if an error occurred during
discovery. You must not free
this glib::Error
, it will be freed by
the discoverer.
Will be emitted in async mode when all pending URIs have been processed.
pub fn connect_source_setup<F: Fn(&Self, &Element) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
pub fn connect_source_setup<F: Fn(&Self, &Element) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]This signal is emitted after the source element has been created for, so the URI being discovered, so it can be configured by setting additional properties (e.g. set a proxy server for an http source, or set the device and read speed for an audio cd source).
This signal is usually emitted from the context of a GStreamer streaming thread.
source
source element
Will be emitted when the discover starts analyzing the pending URIs
pub fn connect_use_cache_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_16
only.The duration (in nanoseconds) after which the discovery of an individual URI will timeout.
If the discovery of a URI times out, the DiscovererResult::Timeout
will be
set on the result flags.
The duration (in nanoseconds) after which the discovery of an individual URI will timeout.
If the discovery of a URI times out, the DiscovererResult::Timeout
will be
set on the result flags.
pub fn connect_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
Upcasts an object to a superclass or interface T
. Read more
Upcasts an object to a reference of its superclass or interface T
. Read more
Tries to downcast to a subclass or interface implementor T
. Read more
Tries to downcast to a reference of its subclass or interface implementor T
. Read more
Tries to cast to an object of type T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read more
Tries to cast to reference to an object of type T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read more
Casts to T
unconditionally. Read more
Casts to &T
unconditionally. Read more
Returns true
if the object is an instance of (can be cast to) T
.
pub fn set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
[src]pub fn set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
[src]pub fn set_property<'a, N, V>(
&self,
property_name: N,
value: V
) -> Result<(), BoolError> where
V: ToValue,
N: Into<&'a str>,
[src]pub fn set_property_from_value<'a, N>(
&self,
property_name: N,
value: &Value
) -> Result<(), BoolError> where
N: Into<&'a str>,
[src]pub fn property<'a, N>(&self, property_name: N) -> Result<Value, BoolError> where
N: Into<&'a str>,
[src]Safety Read more
Safety Read more
Safety Read more
Safety Read more
pub fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
[src]pub fn connect_notify_local<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec),
[src]pub unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
[src]pub fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>,
[src]pub fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>,
[src]pub fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
[src]Same as connect
but takes a SignalId
instead of a signal name.
pub fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
[src]Same as connect_local
but takes a SignalId
instead of a signal name.
pub unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
[src]Same as connect_unsafe
but takes a SignalId
instead of a signal name.
Emit signal by signal id.
Emit signal with details by signal id.
Emit signal by it’s name.
pub fn bind_property<'a, O, N, M>(
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
N: Into<&'a str>,
M: Into<&'a str>,
[src]Same as emit
but takes Value
for the arguments.
Same as emit_by_name
but takes Value
for the arguments.
Returns a SendValue
clone of self
.
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,
[src]