CheeseCameraDevice

CheeseCameraDevice — Object to represent a video capture device

Stability Level

Unstable, unless otherwise indicated

Synopsis

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

                    CheeseCameraDevice;
struct              CheeseVideoFormat;
CheeseCameraDevice * cheese_camera_device_new           (const gchar *uuid,
                                                         const gchar *device_node,
                                                         const gchar *name,
                                                         guint v4l_api_version,
                                                         GError **error);
const gchar *       cheese_camera_device_get_name       (CheeseCameraDevice *device);
const gchar *       cheese_camera_device_get_uuid       (CheeseCameraDevice *device);
const gchar *       cheese_camera_device_get_device_node
                                                        (CheeseCameraDevice *device);
CheeseVideoFormat * cheese_camera_device_get_best_format
                                                        (CheeseCameraDevice *device);
GstCaps *           cheese_camera_device_get_caps_for_format
                                                        (CheeseCameraDevice *device,
                                                         CheeseVideoFormat *format);
GList *             cheese_camera_device_get_format_list
                                                        (CheeseCameraDevice *device);
const gchar *       cheese_camera_device_get_src        (CheeseCameraDevice *device);

Object Hierarchy

  GObject
   +----CheeseCameraDevice
  GBoxed
   +----CheeseVideoFormat

Implemented Interfaces

CheeseCameraDevice implements GInitable.

Properties

  "device-node"              gchar*                : Read / Write / Construct Only
  "name"                     gchar*                : Read / Write / Construct Only
  "uuid"                     gchar*                : Read / Write / Construct Only
  "v4l-api-version"          guint                 : Read / Write / Construct Only

Description

CheeseCameraDevice provides an abstraction of a video capture device.

Details

CheeseCameraDevice

typedef struct _CheeseCameraDevice CheeseCameraDevice;

Use the accessor functions below.


struct CheeseVideoFormat

struct CheeseVideoFormat {
  gint width;
  gint height;
};

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

gint width;

the width of of the video, in pixels

gint height;

the height of the video, in pixels

cheese_camera_device_new ()

CheeseCameraDevice * cheese_camera_device_new           (const gchar *uuid,
                                                         const gchar *device_node,
                                                         const gchar *name,
                                                         guint v4l_api_version,
                                                         GError **error);

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

uuid :

UUID of the device, as supplied by udev

device_node :

path to the device node of the video capture device. [type filename]

name :

human-readable name of the device, as supplied by udev

v4l_api_version :

version of the Video4Linux API that the device uses. Currently either 1 or 2

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.

device :

a CheeseCameraDevice

Returns :

the human-readable name of the video capture device. [transfer none]

cheese_camera_device_get_uuid ()

const gchar *       cheese_camera_device_get_uuid       (CheeseCameraDevice *device);

Get the UUID of the device, as reported by udev.

device :

a CheeseCameraDevice

Returns :

the UUID of the video capture device. [transfer none]

cheese_camera_device_get_device_node ()

const gchar *       cheese_camera_device_get_device_node
                                                        (CheeseCameraDevice *device);

Get the path to the device node associated with the device.

device :

a CheeseCameraDevice

Returns :

the path to the device node 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 rsolution for this device.

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.

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.

device :

a CheeseCameraDevice

Returns :

list of CheeseVideoFormat. [element-type Cheese.VideoFormat][transfer container]

cheese_camera_device_get_src ()

const gchar *       cheese_camera_device_get_src        (CheeseCameraDevice *device);

Get the name of the source GStreamer element for the device. Currently, this will be either v4lsrc or v4l2src, depending on the version of the Video4Linux API that the device supports.

device :

a CheeseCameraDevice

Returns :

the name of the source GStreamer element. [transfer none]

Property Details

The "device-node" property

  "device-node"              gchar*                : Read / Write / Construct Only

Path to the device node of the video capture device.

Default value: NULL


The "name" property

  "name"                     gchar*                : Read / Write / Construct Only

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

Default value: NULL


The "uuid" property

  "uuid"                     gchar*                : Read / Write / Construct Only

UUID of the video capture device.

Default value: NULL


The "v4l-api-version" property

  "v4l-api-version"          guint                 : Read / Write / Construct Only

Version of the Video4Linux API that the device supports. Currently, either 1 or 2 are supported.

Allowed values: [1,2]

Default value: 2