Recorder events

Recorder events — Recorder events

Functions

Types and Values

Description

Recorder events

Functions

flu_recorder_event_new ()

FluRecorderEvent *
flu_recorder_event_new (FluRecorderEventType type);

Creates a new FluRecorderEvent

Parameters

type

The FluRecorderEvent type

 

Returns

The newly created event.

[transfer full]


flu_recorder_event_copy ()

FluRecorderEvent *
flu_recorder_event_copy (const FluRecorderEvent *event);

Copies a FluRecorderEvent

Parameters

event

The FluRecorderEvent to copy

 

Returns

The copied event.

[transfer full]


flu_recorder_event_free ()

void
flu_recorder_event_free (FluRecorderEvent *event);

Frees the FluRecorderEvent

Parameters

event

The FluRecorderEvent to free

 

Types and Values

enum FluRecorderState

Enum values used to describe an FluRecorder state.

Members

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 FluRecorderEventType

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

Members

FLU_RECORDER_EVENT_EMPTY

   

FLU_RECORDER_EVENT_STATE

The recorder state has changed

 

FLU_RECORDER_EVENT_REQUEST_SAVE_MODE

A recorder is requesting its save mode

 

FLU_RECORDER_EVENT_SAVE

The recoder need

 

FLU_RECORDER_EVENT_ERROR

   

enum FluRecorderSaveMode

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

Members

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

 

FLU_RECORDER_SAVE_MODE_UDP_STREAM

   

FluRecorderSaveModeFileData

typedef struct {
  const gchar *filename;
} FluRecorderSaveModeFileData;

The specific data required when using the FLU_RECORDER_SAVE_MODE_FILE

Members

const gchar *filename;

The filename to save the muxed file to. The user is responsible of freeing the data if required.

 

struct FluRecorderSaveModeUdpStreamData

struct FluRecorderSaveModeUdpStreamData {
  gchar *host;
  gint port;
};

The specific data required when using the FLU_RECORDER_SAVE_MODE_UDP_STREAM

Members

gchar *host;

The host/IP to send the packets to. The user is responsible of freeing the data if required.

 

gint port;

The port to send the packets to

 

FluRecorderSaveModeData

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

Members

FluRecorderSaveModeFileData file;

use as FLURecorderSaveModeFileData type, mode FLU_RECORDER_SAVE_MODE_FILE

 

FluRecorderSaveModeUdpStreamData stream;

   

FluRecorderEventAny

typedef struct {
  FluRecorderEventType type;
} FluRecorderEventAny;

Contains the fields which are common to all event structs. Any event pointer can safely be cast to a pointer to a FluRecorderEventAny to access these fields.

Members

FluRecorderEventType type;

the type of the event.

 

FluRecorderEventRequestSaveMode

typedef struct {
  FluRecorderEventType type;
  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.

Members

FluRecorderEventType type;

   

FluRecorderSaveMode mode;

Specify the save mode of the recorder

 

FluRecorderSaveModeData data;

Specific data for a save mode

 

FluRecorderEventSave

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

Event structure indicating that muxed frame has been generated

Members

FluRecorderEventType type;

   

const guint8 *data;

Buffer data

 

guint64 duration;

Buffer duration in nanoseconds

 

FluRecorderEventState

typedef struct {
  FluRecorderEventType type;
  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().

Members

FluRecorderEventType type;

   

FluRecorderState state;

Recorder's current state

 

FluRecorderEventError

typedef struct {
  FluRecorderEventType type;
  FluErrorTuple error;
} FluRecorderEventError;

Members

FluRecorderEventType type;

   

FluErrorTuple error;

Tuple with current error information

 

FluRecorderEvent

The FluRecoderEvent struct contains a union of all of the event structs, and allows access to the data fields in a number of ways.

The event type is always the first field in all of the event structs, and can always be accessed with the following code, no matter what type of event it is: <informalexample> <programlisting> FluRecorderEvent *event; FluRecorderEventType type;

type = event->type; </programlisting> </informalexample>

To access other fields of the event structs, the pointer to the event can be cast to the appropriate event struct pointer, or the union member name can be used. For example if the event type is FLU_PLAYER_EVENT_STATE then the state can be accessed with: <informalexample> <programlisting> FluRecorderEvent *event; FluRecorderState state;

state = ((FluRecoderEventState*)event)->state; </programlisting> </informalexample> or: <informalexample> <programlisting> FluRecorderEvent *event; FluRecorderState state;

state = event->state.x; </programlisting> </informalexample>