![]() |
![]() |
![]() |
Cheese Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
CheeseCameraCheeseCamera — A representation of the video capture device inside CheeseWidget |
#include <cheese/cheese-camera.h> struct CheeseCameraClass; CheeseCamera; CheeseCamera * cheese_camera_new (ClutterTexture *video_texture
,const gchar *camera_device_node
,gint x_resolution
,gint y_resolution
); GPtrArray * cheese_camera_get_camera_devices (CheeseCamera *camera
); const CheeseVideoFormat * cheese_camera_get_current_video_format (CheeseCamera *camera
); GList * cheese_camera_get_video_formats (CheeseCamera *camera
); void cheese_camera_set_video_format (CheeseCamera *camera
,CheeseVideoFormat *format
); CheeseCameraDevice * cheese_camera_get_selected_device (CheeseCamera *camera
); void cheese_camera_set_device_by_device_node (CheeseCamera *camera
,const gchar *file
); void cheese_camera_set_effect (CheeseCamera *camera
,CheeseEffect *effect
); gboolean cheese_camera_get_balance_property_range (CheeseCamera *camera
,const gchar *property
,gdouble *min
,gdouble *max
,gdouble *def
); void cheese_camera_set_balance_property (CheeseCamera *camera
,const gchar *property
,gdouble value
); gchar * cheese_camera_get_recorded_time (CheeseCamera *camera
); void cheese_camera_connect_effect_texture (CheeseCamera *camera
,CheeseEffect *effect
,ClutterTexture *texture
); void cheese_camera_play (CheeseCamera *camera
); void cheese_camera_stop (CheeseCamera *camera
); void cheese_camera_start_video_recording (CheeseCamera *camera
,const gchar *filename
); void cheese_camera_stop_video_recording (CheeseCamera *camera
); void cheese_camera_switch_camera_device (CheeseCamera *camera
); gboolean cheese_camera_take_photo (CheeseCamera *camera
,const gchar *filename
); gboolean cheese_camera_take_photo_pixbuf (CheeseCamera *camera
); void cheese_camera_toggle_effects_pipeline (CheeseCamera *camera
,gboolean active
); enum CheeseCameraError; void cheese_camera_setup (CheeseCamera *camera
,const gchar *uuid
,GError **error
);
"device-node" gchar* : Read / Write "format" CheeseVideoFormat* : Read / Write "num-camera-devices" guint : Read "video-texture" gpointer : Read / Write
"photo-saved" :Action
"photo-taken" :Action
"state-flags-changed" :Action
"video-saved" :Action
struct CheeseCameraClass { void (*photo_saved)(CheeseCamera *camera); void (*photo_taken)(CheeseCamera *camera, GdkPixbuf *pixbuf); void (*video_saved)(CheeseCamera *camera); void (*state_flags_changed)(CheeseCamera *camera, GstState new_state); };
Class for CheeseCamera.
invoked when a photo was saved to disk | |
invoked when a photo was taken | |
invoked when a video was saved to disk | |
invoked when the state of the camera GstElement changed |
CheeseCamera * cheese_camera_new (ClutterTexture *video_texture
,const gchar *camera_device_node
,gint x_resolution
,gint y_resolution
);
Create a new CheeseCamera object.
|
a ClutterTexture |
|
the device node path. [allow-none] |
|
the resolution width |
|
the resolution height |
Returns : |
a new CheeseCamera |
GPtrArray * cheese_camera_get_camera_devices (CheeseCamera *camera
);
Get the list of CheeseCameraDevice objects, representing active video capture devices on the system.
|
a CheeseCamera |
Returns : |
an array of CheeseCameraDevice. [element-type Cheese.CameraDevice][transfer container] |
const CheeseVideoFormat * cheese_camera_get_current_video_format
(CheeseCamera *camera
);
Get the CheeseVideoFormat that is currently set on the camera
.
|
a CheeseCamera |
Returns : |
the CheeseVideoFormat set on the CheeseCamera. [transfer none] |
GList * cheese_camera_get_video_formats (CheeseCamera *camera
);
Gets the list of CheeseVideoFormat supported by the selected
CheeseCameraDevice on the camera
.
|
a CheeseCamera |
Returns : |
a GList of
CheeseVideoFormat, or NULL if there was no device selected. [element-type Cheese.VideoFormat][transfer container]
|
void cheese_camera_set_video_format (CheeseCamera *camera
,CheeseVideoFormat *format
);
Sets a CheeseVideoFormat on a CheeseCamera, restarting the video stream if necessary.
|
a CheeseCamera |
|
a CheeseVideoFormat |
CheeseCameraDevice * cheese_camera_get_selected_device (CheeseCamera *camera
);
Get the currently-selected CheeseCameraDevice of the camera
.
|
a CheeseCamera |
Returns : |
a CheeseCameraDevice, or NULL if there is no
selected device. [transfer none]
|
void cheese_camera_set_device_by_device_node (CheeseCamera *camera
,const gchar *file
);
Set the active video capture device of the camera
, matching by device node
path.
|
a CheeseCamera |
|
the device node path. [type filename] |
void cheese_camera_set_effect (CheeseCamera *camera
,CheeseEffect *effect
);
Set the effect
on the camera
.
|
a CheeseCamera |
|
a CheeseEffect |
gboolean cheese_camera_get_balance_property_range (CheeseCamera *camera
,const gchar *property
,gdouble *min
,gdouble *max
,gdouble *def
);
Get the minimum, maximum and default values for the requested property
of
the camera
.
|
a CheeseCamera |
|
name of the balance property |
|
minimum value. [out] |
|
maximum value. [out] |
|
default value. [out] |
Returns : |
TRUE if the operation was successful, FALSE otherwise |
void cheese_camera_set_balance_property (CheeseCamera *camera
,const gchar *property
,gdouble value
);
Set the requested property
on the camera
to value
.
|
A CheeseCamera |
|
name of the balance property |
|
value to be set |
gchar * cheese_camera_get_recorded_time (CheeseCamera *camera
);
Get a string representation of the playing time of the current video recording
|
A CheeseCamera |
Returns : |
A string with the time representation. |
void cheese_camera_connect_effect_texture (CheeseCamera *camera
,CheeseEffect *effect
,ClutterTexture *texture
);
Connect the supplied texture
to the camera
, using effect
.
|
a CheeseCamera |
|
a CheeseEffect |
|
a ClutterTexture |
void cheese_camera_play (CheeseCamera *camera
);
Set the state of the GStreamer pipeline associated with the CheeseCamera to playing.
|
a CheeseCamera |
void cheese_camera_stop (CheeseCamera *camera
);
Set the state of the GStreamer pipeline associated with the CheeseCamera to NULL.
|
a CheeseCamera |
void cheese_camera_start_video_recording (CheeseCamera *camera
,const gchar *filename
);
Start a video recording with the camera
and save it to filename
.
|
a CheeseCamera |
|
the name of the video file to where the recording will be saved. [type filename] |
void cheese_camera_stop_video_recording (CheeseCamera *camera
);
Stop recording video on the camera
.
|
a CheeseCamera |
void cheese_camera_switch_camera_device (CheeseCamera *camera
);
Toggle the playing/recording state of the camera
.
|
a CheeseCamera |
gboolean cheese_camera_take_photo (CheeseCamera *camera
,const gchar *filename
);
Save a photo taken with the camera
to a new file at filename
.
|
a CheeseCamera |
|
name of the file to save a photo to. [type filename] |
Returns : |
TRUE on success, FALSE if an error occurred |
gboolean cheese_camera_take_photo_pixbuf (CheeseCamera *camera
);
Take a photo with the camera
and emit it in the ::capture-start signal as a
GdkPixbuf.
|
a CheeseCamera |
Returns : |
TRUE if the photo was successfully captured, FALSE otherwise |
void cheese_camera_toggle_effects_pipeline (CheeseCamera *camera
,gboolean active
);
Control whether the effects pipeline is enabled for camera
.
|
a CheeseCamera |
|
TRUE if effects pipeline is active, FALSE otherwise |
typedef enum { CHEESE_CAMERA_ERROR_UNKNOWN, CHEESE_CAMERA_ERROR_ELEMENT_NOT_FOUND, CHEESE_CAMERA_ERROR_NO_DEVICE } CheeseCameraError;
Errors that can occur during camera setup, when calling
cheese_camera_setup()
.
unknown error | |
a required GStreamer element was not found | |
a CheeseCameraDevice was not found |
void cheese_camera_setup (CheeseCamera *camera
,const gchar *uuid
,GError **error
);
Setup a video capture device.
|
a CheeseCamera |
|
UUID of the video capture device, or NULL . [allow-none]
|
|
return location for a GError, or NULL
|
"device-node"
property"device-node" gchar* : Read / Write
The path to the device node for the video capture device.
Default value: ""
"format"
property"format" CheeseVideoFormat* : Read / Write
The format of the video capture device.
"num-camera-devices"
property"num-camera-devices" guint : Read
The currently number of camera devices available for being used.
Allowed values: <= 255
Default value: 0
"video-texture"
property"video-texture" gpointer : Read / Write
The video texture for the CheeseCamera to render into.
"photo-saved"
signalvoid user_function (CheeseCamera *camera,
gpointer user_data) : Action
Emitted when a photo was saved to disk.
|
a CheeseCamera |
|
user data set when the signal handler was connected. |
"photo-taken"
signalvoid user_function (CheeseCamera *camera,
GdkPixbuf *arg1,
gpointer user_data) : Action
Emitted when a photo was taken.
|
a CheeseCamera |
|
user data set when the signal handler was connected. |
"state-flags-changed"
signalvoid user_function (CheeseCamera *camera,
gint arg1,
gpointer user_data) : Action
Emitted when the state of the camera
GstElement changed.
|
a CheeseCamera |
|
user data set when the signal handler was connected. |
"video-saved"
signalvoid user_function (CheeseCamera *camera,
gpointer user_data) : Action
Emitted when a video was saved to disk.
|
a CheeseCamera |
|
user data set when the signal handler was connected. |