Cheese.Camera

g Cheese.Camera Cheese.Camera GObject.Object GObject.Object GObject.Object->Cheese.Camera

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (video_texture, name, x_resolution, y_resolution)

connect_effect_texture (effect, texture)

get_balance_property_range (property)

get_camera_devices ()

get_current_video_format ()

get_recorded_time ()

get_selected_device ()

get_video_formats ()

play ()

set_balance_property (property, value)

set_device (device)

set_effect (effect)

set_video_format (format)

setup (device)

start_video_recording (filename)

stop ()

stop_video_recording ()

switch_camera_device ()

take_photo (filename)

take_photo_pixbuf ()

toggle_effects_pipeline (active)

Virtual Methods

Inherited:

GObject.Object (7)

do_photo_saved ()

do_photo_taken (pixbuf)

do_state_flags_changed (new_state)

do_video_saved ()

Properties

Name

Type

Flags

Short Description

device

Cheese.CameraDevice

r/w

The device object to capture from

format

Cheese.VideoFormat

r/w

The format of the video capture device

num-camera-devices

int

r

The currently number of camera devices available on the system

video-texture

int

r/w

The video texture for the Cheese.Camera to render into

Signals

Inherited:

GObject.Object (1)

Name

Short Description

photo-saved

Emitted when a photo was saved to disk.

photo-taken

Emitted when a photo was taken.

state-flags-changed

Emitted when the state of the camera Gst.Element changed.

video-saved

Emitted when a video was saved to disk.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

unused

object

r

Class Details

class Cheese.Camera(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Cheese.CameraClass

Use the accessor functions below.

classmethod new(video_texture, name, x_resolution, y_resolution)
Parameters:
  • video_texture (Clutter.Actor) – an actor in which to render the video

  • name (str or None) – the name of the device

  • x_resolution (int) – the resolution width

  • y_resolution (int) – the resolution height

Returns:

a new Cheese.Camera

Return type:

Cheese.Camera

Create a new Cheese.Camera object.

connect_effect_texture(effect, texture)
Parameters:

Connect the supplied texture to the self, using effect.

get_balance_property_range(property)
Parameters:

property (str) – name of the balance property

Returns:

True if the operation was successful, False otherwise

min:

minimum value

max:

maximum value

def_:

default value

Return type:

(bool, min: float, max: float, def_: float)

Get the minimum, maximum and default values for the requested property of the self.

get_camera_devices()
Returns:

an array of Cheese.CameraDevice

Return type:

[Cheese.CameraDevice]

Get the list of Cheese.CameraDevice objects, representing active video capture devices on the system.

get_current_video_format()
Returns:

the Cheese.VideoFormat set on the Cheese.Camera

Return type:

Cheese.VideoFormat

Get the Cheese.VideoFormat that is currently set on the self.

get_recorded_time()
Returns:

A string with the time representation.

Return type:

str

Get a string representation of the playing time of the current video recording

get_selected_device()
Returns:

a Cheese.CameraDevice, or None if there is no selected device

Return type:

Cheese.CameraDevice

Get the currently-selected Cheese.CameraDevice of the self.

get_video_formats()
Returns:

a GLib.List of Cheese.VideoFormat, or None if there was no device selected

Return type:

[Cheese.VideoFormat]

Gets the list of Cheese.VideoFormat supported by the selected Cheese.CameraDevice on the self.

play()

Set the state of the GStreamer pipeline associated with the Cheese.Camera to playing.

set_balance_property(property, value)
Parameters:
  • property (str) – name of the balance property

  • value (float) – value to be set

Set the requested property on the self to value.

set_device(device)
Parameters:

device (Cheese.CameraDevice) – the device object

Set the active video capture device of the self.

set_effect(effect)
Parameters:

effect (Cheese.Effect) – a Cheese.Effect

Set the effect on the self.

set_video_format(format)
Parameters:

format (Cheese.VideoFormat) – a Cheese.VideoFormat

Sets a Cheese.VideoFormat on a Cheese.Camera, restarting the video stream if necessary.

setup(device)
Parameters:

device (Cheese.CameraDevice or None) – the video capture device, or None

Raises:

GLib.Error

Setup a video capture device.

start_video_recording(filename)
Parameters:

filename (str) – the name of the video file to where the recording will be saved

Start a video recording with the self and save it to filename.

stop()

Set the state of the GStreamer pipeline associated with the Cheese.Camera to None.

stop_video_recording()

Stop recording video on the self.

switch_camera_device()

Toggle the playing/recording state of the self.

take_photo(filename)
Parameters:

filename (str) – name of the file to save a photo to

Returns:

True on success, False if an error occurred

Return type:

bool

Save a photo taken with the self to a new file at filename.

take_photo_pixbuf()
Returns:

True if the photo was successfully captured, False otherwise

Return type:

bool

Take a photo with the self and emit it in the ::capture-start signal as a GdkPixbuf.Pixbuf.

toggle_effects_pipeline(active)
Parameters:

active (bool) – True if effects pipeline is active, False otherwise

Control whether the effects pipeline is enabled for self.

do_photo_saved() virtual
do_photo_taken(pixbuf) virtual
Parameters:

pixbuf (GdkPixbuf.Pixbuf) –

do_state_flags_changed(new_state) virtual
Parameters:

new_state (Gst.State) –

do_video_saved() virtual

Signal Details

Cheese.Camera.signals.photo_saved(camera)
Signal Name:

photo-saved

Flags:

RUN_LAST, ACTION

Parameters:

camera (Cheese.Camera) – The object which received the signal

Emitted when a photo was saved to disk.

Cheese.Camera.signals.photo_taken(camera, pixbuf)
Signal Name:

photo-taken

Flags:

RUN_LAST, ACTION

Parameters:

Emitted when a photo was taken.

Cheese.Camera.signals.state_flags_changed(camera, state)
Signal Name:

state-flags-changed

Flags:

RUN_LAST, ACTION

Parameters:

Emitted when the state of the camera Gst.Element changed.

Cheese.Camera.signals.video_saved(camera)
Signal Name:

video-saved

Flags:

RUN_LAST, ACTION

Parameters:

camera (Cheese.Camera) – The object which received the signal

Emitted when a video was saved to disk.

Property Details

Cheese.Camera.props.device
Name:

device

Type:

Cheese.CameraDevice

Default Value:

None

Flags:

READABLE, WRITABLE

The device object to capture from.

Cheese.Camera.props.format
Name:

format

Type:

Cheese.VideoFormat

Default Value:

None

Flags:

READABLE, WRITABLE

The format of the video capture device.

Cheese.Camera.props.num_camera_devices
Name:

num-camera-devices

Type:

int

Default Value:

0

Flags:

READABLE

The currently number of camera devices available for being used.

Cheese.Camera.props.video_texture
Name:

video-texture

Type:

int

Default Value:

None

Flags:

READABLE, WRITABLE

The video texture for the Cheese.Camera to render into.