gi-gstpbutils-1.0.12: GStreamer Plugins Base Utils bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GstPbutils.Objects.Discoverer

Contents

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

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

data DiscovererStartMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsDiscoverer a) => MethodInfo * DiscovererStartMethodInfo a signature Source # 

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

data DiscovererStopMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsDiscoverer a) => MethodInfo * DiscovererStopMethodInfo a signature Source # 

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

data DiscovererTimeoutPropertyInfo Source #

Instances

AttrInfo DiscovererTimeoutPropertyInfo Source # 
type AttrOrigin DiscovererTimeoutPropertyInfo Source # 
type AttrLabel DiscovererTimeoutPropertyInfo Source # 
type AttrGetType DiscovererTimeoutPropertyInfo Source # 
type AttrBaseTypeConstraint DiscovererTimeoutPropertyInfo Source # 
type AttrSetTypeConstraint DiscovererTimeoutPropertyInfo Source # 
type AttrAllowedOps DiscovererTimeoutPropertyInfo Source # 

Signals

discovered

finished

sourceSetup

starting