CheeseCameraDevice: Cheese Reference Manual

## CheeseCameraDevice CheeseCameraDevice — Object to represent a video capture device |

## Stability Level

Unstable, unless otherwise indicated

## Functions

CheeseCameraDevice * | cheese_camera_device_new ()
const gchar * | cheese_camera_device_get_name ()
CheeseVideoFormat * | cheese_camera_device_get_best_format ()
GstCaps * | cheese_camera_device_get_caps_for_format ()
GList * | cheese_camera_device_get_format_list ()
GstElement * | cheese_camera_device_get_src ()
GstCaps * | cheese_camera_device_supported_format_caps ()

## Properties

GstDevice * | device | Read / Write / Construct Only
char * | name | Read / Write / Construct Only
char * | path | Read / Write / Construct Only

## Types and Values

| CheeseCameraDevice
| CheeseVideoFormat

## Object Hierarchy

        GBoxed
        ╰── CheeseVideoFormat
        GObject
        ╰── CheeseCameraDevice

## Implemented Interfaces

CheeseCameraDevice implements GInitable.

## Includes

    #include <cheese/cheese-camera-device.h>

## Description

CheeseCameraDevice provides an abstraction of a video capture device.

## Functions

### cheese_camera_device_new ()

    CheeseCameraDevice *
    cheese_camera_device_new (GstDevice *device,
                              GError **error);

Tries to create a new CheeseCameraDevice with the supplied device. If construction fails, `NULL` is returned, and `error` is set.

#### Parameters

device | The GStreamer the device, as supplied by GstDeviceMonitor |
error | a location to store errors |

#### Returns

a new CheeseCameraDevice, or `NULL`

### cheese_camera_device_get_name ()

    const gchar *
    cheese_camera_device_get_name (CheeseCameraDevice *device);

Get a human-readable name for the device, as reported by udev, which is suitable for display to a user.

#### Parameters

device | a CheeseCameraDevice |

#### Returns

the human-readable name of the video capture device.

[transfer none]

### cheese_camera_device_get_best_format ()

    CheeseVideoFormat *
    cheese_camera_device_get_best_format (CheeseCameraDevice *device);

Get the CheeseVideoFormat with the highest resolution with a width greater than 640 pixels and a framerate of greater than 15 FPS for this `device` . If no such format is found, get the highest available resolution instead.

#### Parameters

device | a CheeseCameraDevice |

#### Returns

the highest-resolution supported CheeseVideoFormat.

[transfer full]

### cheese_camera_device_get_caps_for_format ()

    GstCaps *
    cheese_camera_device_get_caps_for_format
                                   (CheeseCameraDevice *device,
                                    CheeseVideoFormat *format);

Get the GstCaps for the given `format` on the `device` .

#### Parameters

device | a CheeseCameraDevice |
format | a CheeseVideoFormat |

#### Returns

the GstCaps for the given `format` .

[transfer full]

### cheese_camera_device_get_format_list ()

    GList *
    cheese_camera_device_get_format_list (CheeseCameraDevice *device);

Get the sorted list of CheeseVideoFormat that the `device` supports.

#### Parameters

device | a CheeseCameraDevice |

#### Returns

list of CheeseVideoFormat.

[element-type Cheese.VideoFormat][transfer container]

### cheese_camera_device_get_src ()

    GstElement *
    cheese_camera_device_get_src (CheeseCameraDevice *device);

Get the source GStreamer element for the `device` .

#### Parameters

device | a CheeseCameraDevice |

#### Returns

the source GStreamer element.

[transfer full]

### cheese_camera_device_supported_format_caps ()

    GstCaps *
    cheese_camera_device_supported_format_caps
                                   (void);

Get the GstCaps that are supported for all CheeseCameraDevice

#### Returns

the GstCaps.

[transfer full]

## Types and Values

### CheeseCameraDevice

    typedef struct _CheeseCameraDevice CheeseCameraDevice;

Use the accessor functions below.

### CheeseVideoFormat

    typedef struct {
      gint width;
      gint height;
    } CheeseVideoFormat;

A description of the resolution, in pixels, of the format to capture with a CheeseCameraDevice.

#### Members

gint `width`; | the width of of the video, in pixels |
gint `height`; | the height of the video, in pixels |

## Property Details

### The `“device”` property

      “device”                   GstDevice *

GStreamer device object of the video capture device.

Owner: CheeseCameraDevice

Flags: Read / Write / Construct Only

### The `“name”` property

      “name”                     char *

Human-readable name of the video capture device, for display to the user.

Owner: CheeseCameraDevice

Flags: Read / Write / Construct Only

Default value: NULL

### The `“path”` property

      “path”                     char *

Path of the video capture device.

Owner: CheeseCameraDevice

Flags: Read / Write / Construct Only

Default value: NULL