## CinnamonRecorder

CinnamonRecorder

## Functions

CinnamonRecorder * | cinnamon_recorder_new ()
void | cinnamon_recorder_set_framerate ()
void | cinnamon_recorder_set_filename ()
void | cinnamon_recorder_set_pipeline ()
void | cinnamon_recorder_set_area ()
gboolean | cinnamon_recorder_record ()
void | cinnamon_recorder_close ()
void | cinnamon_recorder_pause ()
gboolean | cinnamon_recorder_is_recording ()

## Properties

char * | filename | Read / Write
int | framerate | Read / Write
char * | pipeline | Read / Write
ClutterStage * | stage | Read / Write

## Object Hierarchy

        GObject
        ╰── CinnamonRecorder

## Description

## Functions

### cinnamon_recorder_new ()

    CinnamonRecorder *
    cinnamon_recorder_new (ClutterStage *stage);

Create a new CinnamonRecorder to record movies of a ClutterStage

#### Parameters

stage | The ClutterStage |

#### Returns

The newly created CinnamonRecorder object

### cinnamon_recorder_set_framerate ()

    void
    cinnamon_recorder_set_framerate (CinnamonRecorder *recorder,
                                     int framerate);

Sets the number of frames per second we configure for the GStreamer pipeline.

The default value is 15.

#### Parameters

recorder | the CinnamonRecorder |
framerate | Framerate used for resulting video in frames-per-second. |

### cinnamon_recorder_set_filename ()

    void
    cinnamon_recorder_set_filename (CinnamonRecorder *recorder,
                                    const char *filename);

Sets the filename that will be used when creating output files. This is only used if the configured pipeline has an unconnected source pad (as the default pipeline does). If the pipeline is complete, then the filename is unused. The provided string is used as a template.It can contain the following escapes:

`d`: The current date as YYYYYMMDD `u`: A string added to make the filename unique. '', 'a', 'b', ... 'aa', 'ab', .. `c`: A counter that is updated (opening a new file) each time the recording stream is paused. %%: A literal percent

The default value is 'cinnamon-`d` `u`-`c`.ogg'.

#### Parameters

recorder | the CinnamonRecorder |
filename | the filename template to use for output files, or `NULL` for the defalt value. |

### cinnamon_recorder_set_pipeline ()

    void
    cinnamon_recorder_set_pipeline (CinnamonRecorder *recorder,
                                    const char *pipeline);

Sets the GStreamer pipeline used to encode recordings. It follows the syntax used for gst-launch. The pipeline should have an unconnected sink pad where the recorded video is recorded. It will normally have a unconnected source pad; output from that pad will be written into the output file. (See `cinnamon_recorder_set_filename()`.) However the pipeline can also take care of its own output - this might be used to send the output to an icecast server via shout2send or similar.

The default value is 'vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=`T` ! queue ! webmmux'

#### Parameters

recorder | the CinnamonRecorder |
pipeline | the GStreamer pipeline used to encode recordings or `NULL` for the default value. | [allow-none]

### cinnamon_recorder_set_area ()

    void
    cinnamon_recorder_set_area (CinnamonRecorder *recorder,
                                int x,
                                int y,
                                int width,
                                int height);

### cinnamon_recorder_record ()

    gboolean
    cinnamon_recorder_record (CinnamonRecorder *recorder);

Starts recording, or continues a recording that was previously paused. Starting the recording may fail if the output file cannot be opened, or if the output stream cannot be created for other reasons. In that case a warning is printed to stderr. There is no way currently to get details on how recording failed to start.

An extra reference count is added to the recorder if recording is successfully started; the recording object will not be freed until recording is stopped even if the creator no longer holds a reference. Recording is automatically stopped if the stage is destroyed.

#### Parameters

recorder | the CinnamonRecorder |

#### Returns

`TRUE` if recording was successfully started

### cinnamon_recorder_close ()

    void
    cinnamon_recorder_close (CinnamonRecorder *recorder);

Stops recording. It's possible to call `cinnamon_recorder_record()` again to reopen a new recording stream, but unless change the recording filename, this may result in the old recording being overwritten.

#### Parameters

recorder | the CinnamonRecorder |

### cinnamon_recorder_pause ()

    void
    cinnamon_recorder_pause (CinnamonRecorder *recorder);

Temporarily stop recording. If the specified filename includes the `c` escape, then the stream is closed and a new stream with an incremented counter will be created. Otherwise the stream is paused and will be continued when `cinnamon_recorder_record()` is next called.

#### Parameters

recorder | the CinnamonRecorder |

### cinnamon_recorder_is_recording ()

    gboolean
    cinnamon_recorder_is_recording (CinnamonRecorder *recorder);

Determine if recording is currently in progress. (The recorder is not paused or closed.)

#### Returns

`TRUE` if the recorder is currently recording.

## Property Details

### The `“filename”` property

      “filename”                 char *

The filename template to use for output files.

Owner: CinnamonRecorder

Flags: Read / Write

Default value: NULL

### The `“framerate”` property

      “framerate”                int

Framerate used for resulting video in frames-per-second.

Owner: CinnamonRecorder

Flags: Read / Write

Allowed values: >= 0

Default value: 15

### The `“pipeline”` property

      “pipeline”                 char *

GStreamer pipeline description to encode recordings.

Owner: CinnamonRecorder

Flags: Read / Write

Default value: NULL

### The `“stage”` property

      “stage”                    ClutterStage *

Stage to record.

Owner: CinnamonRecorder

Flags: Read / Write