![]() |
![]() |
![]() |
GStreamer 1.0 Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <gst/gst.h> struct GstDeviceProvider; struct GstDeviceProviderClass; gboolean gst_device_provider_can_monitor (GstDeviceProvider *provider
); void gst_device_provider_class_add_metadata (GstDeviceProviderClass *klass
,const gchar *key
,const gchar *value
); void gst_device_provider_class_add_static_metadata (GstDeviceProviderClass *klass
,const gchar *key
,const gchar *value
); const gchar * gst_device_provider_class_get_metadata (GstDeviceProviderClass *klass
,const gchar *key
); void gst_device_provider_class_set_metadata (GstDeviceProviderClass *klass
,const gchar *longname
,const gchar *classification
,const gchar *description
,const gchar *author
); void gst_device_provider_class_set_static_metadata (GstDeviceProviderClass *klass
,const gchar *longname
,const gchar *classification
,const gchar *description
,const gchar *author
); void gst_device_provider_device_add (GstDeviceProvider *provider
,GstDevice *device
); void gst_device_provider_device_remove (GstDeviceProvider *provider
,GstDevice *device
); GstBus * gst_device_provider_get_bus (GstDeviceProvider *provider
); GList * gst_device_provider_get_devices (GstDeviceProvider *provider
); GstDeviceProviderFactory * gst_device_provider_get_factory (GstDeviceProvider *provider
); gboolean gst_device_provider_register (GstPlugin *plugin
,const gchar *name
,guint rank
,GType type
); gboolean gst_device_provider_start (GstDeviceProvider *provider
); void gst_device_provider_stop (GstDeviceProvider *provider
);
A GstDeviceProvider subclass is provided by a plugin that handles devices if there is a way to programatically list connected devices. It can also optionally provide updates to the list of connected devices.
Each GstDeviceProvider subclass is a singleton, a plugin should normally provide a single subclass for all devices.
Applications would normally use a GstDeviceMonitor to monitor devices from all relevant providers.
struct GstDeviceProvider { GstObject parent; /* Protected by the Object lock */ GList *devices; };
The structure of the base GstDeviceProvider
Since 1.4
struct GstDeviceProviderClass { GstObjectClass parent_class; GstDeviceProviderFactory *factory; GList* (*probe) (GstDeviceProvider * provider); gboolean (*start) (GstDeviceProvider * provider); void (*stop) (GstDeviceProvider * provider); };
The structure of the base GstDeviceProviderClass
GstObjectClass |
the parent GstObjectClass structure |
GstDeviceProviderFactory * |
a pointer to the GstDeviceProviderFactory that creates this provider |
Returns a list of devices that are currently available. This should never block. | |
Starts monitoring for new devices. Only subclasses that can know that devices have been added or remove need to implement this method. | |
Stops monitoring for new devices. Only subclasses that implement
the start() method need to implement this method. |
Since 1.4
gboolean gst_device_provider_can_monitor (GstDeviceProvider *provider
);
void gst_device_provider_class_add_metadata (GstDeviceProviderClass *klass
,const gchar *key
,const gchar *value
);
Set key
with value
as metadata in klass
.
|
class to set metadata for |
|
the key to set |
|
the value to set |
Since 1.4
void gst_device_provider_class_add_static_metadata (GstDeviceProviderClass *klass
,const gchar *key
,const gchar *value
);
Set key
with value
as metadata in klass
.
Same as gst_device_provider_class_add_metadata()
, but value
must be a static string
or an inlined string, as it will not be copied. (GStreamer plugins will
be made resident once loaded, so this function can be used even from
dynamically loaded plugins.)
|
class to set metadata for |
|
the key to set |
|
the value to set. [transfer full] |
Since 1.4
const gchar * gst_device_provider_class_get_metadata (GstDeviceProviderClass *klass
,const gchar *key
);
Get metadata with key
in klass
.
|
class to get metadata for |
|
the key to get |
Returns : |
the metadata for key . |
Since 1.4
void gst_device_provider_class_set_metadata (GstDeviceProviderClass *klass
,const gchar *longname
,const gchar *classification
,const gchar *description
,const gchar *author
);
Sets the detailed information for a GstDeviceProviderClass.
|
class to set metadata for |
|
The long English name of the device provider. E.g. "File Sink" |
|
String describing the type of device provider, as an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs for more details and common types. E.g: "Sink/File" |
|
Sentence describing the purpose of the device provider. E.g: "Write stream to a file" |
|
Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>" |
Since 1.4
void gst_device_provider_class_set_static_metadata (GstDeviceProviderClass *klass
,const gchar *longname
,const gchar *classification
,const gchar *description
,const gchar *author
);
Sets the detailed information for a GstDeviceProviderClass.
Same as gst_device_provider_class_set_metadata()
, but longname
, classification
,
description
, and author
must be static strings or inlined strings, as
they will not be copied. (GStreamer plugins will be made resident once
loaded, so this function can be used even from dynamically loaded plugins.)
|
class to set metadata for |
|
The long English name of the element. E.g. "File Sink". [transfer full] |
|
String describing the type of element, as an unordered list separated with slashes ('/'). See draft-klass.txt of the design docs for more details and common types. E.g: "Sink/File". [transfer full] |
|
Sentence describing the purpose of the element. E.g: "Write stream to a file". [transfer full] |
|
Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: "Joe Bloggs <joe.blogs at foo.com>". [transfer full] |
Since 1.4
void gst_device_provider_device_add (GstDeviceProvider *provider
,GstDevice *device
);
Posts a message on the provider's GstBus to inform applications that a new device has been added.
This is for use by subclasses.
|
a GstDeviceProvider |
|
a GstDevice that has been added. [transfer full] |
Since 1.4
void gst_device_provider_device_remove (GstDeviceProvider *provider
,GstDevice *device
);
Posts a message on the provider's GstBus to inform applications that a device has been removed.
This is for use by subclasses.
|
a GstDeviceProvider |
|
a GstDevice that has been removed |
Since 1.4
GstBus * gst_device_provider_get_bus (GstDeviceProvider *provider
);
Gets the GstBus of this GstDeviceProvider
|
a GstDeviceProvider |
Returns : |
a GstBus. [transfer full] |
Since 1.4
GList * gst_device_provider_get_devices (GstDeviceProvider *provider
);
Gets a list of devices that this provider understands. This may actually probe the hardware if the provider is not currently started.
|
A GstDeviceProvider |
Returns : |
a GList of GstDevice. [transfer full][element-type GstDevice] |
Since 1.4
GstDeviceProviderFactory * gst_device_provider_get_factory
(GstDeviceProvider *provider
);
Retrieves the factory that was used to create this device provider.
|
a GstDeviceProvider to request the device provider factory of. |
Returns : |
the GstDeviceProviderFactory used for creating this device provider. no refcounting is needed. [transfer none] |
Since 1.4
gboolean gst_device_provider_register (GstPlugin *plugin
,const gchar *name
,guint rank
,GType type
);
Create a new device providerfactory capable of instantiating objects of the
type
and add the factory to plugin
.
|
GstPlugin to register the device provider with, or NULL for
a static device provider. [allow-none]
|
|
name of device providers of this type |
|
rank of device provider (higher rank means more importance when autoplugging) |
|
GType of device provider to register |
Returns : |
TRUE , if the registering succeeded, FALSE on error |
Since 1.4
gboolean gst_device_provider_start (GstDeviceProvider *provider
);
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 GstDeviceProvider is a singleton,
gst_device_provider_start()
may already have been called by another
user of the object, gst_device_provider_stop()
needs to be called the same
number of times.
|
A GstDeviceProvider |
Returns : |
TRUE if the device providering could be started |
Since 1.4
void gst_device_provider_stop (GstDeviceProvider *provider
);
Decreases the use-count by one. If the use count reaches zero, this
GstDeviceProvider will stop providering the devices. This needs to be
called the same number of times that gst_device_provider_start()
was called.
|
A GstDeviceProvider |
Since 1.4