Top | ![]() |
![]() |
![]() |
![]() |
GtkMediaFile is the implementation for media file usage with GtkMediaStream.
This provides a simple way to play back video files with GTK.
GTK+ provides a GIO extension point for GtkMediaFile implementations to allow for external implementations using various media frameworks. GTK+ itself includes implementations using GStreamer and ffmpeg.
GtkMediaStream *
gtk_media_file_new_for_filename (const char *filename
);
This is a utility function that converts the given filename
to a GFile and calls gtk_media_file_new_for_file()
.
GtkMediaStream *
gtk_media_file_new_for_resource (const char *resource_path
);
This is a utility function that converts the given resource
to a GFile and calls gtk_media_file_new_for_file()
.
GtkMediaStream *
gtk_media_file_new_for_file (GFile *file
);
Creates a new media file to play file
.
GtkMediaStream *
gtk_media_file_new_for_input_stream (GInputStream *stream
);
Creates a new media file to play stream
. If you want the
resulting media to be seekable, the stream should implement
the GSeekable interface.
void
gtk_media_file_clear (GtkMediaFile *self
);
Resets the media file to be empty.
void gtk_media_file_set_filename (GtkMediaFile *self
,const char *filename
);
This is a utility function that converts the given filename
to a GFile and calls gtk_media_file_set_file()
.
void gtk_media_file_set_resource (GtkMediaFile *self
,const char *resource_path
);
This is a utility function that converts the given resource_path
to a GFile and calls gtk_media_file_set_file()
.
void gtk_media_file_set_file (GtkMediaFile *self
,GFile *file
);
If any file is still playing, stop playing it.
Then start playing the given file
.
GFile *
gtk_media_file_get_file (GtkMediaFile *self
);
Returns the file that self
is currently playing from.
When self
is not playing or not playing from a file,
NULL
is returned.
void gtk_media_file_set_input_stream (GtkMediaFile *self
,GInputStream *stream
);
If anything is still playing, stop playing it. Then start
playing the given stream
.
Full control about the stream
is assumed for the duration of
playback. The stream will not bt be closed.
GInputStream *
gtk_media_file_get_input_stream (GtkMediaFile *self
);
Returns the stream that self
is currently playing from.
When self
is not playing or not playing from a stream,
NULL
is returned.
The currently playing stream or NULL
if not
playing from a stream.
[nullable][transfer none]
“file”
property“file” GFile *
The file being played back or NULL
if not playing a file.
Flags: Read / Write
“input-stream”
property“input-stream” GInputStream *
The stream being played back or NULL
if not playing a stream, like when playing a file.
Flags: Read / Write