Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ![]() |
![]() |
![]() |
![]() |
ClutterGstPlaybackClutterGstPlayback — A ClutterGstPlayback to play media streams |
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
);
"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
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 { /* signals */ gboolean (* should_buffer) (ClutterGstPlayback *self, GstQuery *query); };
Base class for ClutterGstPlayback.
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()
.
|
a ClutterGstPlayback |
Returns : |
the index of the current audio stream, -1 if the media has no audio stream |
Since 1.4
GList * clutter_gst_playback_get_audio_streams
(ClutterGstPlayback *self
);
Get the list of audio streams of the current media.
|
a ClutterGstPlayback |
Returns : |
a list of strings describing the available audio streams. [transfer none][element-type utf8] |
Since 1.4
gint64 clutter_gst_playback_get_buffer_duration
(ClutterGstPlayback *self
);
Retrieves the buffer duration when buffering network streams.
|
a ClutterGstPlayback |
Returns : |
The buffer duration |
gdouble clutter_gst_playback_get_buffer_fill
(ClutterGstPlayback *self
);
Retrieves the amount of the stream that is buffered.
|
a ClutterGstPlayback |
Returns : |
the fill level, between 0.0 and 1.0 |
ClutterGstBufferingMode clutter_gst_playback_get_buffering_mode
(ClutterGstPlayback *self
);
|
a ClutterGstPlayback |
Returns : |
a ClutterGstBufferingMode |
Since 1.4
gint clutter_gst_playback_get_buffer_size
(ClutterGstPlayback *self
);
Retrieves the buffer size when buffering network streams.
|
a ClutterGstPlayback |
Returns : |
The buffer size |
gdouble clutter_gst_playback_get_duration (ClutterGstPlayback *self
);
Retrieves the duration of the media stream that self
represents.
|
a ClutterGstPlayback |
Returns : |
the duration of the media stream, in seconds |
gboolean clutter_gst_playback_get_in_seek (ClutterGstPlayback *self
);
Whether the player is seeking.
|
a ClutterGstPlayback |
Returns : |
TRUE if the player is seeking, FALSE otherwise. |
Since 1.6
gdouble clutter_gst_playback_get_progress (ClutterGstPlayback *self
);
Retrieves the playback progress of self
.
|
a ClutterGstPlayback |
Returns : |
the playback progress, between 0.0 and 1.0 |
ClutterGstSeekFlags clutter_gst_playback_get_seek_flags (ClutterGstPlayback *self
);
Get the current value of the seek-flags property.
|
a ClutterGstPlayback |
Returns : |
a combination of ClutterGstSeekFlags |
Since 1.4
gchar * clutter_gst_playback_get_subtitle_font_name
(ClutterGstPlayback *self
);
Retrieves the font name currently used.
|
a ClutterGstPlayback |
Returns : |
a string containing the font name. Use g_free()
to free the returned string |
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()
.
|
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
GList * clutter_gst_playback_get_subtitle_tracks
(ClutterGstPlayback *self
);
Get the list of subtitles tracks of the current media.
|
a ClutterGstPlayback |
Returns : |
a list of strings describing the available subtitles tracks. [transfer none][element-type utf8] |
Since 1.4
gchar * clutter_gst_playback_get_subtitle_uri
(ClutterGstPlayback *self
);
Retrieves the URI of the subtitle file in use.
|
a ClutterGstPlayback |
Returns : |
the URI of the subtitle file. Use g_free()
to free the returned string |
gchar * clutter_gst_playback_get_uri (ClutterGstPlayback *self
);
Retrieves the URI from self
.
|
a ClutterGstPlayback |
Returns : |
the URI of the media stream. Use g_free()
to free the returned string |
gchar * clutter_gst_playback_get_user_agent (ClutterGstPlayback *self
);
Retrieves the user agent used when streaming.
|
a ClutterGstPlayback |
Returns : |
the user agent used. The returned string has to be freed with
g_free()
|
Since 1.4
gboolean clutter_gst_playback_is_live_media (ClutterGstPlayback *self
);
Whether the player is using a live media.
|
a ClutterGstPlayback |
Returns : |
TRUE if the player is using a live media, FALSE otherwise. |
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()
.
|
a ClutterGstPlayback |
|
the index of the audio stream |
Since 1.4
void clutter_gst_playback_set_buffer_duration (ClutterGstPlayback *self
,gint64 duration
);
Sets the buffer duration to be used when buffering network streams.
|
a ClutterGstPlayback |
|
The new duration |
void clutter_gst_playback_set_buffering_mode (ClutterGstPlayback *self
,ClutterGstBufferingMode mode
);
|
a ClutterGstPlayback |
|
a ClutterGstBufferingMode |
Since 1.4
void clutter_gst_playback_set_buffer_size (ClutterGstPlayback *self
,gint size
);
Sets the buffer size to be used when buffering network streams.
|
a ClutterGstPlayback |
|
The new size |
void clutter_gst_playback_set_filename (ClutterGstPlayback *self
,const gchar *filename
);
Sets the source of self
using a file path.
|
a ClutterGstPlayback |
|
A filename |
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).
|
a ClutterGstPlayback |
|
the progress of the playback, between 0.0 and 1.0 |
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
.
|
a ClutterGstPlayback |
|
a combination of ClutterGstSeekFlags |
Since 1.4
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:
1 |
clutter_gst_playback_set_subtitle_font_name (player, "Sans 24pt"); |
|
a ClutterGstPlayback |
|
a font name, or NULL to set the default font name |
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.
|
a ClutterGstPlayback |
|
the index of the subtitles track |
Since 1.4
void clutter_gst_playback_set_subtitle_uri (ClutterGstPlayback *self
,const gchar *uri
);
Sets the location of a subtitle file to display while playing self
.
|
a ClutterGstPlayback |
|
the URI of a subtitle file |
void clutter_gst_playback_set_uri (ClutterGstPlayback *self
,const gchar *uri
);
Sets the URI of self
to uri
.
|
a ClutterGstPlayback |
|
the URI of the media stream |
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.
|
a ClutterGstPlayback |
|
the user agent |
Since 1.4
"audio-stream"
property "audio-stream" gint : Read / Write
Index of the current audio stream.
Allowed values: >= -1
Default value: -1
Since 1.4
"audio-streams"
property "audio-streams" gpointer : Read
List of audio streams available on the current media.
Since 1.4
"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
"can-seek"
property "can-seek" gboolean : Read
Whether the current stream is seekable.
Default value: FALSE
"duration"
property "duration" gdouble : Read
The duration of the current stream, in seconds
Allowed values: >= 0
Default value: 0
"in-seek"
property "in-seek" gboolean : Read
Whether or not the stream is being seeked.
Default value: FALSE
Since 1.6
"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
"seek-flags"
property "seek-flags" ClutterGstSeekFlags : Read / Write
Flags to use when seeking.
Since 1.4
"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
"subtitle-track"
property "subtitle-track" gint : Read / Write
Current subtitle track being displayed.
Allowed values: >= -1
Default value: -1
Since 1.4
"subtitle-tracks"
property "subtitle-tracks" gpointer : Read
List of subtitle tracks available.
Since 1.4
"subtitle-uri"
property "subtitle-uri" gchar* : Read / Write
The location of a subtitle file, expressed as a valid URI.
Default value: NULL
"uri"
property "uri" gchar* : Read / Write
The location of a media file, expressed as a valid URI.
Default value: NULL
"user-agent"
property "user-agent" gchar* : Read / Write
The User Agent used by ClutterGstPlayback with network protocols.
Default value: NULL
Since 1.4
"should-buffer"
signalgboolean 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.
|
the ClutterGstPlayback instance that received the signal |
|
A gst buffering query of format bytes |
|
user data set when the signal handler was connected. |
Since 1.4