ClutterGstPlayer

ClutterGstPlayer — An interface for controlling playback of media data

Synopsis

                    ClutterGstPlayer;
struct              ClutterGstPlayerIface;
ClutterGstFrame *   clutter_gst_player_get_frame        (ClutterGstPlayer *self);
GstElement *        clutter_gst_player_get_pipeline     (ClutterGstPlayer *self);
CoglGstVideoSink *  clutter_gst_player_get_video_sink   (ClutterGstPlayer *self);
gboolean            clutter_gst_player_get_idle         (ClutterGstPlayer *self);
gboolean            clutter_gst_player_get_playing      (ClutterGstPlayer *self);
void                clutter_gst_player_set_playing      (ClutterGstPlayer *self,
                                                         gboolean playing);
gdouble             clutter_gst_player_get_audio_volume (ClutterGstPlayer *self);
void                clutter_gst_player_set_audio_volume (ClutterGstPlayer *self,
                                                         gdouble volume);

Object Hierarchy

  GInterface
   +----ClutterGstPlayer

Prerequisites

ClutterGstPlayer requires GObject.

Known Implementations

ClutterGstPlayer is implemented by ClutterGstCamera and ClutterGstPlayback.

Properties

  "audio-volume"             gdouble               : Read / Write
  "idle"                     gboolean              : Read
  "playing"                  gboolean              : Read / Write

Signals

  "eos"                                            : Run Last
  "error"                                          : Run Last
  "new-frame"                                      : Run Last
  "ready"                                          : Run Last
  "size-change"                                    : Run Last

Description

ClutterGstPlayer is an interface for controlling playback of media sources.

Details

ClutterGstPlayer

typedef struct _ClutterGstPlayer ClutterGstPlayer;

ClutterGstPlayer is an opaque structure whose members cannot be directly accessed

Since 1.4


struct ClutterGstPlayerIface

struct ClutterGstPlayerIface {
  ClutterGstFrame * (* get_frame)        (ClutterGstPlayer *self);
  GstElement *      (* get_pipeline)     (ClutterGstPlayer *self);
  CoglGstVideoSink *(* get_video_sink)   (ClutterGstPlayer *self);

  gboolean          (* get_idle)         (ClutterGstPlayer *self);

  gdouble           (* get_audio_volume) (ClutterGstPlayer *self);
  void              (* set_audio_volume) (ClutterGstPlayer *self,
                                          gdouble           volume);

  gboolean          (* get_playing)      (ClutterGstPlayer *self);
  void              (* set_playing)      (ClutterGstPlayer *self,
                                          gboolean          playing);

  /* signals */
  void (* new_frame)           (ClutterGstPlayer *self, ClutterGstFrame *frame);
  void (* ready)               (ClutterGstPlayer *self);
  void (* eos)                 (ClutterGstPlayer *self);
  void (* error)               (ClutterGstPlayer *self,
                                const GError     *error);
  void (* size_change)         (ClutterGstPlayer *self,
                                gint              width,
                                gint              height);
};

Interface vtable for ClutterGstPlayer implementations

get_frame ()

virtual function; returns the current visible frame

get_pipeline ()

virtual function; returns the current GStreamer pipeline

get_video_sink ()

virtual function; returns the current Cogl video sink

get_idle ()

virtual function; returns whether the player is currently in idle state

get_audio_volume ()

virtual function; returns the current audio volume

set_audio_volume ()

virtual function; sets the audio volume

get_playing ()

virtual function; returns whether the player is currently playing

set_playing ()

virtual function; starts or stops the player from playing

new_frame ()

signal class closure for "new-frame"

ready ()

signal class closure for "ready"

eos ()

signal class closure for "eos"

error ()

signal class closure for "error"

size_change ()

signal class closure for "size-change"

Since 1.4


clutter_gst_player_get_frame ()

ClutterGstFrame *   clutter_gst_player_get_frame        (ClutterGstPlayer *self);

Retrieves the CoglHandle of the last frame produced by self.

self :

a ClutterGstPlayer

Returns :

the CoglHandle of the last frame. [transfer none]

Since 3.0


clutter_gst_player_get_pipeline ()

GstElement *        clutter_gst_player_get_pipeline     (ClutterGstPlayer *self);

Retrieves the GstPipeline used by the self, for direct use with GStreamer API.

self :

a ClutterGstPlayer

Returns :

the GstPipeline element used by the player. [transfer none]

Since 3.0


clutter_gst_player_get_video_sink ()

CoglGstVideoSink *  clutter_gst_player_get_video_sink   (ClutterGstPlayer *self);

Retrieves the CoglGstVideoSink used by the self.

self :

a ClutterGstPlayer

Returns :

the CoglGstVideoSink element used by the player. [transfer none]

Since 3.0


clutter_gst_player_get_idle ()

gboolean            clutter_gst_player_get_idle         (ClutterGstPlayer *self);

Get the idle state of the pipeline.

self :

a ClutterGstPlayer

Returns :

TRUE if the pipline is in idle mode, FALSE otherwise.

Since 3.0


clutter_gst_player_get_playing ()

gboolean            clutter_gst_player_get_playing      (ClutterGstPlayer *self);

Retrieves the playing status of self.

self :

A ClutterGstPlayer object

Returns :

TRUE if playing, FALSE if stopped.

Since 3.0


clutter_gst_player_set_playing ()

void                clutter_gst_player_set_playing      (ClutterGstPlayer *self,
                                                         gboolean playing);

Starts or stops playing of self.

The implementation might be asynchronous, so the way to know whether the actual playing state of the self is to use the "notify" signal on the "playing" property and then retrieve the current state with clutter_gst_player_get_playing(). ClutterGstVideoActor in clutter-gst is an example of such an asynchronous implementation.

self :

a ClutterGstPlayer

playing :

TRUE to start playing

Since 3.0


clutter_gst_player_get_audio_volume ()

gdouble             clutter_gst_player_get_audio_volume (ClutterGstPlayer *self);

Retrieves the playback volume of self.

self :

a ClutterGstPlayer

Returns :

The playback volume between 0.0 and 1.0

Since 3.0


clutter_gst_player_set_audio_volume ()

void                clutter_gst_player_set_audio_volume (ClutterGstPlayer *self,
                                                         gdouble volume);

Sets the playback volume of self to volume.

self :

a ClutterGstPlayer

volume :

the volume as a double between 0.0 and 1.0

Since 3.0

Property Details

The "audio-volume" property

  "audio-volume"             gdouble               : Read / Write

The volume of the audio, as a normalized value between 0.0 and 1.0.

Allowed values: [0,1]

Default value: 0.5


The "idle" property

  "idle"                     gboolean              : Read

Whether the ClutterGstPlayer is in idle mode.

Default value: TRUE

Since 1.4


The "playing" property

  "playing"                  gboolean              : Read / Write

Whether the ClutterGstPlayer actor is playing.

Default value: FALSE

Signal Details

The "eos" signal

void                user_function                      (ClutterGstPlayer *player,
                                                        gpointer          user_data)      : Run Last

The ::eos signal is emitted each time the media stream ends.

player :

the ClutterGstPlayer instance that received the signal

user_data :

user data set when the signal handler was connected.

The "error" signal

void                user_function                      (ClutterGstPlayer *player,
                                                        GError           *error,
                                                        gpointer          user_data)      : Run Last

The ::error signal is emitted each time an error occurred.

player :

the ClutterGstPlayer instance that received the signal

error :

the GError

user_data :

user data set when the signal handler was connected.

The "new-frame" signal

void                user_function                      (ClutterGstPlayer *player,
                                                        ClutterGstFrame  *frame,
                                                        gpointer          user_data)      : Run Last

The ::ready signal is emitted each time the gstreamer pipeline becomes ready.

player :

the ClutterGstPlayer instance that received the signal

frame :

the ClutterGstFrame newly receive from the video sink

user_data :

user data set when the signal handler was connected.

The "ready" signal

void                user_function                      (ClutterGstPlayer *player,
                                                        gpointer          user_data)      : Run Last

The ::ready signal is emitted each time the gstreamer pipeline becomes ready.

player :

the ClutterGstPlayer instance that received the signal

user_data :

user data set when the signal handler was connected.

The "size-change" signal

void                user_function                      (ClutterGstPlayer *player,
                                                        gint              width,
                                                        gint              height,
                                                        gpointer          user_data)      : Run Last

The ::size-change signal is emitted each time the gstreamer pipeline becomes ready.

player :

the ClutterGstPlayer instance that received the signal

width :

new width of the frames

height :

new height of the frames

user_data :

user data set when the signal handler was connected.