gi-gstpbutils-1.0.28: GStreamer Plugins Base Utils bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GstPbutils.Objects.Discoverer

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 discovererDiscoverUri with the URI one wishes to discover.

The non-blocking mode requires a running MainLoop iterating a MainContext, where one connects to the various signals, appends the URIs to be processed (through discovererDiscoverUriAsync) and then asks for the discovery to begin (through discovererStart). By default this will use the GLib default main context unless you have set a custom context using mainContextPushThreadDefault.

All the information is returned in a DiscovererInfo structure.

Synopsis

Exported types

newtype Discoverer Source #

Memory-managed wrapper type.

Constructors

Discoverer (ManagedPtr Discoverer) 

Instances

Instances details
Eq Discoverer Source # 
Instance details

Defined in GI.GstPbutils.Objects.Discoverer

GObject Discoverer Source # 
Instance details

Defined in GI.GstPbutils.Objects.Discoverer

ManagedPtrNewtype Discoverer Source # 
Instance details

Defined in GI.GstPbutils.Objects.Discoverer

Methods

toManagedPtr :: Discoverer -> ManagedPtr Discoverer

TypedObject Discoverer Source # 
Instance details

Defined in GI.GstPbutils.Objects.Discoverer

Methods

glibType :: IO GType

HasParentTypes Discoverer Source # 
Instance details

Defined in GI.GstPbutils.Objects.Discoverer

IsGValue (Maybe Discoverer) Source #

Convert Discoverer to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GstPbutils.Objects.Discoverer

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Discoverer -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Discoverer)

type ParentTypes Discoverer Source # 
Instance details

Defined in GI.GstPbutils.Objects.Discoverer

type ParentTypes Discoverer = '[Object]

class (GObject o, IsDescendantOf Discoverer o) => IsDiscoverer o Source #

Type class for types which can be safely cast to Discoverer, for instance with toDiscoverer.

Instances

Instances details
(GObject o, IsDescendantOf Discoverer o) => IsDiscoverer o Source # 
Instance details

Defined in GI.GstPbutils.Objects.Discoverer

toDiscoverer :: (MonadIO m, IsDiscoverer o) => o -> m Discoverer Source #

Cast to Discoverer, for types for which this is known to be safe. For general casts, use castTo.

Methods

discoverUri

discovererDiscoverUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsDiscoverer a) 
=> a

discoverer: A Discoverer

-> Text

uri: The URI to run on.

-> m DiscovererInfo

Returns: the result of the scanning. Can be Nothing if an error occurred. (Can throw GError)

Synchronously discovers the given uri.

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

discoverUriAsync

discovererDiscoverUriAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsDiscoverer a) 
=> a

discoverer: A Discoverer

-> Text

uri: the URI to add.

-> m Bool

Returns: True if the uri was successfully appended to the list of pending uris, else False

Appends the given uri to the list of URIs to discoverer. The actual discovery of the uri will only take place if discovererStart has been called.

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

new

discovererNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word64

timeout: timeout per file, in nanoseconds. Allowed are values between one second (SECOND) and one hour (3600 * SECOND)

-> m Discoverer

Returns: The new Discoverer. If an error occurred when creating the discoverer, err will be set accordingly and Nothing will be returned. If err is set, the caller must free it when no longer needed using errorFree. (Can throw GError)

Creates a new Discoverer with the provided timeout.

start

discovererStart Source #

Arguments

:: (HasCallStack, MonadIO m, IsDiscoverer a) 
=> a

discoverer: A Discoverer

-> m () 

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

stop

discovererStop Source #

Arguments

:: (HasCallStack, MonadIO m, IsDiscoverer a) 
=> a

discoverer: A Discoverer

-> m () 

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

Properties

timeout

The duration (in nanoseconds) after which the discovery of an individual URI will timeout.

If the discovery of a URI times out, the DiscovererResultTimeout will be set on the result flags.

constructDiscovererTimeout :: (IsDiscoverer o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “timeout” property. This is rarely needed directly, but it is used by new.

getDiscovererTimeout :: (MonadIO m, IsDiscoverer o) => o -> m Word64 Source #

Get the value of the “timeout” property. When overloading is enabled, this is equivalent to

get discoverer #timeout

setDiscovererTimeout :: (MonadIO m, IsDiscoverer o) => o -> Word64 -> m () Source #

Set the value of the “timeout” property. When overloading is enabled, this is equivalent to

set discoverer [ #timeout := value ]

useCache

No description available in the introspection data.

constructDiscovererUseCache :: (IsDiscoverer o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “use-cache” property. This is rarely needed directly, but it is used by new.

getDiscovererUseCache :: (MonadIO m, IsDiscoverer o) => o -> m Bool Source #

Get the value of the “use-cache” property. When overloading is enabled, this is equivalent to

get discoverer #useCache

setDiscovererUseCache :: (MonadIO m, IsDiscoverer o) => o -> Bool -> m () Source #

Set the value of the “use-cache” property. When overloading is enabled, this is equivalent to

set discoverer [ #useCache := value ]

Signals

discovered

type DiscovererDiscoveredCallback Source #

Arguments

 = DiscovererInfo

info: the results DiscovererInfo

-> Maybe GError

error: GError, which will be non-NULL if an error occurred during discovery. You must not free this GError, it will be freed by the discoverer.

-> IO () 

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.

afterDiscovererDiscovered :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererDiscoveredCallback) -> m SignalHandlerId Source #

Connect a signal handler for the discovered signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after discoverer #discovered callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onDiscovererDiscovered :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererDiscoveredCallback) -> m SignalHandlerId Source #

Connect a signal handler for the discovered signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on discoverer #discovered callback

finished

type DiscovererFinishedCallback = IO () Source #

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

afterDiscovererFinished :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererFinishedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the finished signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after discoverer #finished callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onDiscovererFinished :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererFinishedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the finished signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on discoverer #finished callback

loadSerializedInfo

type DiscovererLoadSerializedInfoCallback Source #

Arguments

 = Text

uri: THe URI to load the serialized info for

-> IO (Maybe DiscovererInfo)

Returns: The DiscovererInfo representing uri, or Nothing if no information

Retrieves information about a URI from and external source of information, like a cache file. This is used by the discoverer to speed up the discovery.

Since: 1.24

afterDiscovererLoadSerializedInfo :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererLoadSerializedInfoCallback) -> m SignalHandlerId Source #

Connect a signal handler for the loadSerializedInfo signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after discoverer #loadSerializedInfo callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onDiscovererLoadSerializedInfo :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererLoadSerializedInfoCallback) -> m SignalHandlerId Source #

Connect a signal handler for the loadSerializedInfo signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on discoverer #loadSerializedInfo callback

sourceSetup

type DiscovererSourceSetupCallback Source #

Arguments

 = Element

source: source element

-> IO () 

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.

afterDiscovererSourceSetup :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererSourceSetupCallback) -> m SignalHandlerId Source #

Connect a signal handler for the sourceSetup signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after discoverer #sourceSetup callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onDiscovererSourceSetup :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererSourceSetupCallback) -> m SignalHandlerId Source #

Connect a signal handler for the sourceSetup signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on discoverer #sourceSetup callback

starting

type DiscovererStartingCallback = IO () Source #

Will be emitted when the discover starts analyzing the pending URIs

afterDiscovererStarting :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererStartingCallback) -> m SignalHandlerId Source #

Connect a signal handler for the starting signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after discoverer #starting callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onDiscovererStarting :: (IsDiscoverer a, MonadIO m) => a -> ((?self :: a) => DiscovererStartingCallback) -> m SignalHandlerId Source #

Connect a signal handler for the starting signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on discoverer #starting callback