ClutterGstPlayer

ClutterGstPlayer — An interface for controlling playback of media data

Properties

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

Signals

void eos Run Last
void error Run Last
void new-frame Run Last
void ready Run Last
void size-change Run Last

Types and Values

Object Hierarchy

    GInterface
    ╰── ClutterGstPlayer

Prerequisites

ClutterGstPlayer requires GObject.

Known Implementations

ClutterGstPlayer is implemented by ClutterGstCamera and ClutterGstPlayback.

Description

ClutterGstPlayer is an interface for controlling playback of media sources.

Functions

clutter_gst_player_get_frame ()

ClutterGstFrame *
clutter_gst_player_get_frame (ClutterGstPlayer *self);

Retrieves the ClutterGstFrame of the last frame produced by self .

Parameters

self

a ClutterGstPlayer

 

Returns

the ClutterGstFrame 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.

Parameters

self

a ClutterGstPlayer

 

Returns

the GstPipeline element used by the player.

[transfer none]

Since 3.0


clutter_gst_player_get_video_sink ()

ClutterGstVideoSink *
clutter_gst_player_get_video_sink (ClutterGstPlayer *self);

Retrieves the ClutterGstVideoSink used by the self .

Parameters

self

a ClutterGstPlayer

 

Returns

the ClutterGstVideoSink 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.

Parameters

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 .

Parameters

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.

Parameters

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 .

Parameters

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 .

Parameters

self

a ClutterGstPlayer

 

volume

the volume as a double between 0.0 and 1.0

 

Since 3.0

Types and Values

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);
  ClutterGstVideoSink *(* 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

Members

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 ClutterGst 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

Property Details

The “audio-volume” property

  “audio-volume”             gdouble

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

Flags: Read / Write

Allowed values: [0,1]

Default value: 0.5


The “idle” property

  “idle”                     gboolean

Whether the ClutterGstPlayer is in idle mode.

Flags: Read

Default value: TRUE

Since 1.4


The “playing” property

  “playing”                  gboolean

Whether the ClutterGstPlayer actor is playing.

Flags: Read / Write

Default value: FALSE

Signal Details

The “eos” signal

void
user_function (ClutterGstPlayer *player,
               gpointer          user_data)

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

Parameters

player

the ClutterGstPlayer instance that received the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “error” signal

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

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

Parameters

player

the ClutterGstPlayer instance that received the signal

 

error

the GError

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “new-frame” signal

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

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

Parameters

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.

 

Flags: Run Last


The “ready” signal

void
user_function (ClutterGstPlayer *player,
               gpointer          user_data)

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

Parameters

player

the ClutterGstPlayer instance that received the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “size-change” signal

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

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

Parameters

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.

 

Flags: Run Last