GStreamer 1.0 Core Reference Manual: GstDevice

## GstDevice GstDevice |

## Functions

#define | GST_DEVICE()
#define | GST_DEVICE_CAST()
#define | GST_DEVICE_CLASS()
#define | GST_DEVICE_GET_CLASS()
#define | GST_IS_DEVICE()
#define | GST_IS_DEVICE_CLASS()
#define | GST_TYPE_DEVICE
GstElement * | gst_device_create_element ()
GstCaps * | gst_device_get_caps ()
gchar * | gst_device_get_display_name ()
gchar * | gst_device_get_klass ()
GType | gst_device_get_type ()
gboolean | gst_device_has_classes ()
gboolean | gst_device_has_classesv ()
gboolean | gst_device_reconfigure_element ()

## Types and Values

struct | GstDevice
struct | GstDeviceClass

## Object Hierarchy

## Includes

    #include <gst/gst.h>

## Description

## Functions

### GST_DEVICE()

    #define GST_DEVICE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEVICE, GstDevice))

### GST_DEVICE_CAST()

    #define GST_DEVICE_CAST(obj)            ((GstDevice *)(obj))

### GST_DEVICE_CLASS()

    #define GST_DEVICE_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstDeviceClass))

### GST_DEVICE_GET_CLASS()

    #define GST_DEVICE_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEVICE, GstDeviceClass))

### GST_IS_DEVICE()

    #define GST_IS_DEVICE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEVICE))

### GST_IS_DEVICE_CLASS()

    #define GST_IS_DEVICE_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEVICE))

### GST_TYPE_DEVICE

    #define GST_TYPE_DEVICE                 (gst_device_get_type())

### gst_device_create_element ()

    GstElement *
    gst_device_create_element (GstDevice *device,
                               const gchar *name);

#### Parameters

device | a GstDevice |
name | 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

### gst_device_get_caps ()

    GstCaps *
    gst_device_get_caps (GstDevice *device);

Getter for the GstCaps that this device supports.

#### Parameters

device | a GstDevice |

#### Returns

The GstCaps supported by this device. Unref with `gst_caps_unref()` when done.

Since 1.4

### gst_device_get_display_name ()

    gchar *
    gst_device_get_display_name (GstDevice *device);

Gets the user-friendly name of the device.

#### Parameters

device | a GstDevice |

#### Returns

The device name. Free with `g_free()` after use.

Since 1.4

### gst_device_get_klass ()

    gchar *
    gst_device_get_klass (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 GstDeviceMonitor that produced this device.

#### Parameters

device | a GstDevice |

#### Returns

The device class. Free with `g_free()` after use.

Since 1.4

### gst_device_get_type ()

    GType
    gst_device_get_type (void);

### gst_device_has_classes ()

    gboolean
    gst_device_has_classes (GstDevice *device,
                            const gchar *classes);

Check if `device` matches all of the given classes

#### Parameters

device | a GstDevice |
classes | a "/" separate list of klasses to match, only match if all classes are matched |

#### Returns

`TRUE` if `device` matches.

Since 1.4

### gst_device_has_classesv ()

    gboolean
    gst_device_has_classesv (GstDevice *device,
                             gchar **classes);

Check if `factory` matches all of the given classes

#### Parameters

device | a GstDevice |
classes | a `NULL` terminated array of klasses to match, only match if all classes are matched |

#### Returns

`TRUE` if `device` matches.

Since 1.4

### gst_device_reconfigure_element ()

    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.

#### Parameters

device | a GstDevice |
element | a GstElement |

#### Returns

`TRUE` if the element could be reconfigured to use this device, `FALSE` otherwise.

Since 1.4

## Types and Values

### struct GstDevice

    struct GstDevice {
      GstObject         parent;
    };

### struct GstDeviceClass

    struct GstDeviceClass {
      GstObjectClass    parent_class;

      GstElement * (*create_element) (GstDevice * device, const gchar * name);
      gboolean (*reconfigure_element) (GstDevice * device, GstElement * element);
    };