Recorder

Description

Recorder interface

FluRecorderListener ()

gboolean(*FluRecorderListener) (FluRecorder *recorder, gpointer event, gpointer data);

A recorder event listener definition

Parameters

recorder

The recorder that triggered the event

event

The recorder event definition. You should cast to the specific recorder event data

data

The user data provided when registering the listener

flu_recorder_new ()

FluRecorder * flu_recorder_new (const FluMediaInfo *media_info);

Creates a new FluRecorder

Parameters

media_info

The FluMediaInfo to use to describe the recording

Returns

The newly created recorder

flu_recorder_ref ()

FluRecorder * flu_recorder_ref (FluRecorder *thiz);

Add a reference to an FluRecorder

Parameters

thiz

The recorder to be referenced

Returns

The same object, for programming convenience

flu_recorder_unref ()

void flu_recorder_unref (FluRecorder *thiz);

Remove a reference from an FluRecorder

Parameters

thiz

The recorder to be unreferenced

flu_recorder_record ()

void flu_recorder_record (FluRecorder *thiz);

Make an FluRecorder start recording

Parameters

thiz

The recorder to start recording

flu_recorder_stop ()

void flu_recorder_stop (FluRecorder *thiz);

flu_recorder_streams_get ()

GList * flu_recorder_streams_get (FluRecorder *thiz);

Gets the list of requested streams note: Use flu_stream_list_free() to free the returned list

Parameters

thiz

The FluRecorder to get the list of requested streams from

Returns

The list of requested streams

flu_recorder_video_streams_get ()

GList * flu_recorder_video_streams_get (FluRecorder *thiz);

Gets the list of requested video streams note: Use flu_stream_list_free() to free the returned list

Parameters

thiz

The FluRecorder to get the list of requested video streams from

Returns

The list of requested video streams

flu_recorder_audio_streams_get ()

GList * flu_recorder_audio_streams_get (FluRecorder *thiz);

Gets the list of requested audio streams note: Use flu_stream_list_free() to free the returned list

Parameters

thiz

The FluRecorder to get the list of requested audio streams from

Returns

The list of requested audio streams

flu_recorder_text_streams_get ()

GList * flu_recorder_text_streams_get (FluRecorder *thiz);

Gets the list of available text streams note: Use flu_stream_list_free() to free the returned list

Parameters

thiz

The FluPlayer to get the list of available text streams from

Returns

The list of available text streams

flu_recorder_request_stream ()

FluStream * flu_recorder_request_stream (FluRecorder *thiz, const FluStreamInfo *info);

Request a FluStream to push data to be recorded

Parameters

thiz

The recorder to request the stream from

info

The stream information to be requested

Returns

The requested stream

flu_recorder_connect_device ()

FluStream * flu_recorder_connect_device (FluRecorder *thiz, FluDevice *d, const FluStreamInfo *info);

Connect a FluDevice to a FluRecorder to grab all frames from the device

Parameters

thiz

The recorder to connect the device to

d

The device to connect to

info

The stream information to use when recording from the device

Returns

The requested stream from the device

flu_recorder_event_listener_add ()

void flu_recorder_event_listener_add (FluRecorder *thiz, FluRecorderEvent event, FluRecorderListener listener, gpointer data);

Adds an event listener on a FluRecorder

Parameters

thiz

The FluRecorder to add the event listener to

event

The FluRecorderEvent to listen to

listener

The function to be called whenever an event is received

data

The user provided data to be passed onto the listener

flu_recorder_event_listener_remove ()

void flu_recorder_event_listener_remove (FluRecorder *thiz, FluRecorderEvent event, FluRecorderListener listener, gpointer data);

Removes an event listener on a FluRecorder

Parameters

thiz

The FluRecorder to remove the event listener from

event

The FluRecorderEvent to stop listening

listener

The function used when adding a listener

data

The user provided data used when adding a listener

flu_recorder_dot_graph_generate ()

void flu_recorder_dot_graph_generate (FluRecorder *thiz, const gchar *filename);

Outputs a DOT file representing the current pipeline

Parameters

thiz

The FluRecorder

filename

The filename for the DOT file

flu_recorder_state_name_get ()

const gchar * flu_recorder_state_name_get (FluRecorderState state);

Gets a readable name of a state

Parameters

state

The FluRecorderState to get the name of

Returns

A statically-allocated string

Types and Values

enum FluRecorderState

Enum values used to describe an FluRecorder state.

FLU_RECORDER_STATE_STOPPED

The recorder is currently stopped

FLU_RECORDER_STATE_PAUSED

The recorder is currently paused

FLU_RECORDER_STATE_RECORDING

The recorder is currently recording

enum FluRecorderSaveMode

Enum values used to describe the different save modes of a recorder

FLU_RECORDER_SAVE_MODE_NONE

No saving of the encoded stream will be done. The application must listen to the FluRecorderEventSave to fetch the encoded stream

FLU_RECORDER_SAVE_MODE_FILE

The encoded stream will be saved to a file

FluRecorderSaveModeFileData

typedef struct { gchar *filename; } FluRecorderSaveModeFileData;

The specific data required when using the FLU_RECORDER_SAVE_MODE_FILE

FluRecorderSaveModeData

The union all the data required for every save mode defined in FLURecorderSaveMode

FluRecorderEventRequestSaveMode

typedef struct { FluRecorderSaveMode mode; FluRecorderSaveModeData data; } FluRecorderEventRequestSaveMode;

Event structure used to retrieve information about the target saving mode for a FluRecorder. In case of setting FLU_RECORDER_SAVE_MODE_NONE the event FLU_RECORDER_EVENT_SAVE will be received on every muxed buffer ready to be saved. Nothing is required on the specific data member. In case of setting FLU_RECORDER_SAVE_MODE_FILE, you need to pass a const gchar * with the file name to write the file to.

FluRecorderEventSave

typedef struct { const guint8 *data; guint64 duration; } FluRecorderEventSave;

Event structure indicating that muxed frame has been generated

FluRecorderEventState

typedef struct { FluRecorderState state; } FluRecorderEventState;

Event structure used to notify applications that the recorder's state has changed. The new current state is provided in state or can be queried using flu_recorder_state_get().

enum FluRecorderEvent

Enum values used to describe different type of events that can be raised by an FluRecorder.

FLU_RECORDER_EVENT_STATE

FLU_RECORDER_EVENT_REQUEST_SAVE_MODE

FLU_RECORDER_EVENT_SAVE

FluRecorder

typedef struct { } FluRecorder;

An opaque structure representing a media player instance.