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

glib::ObjectExt

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().

Synchronously discovers the given uri.

A copy of uri will be made internally, so the caller can safely g_free() afterwards.

uri

The URI to run on.

Returns

the result of the scanning. Can be None if an error occurred.

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).

This is supported on crate feature v1_16 only.
This is supported on crate feature v1_16 only.

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.

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

This is supported on crate feature 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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

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

Performs the conversion.

Performs the conversion.

Returns true if the object is an instance of (can be cast to) T.

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Same as connect but takes a SignalId instead of a signal name.

Same as connect_local but takes a SignalId instead of a signal name.

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.

Same as emit but takes Value for the arguments.

Same as emit_by_name but takes Value for the arguments.

Same as emit_with_details but takes Value for the arguments.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Returns a SendValue clone of self.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.