ClutterGstPlayback

ClutterGstPlayback — A ClutterGstPlayback to play media streams

Synopsis

struct              ClutterGstPlayback;
struct              ClutterGstPlaybackClass;
ClutterGstPlayback * clutter_gst_playback_new           (void);
gint                clutter_gst_playback_get_audio_stream
                                                        (ClutterGstPlayback *self);
GList *             clutter_gst_playback_get_audio_streams
                                                        (ClutterGstPlayback *self);
gint64              clutter_gst_playback_get_buffer_duration
                                                        (ClutterGstPlayback *self);
gdouble             clutter_gst_playback_get_buffer_fill
                                                        (ClutterGstPlayback *self);
ClutterGstBufferingMode clutter_gst_playback_get_buffering_mode
                                                        (ClutterGstPlayback *self);
gint                clutter_gst_playback_get_buffer_size
                                                        (ClutterGstPlayback *self);
gdouble             clutter_gst_playback_get_duration   (ClutterGstPlayback *self);
gboolean            clutter_gst_playback_get_in_seek    (ClutterGstPlayback *self);
gdouble             clutter_gst_playback_get_progress   (ClutterGstPlayback *self);
ClutterGstSeekFlags clutter_gst_playback_get_seek_flags (ClutterGstPlayback *self);
gchar *             clutter_gst_playback_get_subtitle_font_name
                                                        (ClutterGstPlayback *self);
gint                clutter_gst_playback_get_subtitle_track
                                                        (ClutterGstPlayback *self);
GList *             clutter_gst_playback_get_subtitle_tracks
                                                        (ClutterGstPlayback *self);
gchar *             clutter_gst_playback_get_subtitle_uri
                                                        (ClutterGstPlayback *self);
gchar *             clutter_gst_playback_get_uri        (ClutterGstPlayback *self);
gchar *             clutter_gst_playback_get_user_agent (ClutterGstPlayback *self);
gboolean            clutter_gst_playback_is_live_media  (ClutterGstPlayback *self);
void                clutter_gst_playback_set_audio_stream
                                                        (ClutterGstPlayback *self,
                                                         gint index_);
void                clutter_gst_playback_set_buffer_duration
                                                        (ClutterGstPlayback *self,
                                                         gint64 duration);
void                clutter_gst_playback_set_buffering_mode
                                                        (ClutterGstPlayback *self,
                                                         ClutterGstBufferingMode mode);
void                clutter_gst_playback_set_buffer_size
                                                        (ClutterGstPlayback *self,
                                                         gint size);
void                clutter_gst_playback_set_filename   (ClutterGstPlayback *self,
                                                         const gchar *filename);
void                clutter_gst_playback_set_progress   (ClutterGstPlayback *self,
                                                         gdouble progress);
void                clutter_gst_playback_set_seek_flags (ClutterGstPlayback *self,
                                                         ClutterGstSeekFlags flags);
void                clutter_gst_playback_set_subtitle_font_name
                                                        (ClutterGstPlayback *self,
                                                         const char *font_name);
void                clutter_gst_playback_set_subtitle_track
                                                        (ClutterGstPlayback *self,
                                                         gint index_);
void                clutter_gst_playback_set_subtitle_uri
                                                        (ClutterGstPlayback *self,
                                                         const gchar *uri);
void                clutter_gst_playback_set_uri        (ClutterGstPlayback *self,
                                                         const gchar *uri);
void                clutter_gst_playback_set_user_agent (ClutterGstPlayback *self,
                                                         const gchar *user_agent);

Object Hierarchy

  GObject
   +----ClutterGstPlayback

Implemented Interfaces

ClutterGstPlayback implements ClutterGstPlayer.

Properties

  "audio-stream"             gint                  : Read / Write
  "audio-streams"            gpointer              : Read
  "buffer-fill"              gdouble               : Read
  "can-seek"                 gboolean              : Read
  "duration"                 gdouble               : Read
  "in-seek"                  gboolean              : Read
  "progress"                 gdouble               : Read / Write
  "seek-flags"               ClutterGstSeekFlags   : Read / Write
  "subtitle-font-name"       gchar*                : Read / Write
  "subtitle-track"           gint                  : Read / Write
  "subtitle-tracks"          gpointer              : Read
  "subtitle-uri"             gchar*                : Read / Write
  "uri"                      gchar*                : Read / Write
  "user-agent"               gchar*                : Read / Write

Signals

  "should-buffer"                                  : Run Last

Description

ClutterGstPlayback implements ClutterGstPlayer.

Details

struct ClutterGstPlayback

struct ClutterGstPlayback;

Implementation of ClutterGstPlayback that displays media streams using GStreamer.

The ClutterGstPlayback structure contains only private data and should not be accessed directly.


struct ClutterGstPlaybackClass

struct ClutterGstPlaybackClass {
  /* signals */
  gboolean (* should_buffer)  (ClutterGstPlayback *self,
                                GstQuery *query);
};

Base class for ClutterGstPlayback.


clutter_gst_playback_new ()

ClutterGstPlayback * clutter_gst_playback_new           (void);


clutter_gst_playback_get_audio_stream ()

gint                clutter_gst_playback_get_audio_stream
                                                        (ClutterGstPlayback *self);

Get the current audio stream. The number returned in the index of the audio stream playing in the list returned by clutter_gst_playback_get_audio_streams().

self :

a ClutterGstPlayback

Returns :

the index of the current audio stream, -1 if the media has no audio stream

Since 1.4


clutter_gst_playback_get_audio_streams ()

GList *             clutter_gst_playback_get_audio_streams
                                                        (ClutterGstPlayback *self);

Get the list of audio streams of the current media.

self :

a ClutterGstPlayback

Returns :

a list of strings describing the available audio streams. [transfer none][element-type utf8]

Since 1.4


clutter_gst_playback_get_buffer_duration ()

gint64              clutter_gst_playback_get_buffer_duration
                                                        (ClutterGstPlayback *self);

Retrieves the buffer duration when buffering network streams.

self :

a ClutterGstPlayback

Returns :

The buffer duration

clutter_gst_playback_get_buffer_fill ()

gdouble             clutter_gst_playback_get_buffer_fill
                                                        (ClutterGstPlayback *self);

Retrieves the amount of the stream that is buffered.

self :

a ClutterGstPlayback

Returns :

the fill level, between 0.0 and 1.0

clutter_gst_playback_get_buffering_mode ()

ClutterGstBufferingMode clutter_gst_playback_get_buffering_mode
                                                        (ClutterGstPlayback *self);

self :

a ClutterGstPlayback

Returns :

a ClutterGstBufferingMode

Since 1.4


clutter_gst_playback_get_buffer_size ()

gint                clutter_gst_playback_get_buffer_size
                                                        (ClutterGstPlayback *self);

Retrieves the buffer size when buffering network streams.

self :

a ClutterGstPlayback

Returns :

The buffer size

clutter_gst_playback_get_duration ()

gdouble             clutter_gst_playback_get_duration   (ClutterGstPlayback *self);

Retrieves the duration of the media stream that self represents.

self :

a ClutterGstPlayback

Returns :

the duration of the media stream, in seconds

clutter_gst_playback_get_in_seek ()

gboolean            clutter_gst_playback_get_in_seek    (ClutterGstPlayback *self);

Whether the player is seeking.

self :

a ClutterGstPlayback

Returns :

TRUE if the player is seeking, FALSE otherwise.

Since 1.6


clutter_gst_playback_get_progress ()

gdouble             clutter_gst_playback_get_progress   (ClutterGstPlayback *self);

Retrieves the playback progress of self.

self :

a ClutterGstPlayback

Returns :

the playback progress, between 0.0 and 1.0

clutter_gst_playback_get_seek_flags ()

ClutterGstSeekFlags clutter_gst_playback_get_seek_flags (ClutterGstPlayback *self);

Get the current value of the seek-flags property.

self :

a ClutterGstPlayback

Returns :

a combination of ClutterGstSeekFlags

Since 1.4


clutter_gst_playback_get_subtitle_font_name ()

gchar *             clutter_gst_playback_get_subtitle_font_name
                                                        (ClutterGstPlayback *self);

Retrieves the font name currently used.

self :

a ClutterGstPlayback

Returns :

a string containing the font name. Use g_free() to free the returned string

clutter_gst_playback_get_subtitle_track ()

gint                clutter_gst_playback_get_subtitle_track
                                                        (ClutterGstPlayback *self);

Get the current subtitles track. The number returned is the index of the subtiles track in the list returned by clutter_gst_playback_get_subtitle_tracks().

self :

a ClutterGstPlayback

Returns :

the index of the current subtitlest track, -1 if the media has no subtitles track or if the subtitles have been turned off

Since 1.4


clutter_gst_playback_get_subtitle_tracks ()

GList *             clutter_gst_playback_get_subtitle_tracks
                                                        (ClutterGstPlayback *self);

Get the list of subtitles tracks of the current media.

self :

a ClutterGstPlayback

Returns :

a list of strings describing the available subtitles tracks. [transfer none][element-type utf8]

Since 1.4


clutter_gst_playback_get_subtitle_uri ()

gchar *             clutter_gst_playback_get_subtitle_uri
                                                        (ClutterGstPlayback *self);

Retrieves the URI of the subtitle file in use.

self :

a ClutterGstPlayback

Returns :

the URI of the subtitle file. Use g_free() to free the returned string

clutter_gst_playback_get_uri ()

gchar *             clutter_gst_playback_get_uri        (ClutterGstPlayback *self);

Retrieves the URI from self.

self :

a ClutterGstPlayback

Returns :

the URI of the media stream. Use g_free() to free the returned string

clutter_gst_playback_get_user_agent ()

gchar *             clutter_gst_playback_get_user_agent (ClutterGstPlayback *self);

Retrieves the user agent used when streaming.

self :

a ClutterGstPlayback

Returns :

the user agent used. The returned string has to be freed with g_free()

Since 1.4


clutter_gst_playback_is_live_media ()

gboolean            clutter_gst_playback_is_live_media  (ClutterGstPlayback *self);

Whether the player is using a live media.

self :

a ClutterGstPlayback

Returns :

TRUE if the player is using a live media, FALSE otherwise.

clutter_gst_playback_set_audio_stream ()

void                clutter_gst_playback_set_audio_stream
                                                        (ClutterGstPlayback *self,
                                                         gint index_);

Set the audio stream to play. index_ is the index of the stream in the list returned by clutter_gst_playback_get_audio_streams().

self :

a ClutterGstPlayback

index_ :

the index of the audio stream

Since 1.4


clutter_gst_playback_set_buffer_duration ()

void                clutter_gst_playback_set_buffer_duration
                                                        (ClutterGstPlayback *self,
                                                         gint64 duration);

Sets the buffer duration to be used when buffering network streams.

self :

a ClutterGstPlayback

duration :

The new duration

clutter_gst_playback_set_buffering_mode ()

void                clutter_gst_playback_set_buffering_mode
                                                        (ClutterGstPlayback *self,
                                                         ClutterGstBufferingMode mode);

self :

a ClutterGstPlayback

mode :

a ClutterGstBufferingMode

Since 1.4


clutter_gst_playback_set_buffer_size ()

void                clutter_gst_playback_set_buffer_size
                                                        (ClutterGstPlayback *self,
                                                         gint size);

Sets the buffer size to be used when buffering network streams.

self :

a ClutterGstPlayback

size :

The new size

clutter_gst_playback_set_filename ()

void                clutter_gst_playback_set_filename   (ClutterGstPlayback *self,
                                                         const gchar *filename);

Sets the source of self using a file path.

self :

a ClutterGstPlayback

filename :

A filename

clutter_gst_playback_set_progress ()

void                clutter_gst_playback_set_progress   (ClutterGstPlayback *self,
                                                         gdouble progress);

Sets the playback progress of self. The progress is a normalized value between 0.0 (begin) and 1.0 (end).

self :

a ClutterGstPlayback

progress :

the progress of the playback, between 0.0 and 1.0

clutter_gst_playback_set_seek_flags ()

void                clutter_gst_playback_set_seek_flags (ClutterGstPlayback *self,
                                                         ClutterGstSeekFlags flags);

Seeking can be done with several trade-offs. Clutter-gst defaults to CLUTTER_GST_SEEK_FLAG_NONE.

self :

a ClutterGstPlayback

flags :

a combination of ClutterGstSeekFlags

Since 1.4


clutter_gst_playback_set_subtitle_font_name ()

void                clutter_gst_playback_set_subtitle_font_name
                                                        (ClutterGstPlayback *self,
                                                         const char *font_name);

Sets the font used by the subtitle renderer. The font_name string must be either NULL, which means that the default font name of the underlying implementation will be used; or must follow the grammar recognized by pango_font_description_from_string() like:

self :

a ClutterGstPlayback

font_name :

a font name, or NULL to set the default font name

clutter_gst_playback_set_subtitle_track ()

void                clutter_gst_playback_set_subtitle_track
                                                        (ClutterGstPlayback *self,
                                                         gint index_);

Set the subtitles track to play. index_ is the index of the stream in the list returned by clutter_gst_playback_get_subtitle_tracks().

If index_ is -1, the subtitles are turned off.

self :

a ClutterGstPlayback

index_ :

the index of the subtitles track

Since 1.4


clutter_gst_playback_set_subtitle_uri ()

void                clutter_gst_playback_set_subtitle_uri
                                                        (ClutterGstPlayback *self,
                                                         const gchar *uri);

Sets the location of a subtitle file to display while playing self.

self :

a ClutterGstPlayback

uri :

the URI of a subtitle file

clutter_gst_playback_set_uri ()

void                clutter_gst_playback_set_uri        (ClutterGstPlayback *self,
                                                         const gchar *uri);

Sets the URI of self to uri.

self :

a ClutterGstPlayback

uri :

the URI of the media stream

clutter_gst_playback_set_user_agent ()

void                clutter_gst_playback_set_user_agent (ClutterGstPlayback *self,
                                                         const gchar *user_agent);

Sets the user agent to use when streaming.

When streaming content, you might want to set a custom user agent, eg. to promote your software, make it appear in statistics or because the server requires a special user agent you want to impersonate.

self :

a ClutterGstPlayback

user_agent :

the user agent

Since 1.4

Property Details

The "audio-stream" property

  "audio-stream"             gint                  : Read / Write

Index of the current audio stream.

Allowed values: >= -1

Default value: -1

Since 1.4


The "audio-streams" property

  "audio-streams"            gpointer              : Read

List of audio streams available on the current media.

Since 1.4


The "buffer-fill" property

  "buffer-fill"              gdouble               : Read

The fill level of the buffer for the current stream, as a value between 0.0 and 1.0.

Allowed values: [0,1]

Default value: 0


The "can-seek" property

  "can-seek"                 gboolean              : Read

Whether the current stream is seekable.

Default value: FALSE


The "duration" property

  "duration"                 gdouble               : Read

The duration of the current stream, in seconds

Allowed values: >= 0

Default value: 0


The "in-seek" property

  "in-seek"                  gboolean              : Read

Whether or not the stream is being seeked.

Default value: FALSE

Since 1.6


The "progress" property

  "progress"                 gdouble               : Read / Write

The current progress of the playback, as a normalized value between 0.0 and 1.0.

Allowed values: [0,1]

Default value: 0


The "seek-flags" property

  "seek-flags"               ClutterGstSeekFlags   : Read / Write

Flags to use when seeking.

Since 1.4


The "subtitle-font-name" property

  "subtitle-font-name"       gchar*                : Read / Write

The font used to display subtitles. The font description has to follow the same grammar as the one recognized by pango_font_description_from_string().

Default value: NULL


The "subtitle-track" property

  "subtitle-track"           gint                  : Read / Write

Current subtitle track being displayed.

Allowed values: >= -1

Default value: -1

Since 1.4


The "subtitle-tracks" property

  "subtitle-tracks"          gpointer              : Read

List of subtitle tracks available.

Since 1.4


The "subtitle-uri" property

  "subtitle-uri"             gchar*                : Read / Write

The location of a subtitle file, expressed as a valid URI.

Default value: NULL


The "uri" property

  "uri"                      gchar*                : Read / Write

The location of a media file, expressed as a valid URI.

Default value: NULL


The "user-agent" property

  "user-agent"               gchar*                : Read / Write

The User Agent used by ClutterGstPlayback with network protocols.

Default value: NULL

Since 1.4

Signal Details

The "should-buffer" signal

gboolean            user_function                      (ClutterGstPlayback *player,
                                                        GstQuery           *query,
                                                        gpointer            user_data)      : Run Last

The ::should-buffer signal is emitted every time the base class needs to decide whether it should continue buffering in download-buffering mode.

player :

the ClutterGstPlayback instance that received the signal

query :

A gst buffering query of format bytes

user_data :

user data set when the signal handler was connected.

Since 1.4