![]() |
![]() |
![]() |
GStreamer 1.0 Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <gst/gst.h> struct GstDevice; struct GstDeviceClass; GstElement * gst_device_create_element (GstDevice *device
,const gchar *name
); GstCaps * gst_device_get_caps (GstDevice *device
); gchar * gst_device_get_device_class (GstDevice *device
); gchar * gst_device_get_display_name (GstDevice *device
); gboolean gst_device_has_classes (GstDevice *device
,const gchar *classes
); gboolean gst_device_has_classesv (GstDevice *device
,gchar **classes
); gboolean gst_device_reconfigure_element (GstDevice *device
,GstElement *element
); GstStructure * gst_device_get_properties (GstDevice *device
);
GstDevice are objects representing a device, they contain relevant metadata about the device, such as its class and the GstCaps representing the media types it can produce or handle.
GstDevice are created by GstDeviceProvider objects which can be aggregated by GstDeviceMonitor objects.
struct GstDeviceClass { GstObjectClass parent_class; GstElement * (*create_element) (GstDevice * device, const gchar * name); gboolean (*reconfigure_element) (GstDevice * device, GstElement * element); };
The class structure for a GstDevice object.
GstObjectClass |
The parent GstObjectClass strucuture. |
Creates the fully configured element to access this device. Subclasses need to override this and return a new element. | |
This only needs to be implemented by subclasses if the
element can be reconfigured to use a different device. See the documentation
for gst_device_reconfigure_element() . |
Since 1.4
GstElement * gst_device_create_element (GstDevice *device
,const gchar *name
);
Creates the element with all of the required parameters set to use this device.
|
a GstDevice |
|
name of new element, or NULL to automatically
create a unique name. [allow-none]
|
Returns : |
a new GstElement configured to use this device. [transfer full] |
Since 1.4
GstCaps * gst_device_get_caps (GstDevice *device
);
Getter for the GstCaps that this device supports.
|
a GstDevice |
Returns : |
The GstCaps supported by this device. Unref with
gst_caps_unref() when done. |
Since 1.4
gchar * gst_device_get_device_class (GstDevice *device
);
Gets the "class" of a device. This is a "/" separated list of classes that represent this device. They are a subset of the classes of the GstDeviceProvider that produced this device.
|
a GstDevice |
Returns : |
The device class. Free with g_free() after use. |
Since 1.4
gchar * gst_device_get_display_name (GstDevice *device
);
Gets the user-friendly name of the device.
|
a GstDevice |
Returns : |
The device name. Free with g_free() after use. |
Since 1.4
gboolean gst_device_has_classes (GstDevice *device
,const gchar *classes
);
Check if device
matches all of the given classes
|
a GstDevice |
|
a "/"-separated list of device classes to match, only match if all classes are matched |
Returns : |
TRUE if device matches. |
Since 1.4
gboolean gst_device_has_classesv (GstDevice *device
,gchar **classes
);
Check if factory
matches all of the given classes
|
a GstDevice |
|
a NULL terminated array of classes
to match, only match if all classes are matched. [array zero-terminated=1]
|
Returns : |
TRUE if device matches. |
Since 1.4
gboolean gst_device_reconfigure_element (GstDevice *device
,GstElement *element
);
Tries to reconfigure an existing element to use the device. If this
function fails, then one must destroy the element and create a new one
using gst_device_create_element()
.
Note: This should only be implemented for elements can change their device in the PLAYING state.
|
a GstDevice |
|
a GstElement |
Returns : |
TRUE if the element could be reconfigured to use this device,
FALSE otherwise. |
Since 1.4
GstStructure * gst_device_get_properties (GstDevice *device
);
Gets the extra properties of a device.
|
a GstDevice |
Returns : |
The extra properties or NULL when there are none.
Free with gst_structure_free() after use. |
Since 1.6