gi-gstpbutils-1.0.22: GStreamer Plugins Base Utils bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
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

Methods

(==) :: Discoverer -> Discoverer -> Bool

(/=) :: Discoverer -> Discoverer -> Bool

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

IsGValue Discoverer Source #

Convert Discoverer to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.GstPbutils.Objects.Discoverer

Methods

toGValue :: Discoverer -> IO GValue

fromGValue :: GValue -> IO Discoverer

HasParentTypes Discoverer Source # 
Instance details

Defined in GI.GstPbutils.Objects.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

Overloaded 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 C_DiscovererDiscoveredCallback = Ptr () -> Ptr DiscovererInfo -> Ptr GError -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

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

onDiscovererDiscovered :: (IsDiscoverer a, MonadIO m) => 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 C_DiscovererFinishedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DiscovererFinishedCallback = IO () Source #

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

afterDiscovererFinished :: (IsDiscoverer a, MonadIO m) => 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

mk_DiscovererFinishedCallback :: C_DiscovererFinishedCallback -> IO (FunPtr C_DiscovererFinishedCallback) Source #

Generate a function pointer callable from C code, from a C_DiscovererFinishedCallback.

onDiscovererFinished :: (IsDiscoverer a, MonadIO m) => 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

sourceSetup

type C_DiscovererSourceSetupCallback = Ptr () -> Ptr Element -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

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

onDiscovererSourceSetup :: (IsDiscoverer a, MonadIO m) => 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 C_DiscovererStartingCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DiscovererStartingCallback = IO () Source #

Will be emitted when the discover starts analyzing the pending URIs

afterDiscovererStarting :: (IsDiscoverer a, MonadIO m) => 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

mk_DiscovererStartingCallback :: C_DiscovererStartingCallback -> IO (FunPtr C_DiscovererStartingCallback) Source #

Generate a function pointer callable from C code, from a C_DiscovererStartingCallback.

onDiscovererStarting :: (IsDiscoverer a, MonadIO m) => 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