Top | ![]() |
![]() |
![]() |
![]() |
BvwAudioOutputType | audio-output-type | Read / Write |
gint64 | av-offset | Read / Write |
int | brightness | Read / Write |
int | contrast | Read / Write |
gboolean | deinterlacing | Read / Write |
char * | download-filename | Read / Write |
int | hue | Read / Write |
gboolean | playing | Read |
double | position | Read |
char * | referrer | Read / Write |
int | saturation | Read / Write |
gboolean | seekable | Read |
gboolean | show-cursor | Read / Write |
gint64 | stream-length | Read |
char * | user-agent | Read / Write |
double | volume | Read / Write |
void | buffering | Run Last |
void | channels-change | Run Last |
void | download-buffering | Run Last |
void | eos | Run Last |
void | error | Run Last |
void | got-metadata | Run Last |
void | got-redirect | Run Last |
void | languages-changed | Run Last |
gboolean | missing-plugins | Run Last |
void | play-starting | Run Last |
void | subtitles-changed | Run Last |
void | tick | Run Last |
BaconVideoWidget | |
enum | BvwAspectRatio |
enum | BvwAudioOutputType |
enum | BvwDVDEvent |
BvwLangInfo | |
enum | BvwMetadataType |
enum | BvwRotation |
enum | BvwTrackType |
enum | BvwVideoProperty |
enum | BvwZoomMode |
enum | BvwError |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkOverlay ╰── BaconVideoWidget
BaconVideoWidget is a widget to play audio or video streams It has a GStreamer backend, and abstracts away the differences to provide a simple interface to the functionality required by Totem. It handles all the low-level audio and video work for Totem (or passes the work off to the backend).
GtkWidget *
bacon_video_widget_new (void
);
Creates a new BaconVideoWidget.
gboolean bacon_video_widget_check_init (BaconVideoWidget *bvw
,GError **error
);
void bacon_video_widget_open (BaconVideoWidget *bvw
,const char *mrl
);
Opens the given mrl
in bvw
for playing.
The MRL is loaded and waiting to be played with bacon_video_widget_play()
.
gboolean bacon_video_widget_play (BaconVideoWidget *bvw
,GError **error
);
Plays the currently-loaded video in bvw
.
Errors from the GStreamer backend will be returned asynchronously via the
“error” signal, even if this function returns TRUE
.
void
bacon_video_widget_pause (BaconVideoWidget *bvw
);
Pauses the current stream in the video widget.
If a live stream is being played, playback is stopped entirely.
gboolean bacon_video_widget_seek (BaconVideoWidget *bvw
,double position
,GError **error
);
Seeks the currently-playing stream to position
as a percentage of the total
stream length.
gboolean bacon_video_widget_seek_time (BaconVideoWidget *bvw
,gint64 _time
,gboolean accurate
,GError **error
);
Seeks the currently-playing stream to the absolute position time
, in milliseconds.
void
bacon_video_widget_stop (BaconVideoWidget *bvw
);
Stops playing the current stream and resets to the first position in the stream.
void
bacon_video_widget_close (BaconVideoWidget *bvw
);
Closes the current stream and frees the resources associated with it.
gboolean
bacon_video_widget_can_direct_seek (BaconVideoWidget *bvw
);
Determines whether direct seeking is possible for the current stream.
gboolean bacon_video_widget_can_get_frames (BaconVideoWidget *bvw
,GError **error
);
Determines whether individual frames from the current stream can
be returned using bacon_video_widget_get_current_frame()
.
Frames cannot be returned for audio-only streams.
gboolean
bacon_video_widget_can_set_volume (BaconVideoWidget *bvw
);
Returns whether the volume level can be set, given the current settings.
The volume cannot be set if the audio output type is set to
BVW_AUDIO_SOUND_AC3PASSTHRU
.
void bacon_video_widget_dvd_event (BaconVideoWidget *bvw
,BvwDVDEvent type
);
Issues a DVD navigation event to the video widget, such as one to skip to the next chapter, or navigate to the DVD title menu.
This is a no-op if the current stream is not navigable.
gboolean
bacon_video_widget_has_menus (BaconVideoWidget *bvw
);
Returns whether the widget is currently displaying a menu, such as a DVD menu.
BvwAspectRatio
bacon_video_widget_get_aspect_ratio (BaconVideoWidget *bvw
);
Returns the current aspect ratio used by the widget, from BvwAspectRatio.
void bacon_video_widget_set_aspect_ratio (BaconVideoWidget *bvw
,BvwAspectRatio ratio
);
Sets the aspect ratio used by the widget, from BvwAspectRatio.
Changes to this take effect immediately.
BvwAudioOutputType
bacon_video_widget_get_audio_output_type
(BaconVideoWidget *bvw
);
Returns the current audio output type (e.g. how many speaker channels) from BvwAudioOutputType.
void bacon_video_widget_set_audio_output_type (BaconVideoWidget *bvw
,BvwAudioOutputType type
);
Sets the audio output type (number of speaker channels) in the video widget.
GdkPixbuf *
bacon_video_widget_get_current_frame (BaconVideoWidget *bvw
);
Returns a GdkPixbuf containing the current frame from the playing stream. This will wait for any pending seeks to complete before capturing the frame.
gint64
bacon_video_widget_get_current_time (BaconVideoWidget *bvw
);
Returns the current position in the stream, as the time (in milliseconds) since the beginning of the stream.
gboolean
bacon_video_widget_get_deinterlacing (BaconVideoWidget *bvw
);
Returns whether deinterlacing of videos is enabled for this widget.
void bacon_video_widget_set_deinterlacing (BaconVideoWidget *bvw
,gboolean deinterlace
);
Sets whether the widget should deinterlace videos.
GList *
bacon_video_widget_get_languages (BaconVideoWidget *bvw
);
Returns a list of BvwLangInfo for each audio track.
void
bacon_video_widget_lang_info_free (BvwLangInfo *info
);
Frees a BvwLangInfo structure.
int
bacon_video_widget_get_language (BaconVideoWidget *bvw
);
Returns the id of the current audio language.
If the widget is not playing, or the default language is in use, -1
will be returned.
void bacon_video_widget_set_language (BaconVideoWidget *bvw
,int language
);
Sets the audio language id for bvw
.
void bacon_video_widget_get_metadata (BaconVideoWidget *bvw
,BvwMetadataType type
,GValue *value
);
Provides metadata of the given type
about the current stream in value
.
Free the GValue with g_value_unset()
.
GOptionGroup *
bacon_video_widget_get_option_group (void
);
Returns the GOptionGroup containing command-line options for BaconVideoWidget.
Applications must call either this exactly once.
double
bacon_video_widget_get_position (BaconVideoWidget *bvw
);
Returns the current position in the stream, as a value between
0
and 1
.
void bacon_video_widget_set_referrer (BaconVideoWidget *bvw
,const char *referrer
);
Sets the HTTP referrer URI to use when fetching HTTP ressources.
BvwRotation
bacon_video_widget_get_rotation (BaconVideoWidget *bvw
);
Returns the angle of rotation of the video, in degrees.
void bacon_video_widget_set_rotation (BaconVideoWidget *bvw
,BvwRotation rotation
);
Sets the rotation to be applied to the video when it is displayed.
gint64
bacon_video_widget_get_stream_length (BaconVideoWidget *bvw
);
Returns the total length of the stream, in milliseconds.
GList *
bacon_video_widget_get_subtitles (BaconVideoWidget *bvw
);
Returns a list of BvwLangInfo for each subtitle track.
int
bacon_video_widget_get_subtitle (BaconVideoWidget *bvw
);
Returns the id of the current subtitles.
void bacon_video_widget_set_subtitle (BaconVideoWidget *bvw
,int subtitle
);
Sets the subtitle id for bvw
.
void bacon_video_widget_set_text_subtitle (BaconVideoWidget *bvw
,const gchar *subtitle_uri
);
Sets the URI for the text subtitle file to be displayed alongside
the current video. Use NULL
if you want to unload the current text subtitle
file being used.
void bacon_video_widget_set_subtitle_encoding (BaconVideoWidget *bvw
,const char *encoding
);
Sets the encoding system for the subtitles, so that they can be decoded properly.
void bacon_video_widget_set_subtitle_font (BaconVideoWidget *bvw
,const char *font
);
Sets the font size and style in which to display subtitles.
font
is a Pango font description string, as understood by
pango_font_description_from_string()
.
void bacon_video_widget_set_user_agent (BaconVideoWidget *bvw
,const char *user_agent
);
Sets the HTTP user agent string to use when fetching HTTP ressources.
int bacon_video_widget_get_video_property (BaconVideoWidget *bvw
,BvwVideoProperty type
);
Returns the given property of the video display, such as its brightness or saturation.
It is returned as a percentage in the full range of integer values; from 0
to 65535
(inclusive), where 32768
is the default.
void bacon_video_widget_set_video_property (BaconVideoWidget *bvw
,BvwVideoProperty type
,int value
);
Sets the given property of the video display, such as its brightness or saturation.
It should be given as a percentage in the full range of integer values; from 0
to 65535
(inclusive), where 32768
is the default.
double
bacon_video_widget_get_volume (BaconVideoWidget *bvw
);
Returns the current volume level, as a percentage between 0
and 1
.
void bacon_video_widget_set_volume (BaconVideoWidget *bvw
,double volume
);
Sets the volume level of the stream as a percentage between 0
and 1
.
If bacon_video_widget_can_set_volume()
returns FALSE
, this is a no-op.
BvwZoomMode
bacon_video_widget_get_zoom (BaconVideoWidget *bvw
);
Returns the zoom mode applied to videos displayed by the widget.
void bacon_video_widget_set_zoom (BaconVideoWidget *bvw
,BvwZoomMode mode
);
Sets the zoom type applied to the video when it is displayed.
gboolean
bacon_video_widget_has_angles (BaconVideoWidget *bvw
);
Returns whether the widget is currently playing a stream with multiple angles.
void
bacon_video_widget_set_next_angle (BaconVideoWidget *bvw
);
Select the next angle, or video track in the playing stream.
gboolean
bacon_video_widget_has_next_track (BaconVideoWidget *bvw
);
Determines whether there is another track after the current one, typically as a chapter on a DVD.
gboolean
bacon_video_widget_has_previous_track (BaconVideoWidget *bvw
);
Determines whether there is another track before the current one, typically as a chapter on a DVD.
gboolean
bacon_video_widget_is_playing (BaconVideoWidget *bvw
);
Returns whether the widget is currently playing a stream.
gboolean
bacon_video_widget_is_seekable (BaconVideoWidget *bvw
);
Returns whether seeking is possible in the current stream.
If no stream is loaded, FALSE
is returned.
gfloat
bacon_video_widget_get_rate (BaconVideoWidget *bvw
);
Get the current playback rate, with 1.0 being normal rate.
gboolean bacon_video_widget_set_rate (BaconVideoWidget *bvw
,gfloat new_rate
);
Sets the current playback rate.
gboolean bacon_video_widget_step (BaconVideoWidget *bvw
,gboolean forward
,GError **error
);
Step one frame forward, if forward
is TRUE
, or backwards, if forward
is FALSE
void
bacon_video_widget_set_next_language (BaconVideoWidget *bvw
);
Switch to the next audio language for the current video. See
bacon_video_widget_set_language()
.
Since: 3.12
void
bacon_video_widget_set_next_subtitle (BaconVideoWidget *bvw
);
Switch to the next text subtitle for the current video. See
bacon_video_widget_set_subtitle()
.
Since: 3.12
The pixel aspect ratios available in which to display videos using
.bacon_video_widget_set_aspect_ratio()
The audio output types available for use with bacon_video_widget_set_audio_output_type()
.
The DVD navigation actions available to fire as DVD events to the BaconVideoWidget.
root menu |
||
title menu |
||
subpicture menu (if available) |
||
audio menu (if available) |
||
angle menu (if available) |
||
chapter menu |
||
the next chapter |
||
the previous chapter |
||
the next title in the current chapter |
||
the previous title in the current chapter |
||
go up in the menu |
||
go down in the menu |
||
go left in the menu |
||
go right in the menu |
||
select the current menu entry |
typedef struct { char *title; char *language; char *codec; guint id; } BvwLangInfo;
BvwLangInfo holds the title, language code and codec for each subtitle or audio track for a media, which would allow the front-ends to present appropriate information to the user.
The different metadata available for querying from a BaconVideoWidget
stream with bacon_video_widget_get_metadata()
.
the stream's title |
||
the artist who created the work |
||
the year in which the work was created |
||
a comment attached to the stream |
||
the album in which the work was released |
||
the stream's duration, in seconds |
||
the track number of the work on the album |
||
the type of stream container |
||
whether the stream has video |
||
the video's width, in pixels |
||
the video's height, in pixels |
||
the video's bitrate, in kilobits per second |
||
the video's codec |
||
the number of frames per second in the video |
||
whether the stream has audio |
||
the audio's bitrate, in kilobits per second |
||
the audio's codec |
||
the audio sample rate, in bits per second |
||
a string describing the number of audio channels in the stream |
The rotation is used by the video widget, as set by
bacon_video_widget_set_rotation()
.
The video properties queryable with bacon_video_widget_get_video_property()
,
and settable with bacon_video_widget_set_video_property()
.
Error codes for BaconVideoWidget operations.
A required GStreamer plugin is missing. |
||
The movie file is broken and cannot be decoded. |
||
A generic error for problems with movie files. |
||
Permission was refused to access the stream, or authentication was required. |
||
The stream is encrypted and cannot be played. |
||
The stream cannot be found. |
||
The DVD is encrypted and libdvdcss is not installed. |
||
The device given in an MRL (e.g. DVD drive or DVB tuner) did not exist. |
||
The host for a given stream could not be resolved. |
||
The host for a given stream could not be reached. |
||
The server for a given stream refused the connection. |
||
An MRL was malformed, or CDDB playback was attempted (which is now unsupported). |
||
A generic error occurred. |
||
The audio or video codec required by the stream is not supported. |
||
Error determining frame capture support for a video with |
||
A generic error for problems reading streams. |
||
A library or plugin could not be loaded. |
||
A movie file was empty. |
“audio-output-type”
property“audio-output-type” BvwAudioOutputType
The type of audio output to use (e.g. the number of channels).
Owner: BaconVideoWidget
Flags: Read / Write
Default value: BVW_AUDIO_SOUND_STEREO
“av-offset”
property“av-offset” gint64
Control the synchronisation offset between the audio and video streams. Positive values make the audio ahead of the video and negative values make the audio go behind the video.
Owner: BaconVideoWidget
Flags: Read / Write
Default value: 0
“brightness”
property “brightness” int
The brightness of the video display.
Owner: BaconVideoWidget
Flags: Read / Write
Allowed values: [0,65535]
Default value: 32768
“contrast”
property “contrast” int
The contrast of the video display.
Owner: BaconVideoWidget
Flags: Read / Write
Allowed values: [0,65535]
Default value: 32768
“deinterlacing”
property“deinterlacing” gboolean
Whether to automatically deinterlace videos.
Owner: BaconVideoWidget
Flags: Read / Write
Default value: FALSE
“download-filename”
property “download-filename” char *
The filename of the fully downloaded stream when using download buffering.
Owner: BaconVideoWidget
Flags: Read / Write
Default value: NULL
“hue”
property “hue” int
The hue of the video display.
Owner: BaconVideoWidget
Flags: Read / Write
Allowed values: [0,65535]
Default value: 32768
“playing”
property“playing” gboolean
Whether a stream is currently playing.
Owner: BaconVideoWidget
Flags: Read
Default value: FALSE
“position”
property “position” double
The current position in the stream, as a percentage between 0
and 1
.
Owner: BaconVideoWidget
Flags: Read
Allowed values: [0,1]
Default value: 0
“referrer”
property “referrer” char *
The HTTP referrer URI.
Owner: BaconVideoWidget
Flags: Read / Write
Default value: NULL
“saturation”
property “saturation” int
The saturation of the video display.
Owner: BaconVideoWidget
Flags: Read / Write
Allowed values: [0,65535]
Default value: 32768
“seekable”
property“seekable” gboolean
Whether the current stream can be seeked.
Owner: BaconVideoWidget
Flags: Read
Default value: FALSE
“show-cursor”
property“show-cursor” gboolean
Whether the mouse cursor is shown.
Owner: BaconVideoWidget
Flags: Read / Write
Default value: FALSE
“stream-length”
property“stream-length” gint64
The length of the current stream, in milliseconds.
Owner: BaconVideoWidget
Flags: Read
Allowed values: >= 0
Default value: 0
“user-agent”
property “user-agent” char *
The HTTP user agent string to use.
Owner: BaconVideoWidget
Flags: Read / Write
Default value: NULL
“buffering”
signalvoid user_function (BaconVideoWidget *bvw, double percentage, gpointer user_data)
Emitted regularly when a network stream is being buffered, to provide status updates on the buffering progress.
bvw |
the BaconVideoWidget which received the signal |
|
percentage |
the percentage of buffering completed, between |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“channels-change”
signalvoid user_function (BaconVideoWidget *bvw, gpointer user_data)
Emitted when the number of audio languages available changes, or when the selected audio language is changed.
Query the new list of audio languages with bacon_video_widget_get_languages()
.
bvw |
the BaconVideoWidget which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“download-buffering”
signalvoid user_function (BaconVideoWidget *bvw, double percentage, gpointer user_data)
Emitted regularly when a network stream is being cached on disk, to provide status updates on the buffering level of the stream.
bvw |
the BaconVideoWidget which received the signal |
|
percentage |
the percentage of download buffering completed, between |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“eos”
signalvoid user_function (BaconVideoWidget *bvw, gpointer user_data)
Emitted when the end of the current stream is reached.
bvw |
the BaconVideoWidget which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“error”
signalvoid user_function (BaconVideoWidget *bvw, char *message, gboolean playback_stopped, gpointer user_data)
Emitted when the backend wishes to asynchronously report an error. If fatal
is TRUE
,
playback of this stream cannot be restarted.
bvw |
the BaconVideoWidget which received the signal |
|
message |
the error message |
|
playback_stopped |
|
|
fatal |
||
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“got-metadata”
signalvoid user_function (BaconVideoWidget *bvw, gpointer user_data)
Emitted when the widget has updated the metadata of the current stream. This will typically happen just after opening a stream.
Call bacon_video_widget_get_metadata()
to query the updated metadata.
bvw |
the BaconVideoWidget which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“got-redirect”
signalvoid user_function (BaconVideoWidget *bvw, char *new_mrl, gpointer user_data)
Emitted when a redirect response is received from a stream's server.
bvw |
the BaconVideoWidget which received the signal |
|
new_mrl |
the new MRL |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“languages-changed”
signalvoid user_function (BaconVideoWidget *bvw, gpointer user_data)
Emitted when the list of languages/audio tracks has changed.
bvw |
the BaconVideoWidget which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“missing-plugins”
signalgboolean user_function (BaconVideoWidget *bvw, GStrv details, GStrv descriptions, gboolean playing, gpointer user_data)
Emitted when plugins required to play the current stream are not found. This allows the application to request the user install them before proceeding to try and play the stream again.
Note that this signal is only available for the GStreamer backend.
bvw |
the BaconVideoWidget which received the signal |
|
details |
a |
|
descriptions |
a |
|
playing |
|
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“play-starting”
signalvoid user_function (BaconVideoWidget *bvw, gpointer user_data)
Emitted when a movie will start playing, meaning it's not buffering, or paused waiting for plugins to be installed, drives to be mounted or authentication to succeed.
This usually means that OSD popups can be hidden.
bvw |
the BaconVideoWidget which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“subtitles-changed”
signalvoid user_function (BaconVideoWidget *bvw, gpointer user_data)
Emitted when the list of subtitle tracks has changed.
bvw |
the BaconVideoWidget which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“tick”
signalvoid user_function (BaconVideoWidget *bvw, gint64 current_time, gint64 stream_length, double current_position, gboolean seekable, gpointer user_data)
Emitted every time an important time event happens, or at regular intervals when playing a stream.
bvw |
the BaconVideoWidget which received the signal |
|
current_time |
the current position in the stream, in milliseconds since the beginning of the stream |
|
stream_length |
the length of the stream, in milliseconds |
|
current_position |
the current position in the stream, as a percentage between |
|
seekable |
||
user_data |
user data set when the signal handler was connected. |
Flags: Run Last