gi-gst-1.0.18: GStreamer bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Gst.Objects.DeviceProvider

Contents

Description

A DeviceProvider subclass is provided by a plugin that handles devices if there is a way to programmatically list connected devices. It can also optionally provide updates to the list of connected devices.

Each DeviceProvider subclass is a singleton, a plugin should normally provide a single subclass for all devices.

Applications would normally use a DeviceMonitor to monitor devices from all relevant providers.

Since: 1.4

Synopsis

Exported types

newtype DeviceProvider Source #

Memory-managed wrapper type.

class (GObject o, IsDescendantOf DeviceProvider o) => IsDeviceProvider o Source #

Type class for types which can be safely cast to DeviceProvider, for instance with toDeviceProvider.

toDeviceProvider :: (MonadIO m, IsDeviceProvider o) => o -> m DeviceProvider Source #

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

Methods

canMonitor

deviceProviderCanMonitor :: (HasCallStack, MonadIO m, IsDeviceProvider a) => a -> m Bool Source #

No description available in the introspection data.

deviceAdd

deviceProviderDeviceAdd Source #

Arguments

:: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b) 
=> a

provider: a DeviceProvider

-> b

device: a Device that has been added

-> m () 

Posts a message on the provider's Bus to inform applications that a new device has been added.

This is for use by subclasses.

device's reference count will be incremented, and any floating reference will be removed (see gst_object_ref_sink()).

Since: 1.4

deviceChanged

deviceProviderDeviceChanged Source #

Arguments

:: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b, IsDevice c) 
=> a 
-> b

device: the new version of changedDevice

-> c

changedDevice: the old version of the device that has been udpated

-> m () 

This function is used when changedDevice was modified into its new form device. This will post a DEVICE_CHANGED message on the bus to let the application know that the device was modified. Device is immutable for MT. safety purposes so this is an "atomic" way of letting the application know when a device was modified.

Since: 1.16

deviceRemove

deviceProviderDeviceRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsDeviceProvider a, IsDevice b) 
=> a

provider: a DeviceProvider

-> b

device: a Device that has been removed

-> m () 

Posts a message on the provider's Bus to inform applications that a device has been removed.

This is for use by subclasses.

Since: 1.4

getBus

deviceProviderGetBus Source #

Arguments

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

provider: a DeviceProvider

-> m Bus

Returns: a Bus

Gets the Bus of this DeviceProvider

Since: 1.4

getDevices

deviceProviderGetDevices Source #

Arguments

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

provider: A DeviceProvider

-> m [Device]

Returns: a List of Device

Gets a list of devices that this provider understands. This may actually probe the hardware if the provider is not currently started.

Since: 1.4

getFactory

deviceProviderGetFactory Source #

Arguments

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

provider: a DeviceProvider to request the device provider factory of.

-> m DeviceProviderFactory

Returns: the DeviceProviderFactory used for creating this device provider. no refcounting is needed.

Retrieves the factory that was used to create this device provider.

Since: 1.4

getHiddenProviders

deviceProviderGetHiddenProviders Source #

Arguments

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

provider: a DeviceProvider

-> m [Text]

Returns: a list of hidden providers factory names or Nothing when nothing is hidden by provider. Free with g_strfreev.

Get the provider factory names of the DeviceProvider instances that are hidden by provider.

Since: 1.6

getMetadata

deviceProviderGetMetadata Source #

Arguments

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

provider: provider to get metadata for

-> Text

key: the key to get

-> m Text

Returns: the metadata for key.

Get metadata with key in provider.

Since: 1.14

hideProvider

deviceProviderHideProvider Source #

Arguments

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

provider: a DeviceProvider

-> Text

name: a provider factory name

-> m () 

Make provider hide the devices from the factory with name.

This function is used when provider will also provide the devices reported by provider factory name. A monitor should stop monitoring the device provider with name to avoid duplicate devices.

Since: 1.6

register

deviceProviderRegister Source #

Arguments

:: (HasCallStack, MonadIO m, IsPlugin a) 
=> Maybe a

plugin: Plugin to register the device provider with, or Nothing for a static device provider.

-> Text

name: name of device providers of this type

-> Word32

rank: rank of device provider (higher rank means more importance when autoplugging)

-> GType

type: GType of device provider to register

-> m Bool

Returns: True, if the registering succeeded, False on error

Create a new device providerfactory capable of instantiating objects of the type and add the factory to plugin.

Since: 1.4

start

deviceProviderStart Source #

Arguments

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

provider: A DeviceProvider

-> m Bool

Returns: True if the device providering could be started

Starts providering the devices. This will cause GST_MESSAGE_DEVICE_ADDED and GST_MESSAGE_DEVICE_REMOVED messages to be posted on the provider's bus when devices are added or removed from the system.

Since the DeviceProvider is a singleton, deviceProviderStart may already have been called by another user of the object, deviceProviderStop needs to be called the same number of times.

Since: 1.4

stop

deviceProviderStop Source #

Arguments

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

provider: A DeviceProvider

-> m () 

Decreases the use-count by one. If the use count reaches zero, this DeviceProvider will stop providering the devices. This needs to be called the same number of times that deviceProviderStart was called.

Since: 1.4

unhideProvider

deviceProviderUnhideProvider Source #

Arguments

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

provider: a DeviceProvider

-> Text

name: a provider factory name

-> m () 

Make provider unhide the devices from factory name.

This function is used when provider will no longer provide the devices reported by provider factory name. A monitor should start monitoring the devices from provider factory name in order to see all devices again.

Since: 1.6

Signals

providerHidden

type C_DeviceProviderProviderHiddenCallback = Ptr () -> CString -> Ptr () -> IO () Source #

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

type DeviceProviderProviderHiddenCallback = Text -> IO () Source #

No description available in the introspection data.

afterDeviceProviderProviderHidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderHiddenCallback -> m SignalHandlerId Source #

Connect a signal handler for the “provider-hidden” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after deviceProvider #providerHidden callback

onDeviceProviderProviderHidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderHiddenCallback -> m SignalHandlerId Source #

Connect a signal handler for the “provider-hidden” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on deviceProvider #providerHidden callback

providerUnhidden

type C_DeviceProviderProviderUnhiddenCallback = Ptr () -> CString -> Ptr () -> IO () Source #

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

type DeviceProviderProviderUnhiddenCallback = Text -> IO () Source #

No description available in the introspection data.

afterDeviceProviderProviderUnhidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderUnhiddenCallback -> m SignalHandlerId Source #

Connect a signal handler for the “provider-unhidden” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after deviceProvider #providerUnhidden callback

onDeviceProviderProviderUnhidden :: (IsDeviceProvider a, MonadIO m) => a -> DeviceProviderProviderUnhiddenCallback -> m SignalHandlerId Source #

Connect a signal handler for the “provider-unhidden” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on deviceProvider #providerUnhidden callback