[][src]Struct gstreamer_pbutils::Discoverer

pub struct Discoverer(_, _);

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 Discoverer::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 Discoverer::discover_uri_async) and then asks for the discovery to begin (through Discoverer::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::object::ObjectExt

Implementations

impl Discoverer[src]

pub fn new(timeout: ClockTime) -> Result<Discoverer, Error>[src]

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 glib::Error::free.

pub fn discover_uri(&self, uri: &str) -> Result<DiscovererInfo, Error>[src]

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.

pub fn discover_uri_async(&self, uri: &str) -> Result<(), BoolError>[src]

Appends the given uri to the list of URIs to discoverer. The actual discovery of the uri will only take place if Discoverer::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

pub fn start(&self)[src]

Allow asynchronous discovering of URIs to take place. A glib::MainLoop must be available for Discoverer to properly work in asynchronous mode.

pub fn stop(&self)[src]

Stop the discovery of any pending URIs and clears the list of pending URIS (if any).

pub fn get_property_use_cache(&self) -> bool[src]

pub fn set_property_use_cache(&self, use_cache: bool)[src]

pub fn connect_discovered<F: Fn(&Discoverer, &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.

pub fn connect_finished<F: Fn(&Discoverer) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Will be emitted in async mode when all pending URIs have been processed.

pub fn connect_source_setup<F: Fn(&Discoverer, &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

pub fn connect_starting<F: Fn(&Discoverer) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Will be emitted when the discover starts analyzing the pending URIs

pub fn connect_property_use_cache_notify<F: Fn(&Discoverer) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

impl Discoverer[src]

pub fn set_property_timeout(&self, timeout: ClockTime)[src]

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 get_property_timeout(&self) -> ClockTime[src]

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_property_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Trait Implementations

impl Clone for Discoverer[src]

impl Debug for Discoverer[src]

impl Eq for Discoverer[src]

impl Hash for Discoverer[src]

impl Ord for Discoverer[src]

impl<T: ObjectType> PartialEq<T> for Discoverer[src]

impl<T: ObjectType> PartialOrd<T> for Discoverer[src]

impl Send for Discoverer[src]

impl StaticType for Discoverer[src]

impl Sync for Discoverer[src]

Auto Trait Implementations

impl RefUnwindSafe for Discoverer

impl Unpin for Discoverer

impl UnwindSafe for Discoverer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

impl<T> From<T> for T[src]

impl<O> GObjectExtManualGst for O where
    O: IsA<Object>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.