Player events

Description

Player events

Functions

FluPlayerEvent *

flu_player_event_new ()

FluPlayerEvent *

flu_player_event_copy ()

void

flu_player_event_free ()

flu_player_event_new ()

FluPlayerEvent * flu_player_event_new (FluPlayerEventType type);

Creates a new FluPlayerEvent

Since: 1.1

Parameters

type

The FluPlayerEvent type

Returns

The newly created event.

[transfer full]

flu_player_event_copy ()

FluPlayerEvent * flu_player_event_copy (const FluPlayerEvent *event);

Copies a FluPlayerEvent

Since: 1.1

Parameters

event

The FluPlayerEvent to copy

Returns

The copied event.

[transfer full]

flu_player_event_free ()

void flu_player_event_free (FluPlayerEvent *event);

Frees the FluPlayerEvent

Since: 1.1

Parameters

event

The FluPlayerEvent to free

Types and Values

enum FluPlayerState

Enum values used to describe an FluPlayer state.

FLU_PLAYER_STATE_STOPPED

The player is currently stopped

FLU_PLAYER_STATE_SEEKING

The player is currently seeking

FLU_PLAYER_STATE_PAUSED

The player is currently paused

FLU_PLAYER_STATE_PLAYING

The player is currently playing

enum FluUserOperation

Enum values used to describe different kinds of prohibited user operations. This is mostly used in the case of DVD playback for example when the user is not allowed to skip some scene or for advertising scenarios.

FLU_USER_OPERATION_NONE

No operation is prohibited.

FLU_USER_OPERATION_SET_POSITION

User cannot change playback position.

FLU_USER_OPERATION_SET_RATE

User cannot change playback rate.

FLU_USER_OPERATION_SET_AUDIO_STREAM

User cannot change currently playing audio stream.

FLU_USER_OPERATION_SET_VIDEO_STREAM

User cannot change currently playing video stream.

FLU_USER_OPERATION_SET_TEXT_STREAM

User cannot change currently playing text stream.

FLU_USER_OPERATION_CALL_TITLE_MENU

User cannot go to the title menu.

FLU_USER_OPERATION_CALL_ROOT_MENU

User cannot go to the root menu.

FLU_USER_OPERATION_CALL_TEXT_MENU

User cannot go to the subtitles/text menu.

FLU_USER_OPERATION_CALL_AUDIO_MENU

User cannot go to the audio menu.

FLU_USER_OPERATION_CALL_VIDEO_MENU

User cannot go to the video menu.

FLU_USER_OPERATION_CALL_CHAPTER_MENU

User cannot go to the chapters menu.

FLU_USER_OPERATION_SELECT_BUTTON

User cannot go trigger a select button event.

FLU_USER_OPERATION_SKIP_CHAPTER

User cannot skip to a different chapter.

FLU_USER_OPERATION_PAUSE

User cannot pause playback.

FLU_USER_OPERATION_STOP

User cannot stop playback.

FLU_USER_OPERATION_RESUME

User cannot resume movie playback from a menu.

FLU_USER_OPERATION_ALL

User cannot perform any operation.

enum FluPlaybackDirection

Enum values used to describe FluPlayer playback direction.

FLU_PLAYBACK_DIRECTION_FORWARDS

The player is playing forwards (from past to future)

FLU_PLAYBACK_DIRECTION_BACKWARDS

The player is playing backwards (from future to past)

enum FluPlayerEventType

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

FLU_PLAYER_EVENT_EMPTY

FLU_PLAYER_EVENT_STREAMS_AVAILABLE

New information about available streams has been received. Application should query available streams and their respective info again.

FLU_PLAYER_EVENT_STREAM_STATE_CHANGED

The state of a stream has changed.

FLU_PLAYER_EVENT_STREAM_INFO_UPDATED

Information about a stream has been updated.

FLU_PLAYER_EVENT_STREAM_ERROR

An error occured on the stream and thus it can not be played.

FLU_PLAYER_EVENT_REQUEST_TEXTURE

A video stream is requesting an output texture.

FLU_PLAYER_EVENT_BUFFERING

The player is buffering data in order to resume playback and prevent jittering.

FLU_PLAYER_EVENT_ERROR

A fatal error occured on the player.

FLU_PLAYER_EVENT_EOS

The player reached the end of stream.

FLU_PLAYER_EVENT_STATE

The player state has changed.

FLU_PLAYER_EVENT_UOP_CHANGED

User Operation masks have changed.

FLU_PLAYER_EVENT_REQUEST_RENDER_MODE

A stream is requesting it's render mode.

FLU_PLAYER_EVENT_REQUEST_RENDER_DEVICE

A stream has received a buffer to render.

FLU_PLAYER_EVENT_RENDER

A stream needs a device to render to

FLU_PLAYER_EVENT_MEDIA_INFO_UPDATED

Media information about the currently opened resource has been updated.

FLU_PLAYER_EVENT_BOOKMARKS_AVAILABLE

New information about available bookmarks has been received. Application should query available bookmarks and their respective info again.

FLU_PLAYER_EVENT_REQUEST_DRM_AGENT

A DRM capable element is asking the application for a DRM agent.

FLU_PLAYER_EVENT_SEEK_SOURCE

The source requests to seek to a given position.

FLU_PLAYER_EVENT_SOURCE_NEED_DATA

The source requests new data to be supplied.

FluPlayerEventAny

typedef struct { FluPlayerEventType type; } FluPlayerEventAny;

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

FluPlayerEventError

typedef struct { FluPlayerEventType type; GError *error; const gchar *dbg; } FluPlayerEventError;

Event structure describing an error that occurred in an FluPlayer instance.

FluPlayerEventStreamError

typedef struct { FluPlayerEventType type; GError *error; const gchar *dbg; FluStream *stream; } FluPlayerEventStreamError;

Event structure describing an error that occured in an FluStream instance.

FluPlayerEventBuffering

typedef struct { FluPlayerEventType type; gint percent; } FluPlayerEventBuffering;

Event structure providing information about the current buffering state of an FluPlayer instance. When percent is lower than 100, the player is paused and buffering data. When percent reaches 100 again, playback will resume.

FluPlayerEventRequestTexture

typedef struct { FluPlayerEventType type; guintptr handle; FluStream *stream; gboolean handle_aspect_ratio; } FluPlayerEventRequestTexture;

Event structure used by a stream to retrieve information about the target rendering texture. When a video stream is preparing to render the first video frame it will request a destination drawable to the application. Application should set the target texture pointer in handle while handling this event. The video rendering component is sometimes able to handle the drawing of black borders and maintain the original video aspect ratio. In most cases this will work just fine but it is recommended that the application handles this directly to support special cases like forcing a specific aspect ratio, video cropping, etc...

FluPlayerEventStreamChanged

typedef struct { FluPlayerEventType type; FluStream *stream; FluStreamChangedFlags changed_flags; } FluPlayerEventStreamChanged;

Event structure used to notify applications that a stream 's changed

struct FluPlayerEventStreamInfoUpdated

struct FluPlayerEventStreamInfoUpdated { FluPlayerEventType type; FluStream *stream; };

Alias of FluPlayerEventStreamChanged for backwards compatibility

struct FluPlayerEventStreamStateChanged

struct FluPlayerEventStreamStateChanged { FluPlayerEventType type; FluStream *stream; };

Event structure used to notify applications that a stream 's state has changed. That means that the stream either became active thanks to data flow (after being requested) or inactive.

FluPlayerEventState

typedef struct { FluPlayerEventType type; FluPlayerState state; } FluPlayerEventState;

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

FluPlayerEventUOPChanged

typedef struct { FluPlayerEventType type; FluUserOperation prohibited_operations; } FluPlayerEventUOPChanged;

Event structure used to notify applications that the player's UOP (User Operation Prohibition) has changed.

FluPlayerEventRequestRenderMode

typedef struct { FluPlayerEventType type; FluStream *stream; gboolean render; gboolean synchronize; gboolean notify; } FluPlayerEventRequestRenderMode;

Event structure used to retrieve information about the target rendering mode for stream . Whenever the stream is about to be decoded, the application can decide to render or not to render a specific stream.

struct FluPlayerEventRequestRenderDevice

struct FluPlayerEventRequestRenderDevice { FluPlayerEventType type; FluStream *stream; GList *devices; gint selected; };

Event structure used to retrieve what device to use to render a stream .

FluPlayerEventRender

typedef struct { FluPlayerEventType type; FluStream *stream; guint64 pts; guint64 duration; } FluPlayerEventRender;

Event structure indicating that a stream is ready to render a sample.

FluPlayerEventMediaInfoUpdated

typedef struct { FluPlayerEventType type; const FluMediaInfo *info; FluSource *source; } FluPlayerEventMediaInfoUpdated;

Event structure used to notify applications that a player's FluMediaInfo has changed.

FluPlayerEventRequestDRMAgent

typedef struct { FluPlayerEventType type; guintptr handle; gpointer init_data; gsize init_data_size; gboolean try_inband; } FluPlayerEventRequestDRMAgent;

Event structure used to retrieve the DRM agent handle used for decrypting

FluPlayerEventSeekSource

typedef struct { FluPlayerEventType type; FluSource *source; guint64 position; FluFormat format; } FluPlayerEventSeekSource;

Event structure used to request a seek on FluSource

FluPlayerEventSourceNeedData

typedef struct { FluPlayerEventType type; FluSource *source; FluPlaybackDirection playback_direction; guint8 *data; gsize size; guint64 pts; GFreeFunc free_func; } FluPlayerEventSourceNeedData;

Event structure used when FluSource request data. This event is used with seekable FluCustomSource.

FluPlayerEventStreamsAvailable

typedef struct { FluPlayerEventType type; FluStream *stream; gboolean added; } FluPlayerEventStreamsAvailable;

Event structure used when a new stream is add to a FluSource

FluPlayerEvent

The FluPlayerEvent 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> FluPlayerEvent *event; FluPlayerEventType 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> FluPlayerEvent *event; FluPlayerState state;

state = ((FluPlayerEventState*)event)->state; </programlisting> </informalexample> or: <informalexample> <programlisting> FluPlayerEvent *event; FluPlayerState state;

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

stream_info_updated and stream_state_changed are aliases of stream_changed for backwards compatibility