Commit 223e3def authored by Philip Withnall's avatar Philip Withnall

Bug 577947 – BaconVideoWidget API documentation

Added full API documentation to BaconVideoWidget.
parent 9dc8ce3d
......@@ -58,6 +58,12 @@ IGNORE_HFILES = \
totemplaylist-marshal.h \
totemvideolist-marshal.h
# Files we don't want exported to plugins
IGNORE_HFILES += \
bacon-video-widget-common.h \
baconvideowidget-marshal.h \
bacon-video-widget-gst-missing-plugins.h
# Plugin files
IGNORE_HFILES += \
bacon-video-widget-properties.h \
......@@ -92,6 +98,7 @@ expand_content_files=
GTKDOC_CFLAGS = \
-I$(top_srcdir)/ \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/backend \
-I$(top_srcdir)/src/plugins \
$(DEPENDENCY_CFLAGS)
GTKDOC_LIBS = \
......
......@@ -18,6 +18,7 @@
<xi:include href="xml/totem-object.xml"/>
<xi:include href="xml/totem-interface.xml"/>
<xi:include href="xml/totem-plugin.xml"/>
<xi:include href="xml/bacon-video-widget.xml"/>
</chapter>
<chapter id="widget-api">
<title>Widgets</title>
......
......@@ -119,3 +119,89 @@ TOTEM_IS_CELL_RENDERER_VIDEO_CLASS
TotemCellRendererVideoPrivate
</SECTION>
<SECTION>
<FILE>bacon-video-widget</FILE>
<TITLE>BaconVideoWidget</TITLE>
BaconVideoWidget
BaconVideoWidgetClass
BvwAspectRatio
BvwAudioOutType
BvwDVDEvent
BvwMetadataType
BvwVideoProperty
BvwError
BvwUseType
bacon_video_widget_new
bacon_video_widget_init_backend
bacon_video_widget_open
bacon_video_widget_play
bacon_video_widget_pause
bacon_video_widget_seek
bacon_video_widget_seek_time
bacon_video_widget_stop
bacon_video_widget_close
bacon_video_widget_can_deinterlace
bacon_video_widget_can_direct_seek
bacon_video_widget_can_get_frames
bacon_video_widget_can_set_volume
bacon_video_widget_dvd_event
bacon_video_widget_get_aspect_ratio
bacon_video_widget_set_aspect_ratio
bacon_video_widget_get_audio_out_type
bacon_video_widget_set_audio_out_type
bacon_video_widget_get_auto_resize
bacon_video_widget_set_auto_resize
bacon_video_widget_get_backend_name
bacon_video_widget_get_connection_speed
bacon_video_widget_set_connection_speed
bacon_video_widget_get_current_frame
bacon_video_widget_get_current_time
bacon_video_widget_get_deinterlacing
bacon_video_widget_set_deinterlacing
bacon_video_widget_set_fullscreen
bacon_video_widget_get_languages
bacon_video_widget_get_language
bacon_video_widget_set_language
bacon_video_widget_set_logo
bacon_video_widget_get_logo_mode
bacon_video_widget_set_logo_mode
bacon_video_widget_set_logo_pixbuf
bacon_video_widget_get_metadata
bacon_video_widget_get_mrls
bacon_video_widget_get_option_group
bacon_video_widget_get_position
bacon_video_widget_set_scale_ratio
bacon_video_widget_get_show_cursor
bacon_video_widget_set_show_cursor
bacon_video_widget_set_show_visuals
bacon_video_widget_get_stream_length
bacon_video_widget_get_subtitles
bacon_video_widget_get_subtitle
bacon_video_widget_set_subtitle
bacon_video_widget_set_subtitle_encoding
bacon_video_widget_set_subtitle_font
bacon_video_widget_get_video_property
bacon_video_widget_set_video_property
bacon_video_widget_get_visuals_list
bacon_video_widget_set_visuals
bacon_video_widget_set_visuals_quality
bacon_video_widget_get_volume
bacon_video_widget_set_volume
bacon_video_widget_get_zoom
bacon_video_widget_set_zoom
bacon_video_widget_has_next_track
bacon_video_widget_has_previous_track
bacon_video_widget_is_playing
bacon_video_widget_is_seekable
<SUBSECTION Standard>
bacon_video_widget_error_quark
bacon_video_widget_get_type
BACON_TYPE_VIDEO_WIDGET
BACON_VIDEO_WIDGET
BACON_VIDEO_WIDGET_CLASS
BACON_IS_VIDEO_WIDGET
BACON_IS_VIDEO_WIDGET_CLASS
<SUBSECTION Private>
BaconVideoWidgetPrivate
BaconVideoWidgetCommon
</SECTION>
......@@ -2,8 +2,10 @@
#include "totem.h"
#include "totem-cell-renderer-video.h"
#include "totem-video-list.h"
#include "bacon-video-widget.h"
totem_plugin_get_type
totem_object_get_type
totem_cell_renderer_video_get_type
totem_video_list_get_type
bacon_video_widget_get_type
This diff is collapsed.
......@@ -2613,9 +2613,9 @@ gboolean bacon_video_widget_seek (BaconVideoWidget *bvw,
}
gboolean bacon_video_widget_seek_time (BaconVideoWidget *bvw, gint64 time,
GError **gerror)
GError **error)
{
int error, speed, status;
int error_num, speed, status;
gint64 length;
g_return_val_if_fail (bvw != NULL, -1);
......@@ -2644,11 +2644,11 @@ gboolean bacon_video_widget_seek_time (BaconVideoWidget *bvw, gint64 time,
return TRUE;
}
error = xine_play (bvw->priv->stream, 0, CLAMP (time, 0, length));
error_num = xine_play (bvw->priv->stream, 0, CLAMP (time, 0, length));
if (error == 0)
if (error_num == 0)
{
xine_error (bvw, gerror);
xine_error (bvw, error);
return FALSE;
}
......
......@@ -44,13 +44,25 @@ G_BEGIN_DECLS
typedef struct BaconVideoWidgetPrivate BaconVideoWidgetPrivate;
typedef struct BaconVideoWidgetCommon BaconVideoWidgetCommon;
/**
* BaconVideoWidget:
*
* All the fields in the #BaconVideoWidget structure are private and should never be accessed directly.
**/
typedef struct {
/*< private >*/
GtkEventBox parent;
BaconVideoWidgetCommon *com;
BaconVideoWidgetPrivate *priv;
} BaconVideoWidget;
/**
* BaconVideoWidgetClass:
*
* All the fields in the #BaconVideoWidgetClass structure are private and should never be accessed directly.
**/
typedef struct {
/*< private >*/
GtkEventBoxClass parent_class;
void (*error) (GtkWidget *bvw, const char *message,
......@@ -65,6 +77,34 @@ typedef struct {
void (*buffering) (GtkWidget *bvw, guint progress);
} BaconVideoWidgetClass;
/**
* BvwError:
* @BVW_ERROR_AUDIO_PLUGIN: Error loading audio output plugin or device.
* @BVW_ERROR_NO_PLUGIN_FOR_FILE: A required GStreamer plugin or xine feature is missing.
* @BVW_ERROR_VIDEO_PLUGIN: Error loading video output plugin or device.
* @BVW_ERROR_AUDIO_BUSY: Audio output device is busy.
* @BVW_ERROR_BROKEN_FILE: The movie file is broken and cannot be decoded.
* @BVW_ERROR_FILE_GENERIC: A generic error for problems with movie files.
* @BVW_ERROR_FILE_PERMISSION: Permission was refused to access the stream, or authentication was required.
* @BVW_ERROR_FILE_ENCRYPTED: The stream is encrypted and cannot be played.
* @BVW_ERROR_FILE_NOT_FOUND: The stream cannot be found.
* @BVW_ERROR_DVD_ENCRYPTED: The DVD is encrypted and libdvdcss is not installed.
* @BVW_ERROR_INVALID_DEVICE: The device given in an MRL (e.g. DVD drive or DVB tuner) did not exist.
* @BVW_ERROR_DEVICE_BUSY: The device was busy.
* @BVW_ERROR_UNKNOWN_HOST: The host for a given stream could not be resolved.
* @BVW_ERROR_NETWORK_UNREACHABLE: The host for a given stream could not be reached.
* @BVW_ERROR_CONNECTION_REFUSED: The server for a given stream refused the connection.
* @BVW_ERROR_INVALID_LOCATION: An MRL was malformed, or CDDB playback was attempted (which is now unsupported).
* @BVW_ERROR_GENERIC: A generic error occurred.
* @BVW_ERROR_CODEC_NOT_HANDLED: The audio or video codec required by the stream is not supported.
* @BVW_ERROR_AUDIO_ONLY: An audio-only stream could not be played due to missing audio output support.
* @BVW_ERROR_CANNOT_CAPTURE: Error determining frame capture support for a video with bacon_video_widget_can_get_frames().
* @BVW_ERROR_READ_ERROR: A generic error for problems reading streams.
* @BVW_ERROR_PLUGIN_LOAD: A library or plugin could not be loaded.
* @BVW_ERROR_EMPTY_FILE: A movie file was empty.
*
* Error codes for #BaconVideoWidget operations.
**/
typedef enum {
/* Plugins */
BVW_ERROR_AUDIO_PLUGIN,
......@@ -102,6 +142,17 @@ GOptionGroup* bacon_video_widget_get_option_group (void);
/* This can be used if the app does not use popt */
void bacon_video_widget_init_backend (int *argc, char ***argv);
/**
* BvwUseType:
* @BVW_USE_TYPE_VIDEO: fully-featured with video, audio, capture and metadata support
* @BVW_USE_TYPE_AUDIO: audio and metadata support
* @BVW_USE_TYPE_CAPTURE: capture support only
* @BVW_USE_TYPE_METADATA: metadata support only
*
* The purpose for which a #BaconVideoWidget will be used, as specified to
* bacon_video_widget_new(). This determines which features will be enabled
* in the created widget.
**/
typedef enum {
BVW_USE_TYPE_VIDEO,
BVW_USE_TYPE_AUDIO,
......@@ -160,7 +211,7 @@ void bacon_video_widget_set_fullscreen (BaconVideoWidget *bvw,
gboolean fullscreen);
void bacon_video_widget_set_show_cursor (BaconVideoWidget *bvw,
gboolean use_cursor);
gboolean show_cursor);
gboolean bacon_video_widget_get_show_cursor (BaconVideoWidget *bvw);
gboolean bacon_video_widget_get_auto_resize (BaconVideoWidget *bvw);
......@@ -181,6 +232,31 @@ void bacon_video_widget_set_subtitle_encoding (BaconVideoWidget *bvw,
const char *encoding);
/* Metadata */
/**
* BvwMetadataType:
* @BVW_INFO_TITLE: the stream's title
* @BVW_INFO_ARTIST: the artist who created the work
* @BVW_INFO_YEAR: the year in which the work was created
* @BVW_INFO_COMMENT: a comment attached to the stream
* @BVW_INFO_ALBUM: the album in which the work was released
* @BVW_INFO_DURATION: the stream's duration, in seconds
* @BVW_INFO_TRACK_NUMBER: the track number of the work on the album
* @BVW_INFO_COVER: a #GdkPixbuf of the cover artwork
* @BVW_INFO_HAS_VIDEO: whether the stream has video
* @BVW_INFO_DIMENSION_X: the video's width, in pixels
* @BVW_INFO_DIMENSION_Y: the video's height, in pixels
* @BVW_INFO_VIDEO_BITRATE: the video's bitrate, in kilobits per second
* @BVW_INFO_VIDEO_CODEC: the video's codec
* @BVW_INFO_FPS: the number of frames per second in the video
* @BVW_INFO_HAS_AUDIO: whether the stream has audio
* @BVW_INFO_AUDIO_BITRATE: the audio's bitrate, in kilobits per second
* @BVW_INFO_AUDIO_CODEC: the audio's codec
* @BVW_INFO_AUDIO_SAMPLE_RATE: the audio sample rate, in bits per second
* @BVW_INFO_AUDIO_CHANNELS: a string describing the number of audio channels in the stream
*
* The different metadata available for querying from a #BaconVideoWidget
* stream with bacon_video_widget_get_metadata().
**/
typedef enum {
BVW_INFO_TITLE,
BVW_INFO_ARTIST,
......@@ -206,11 +282,20 @@ typedef enum {
} BvwMetadataType;
void bacon_video_widget_get_metadata (BaconVideoWidget *bvw,
BvwMetadataType
type,
BvwMetadataType type,
GValue *value);
/* Visualisation functions */
/**
* BvwVisualsQuality:
* @VISUAL_SMALL: small size (240×15)
* @VISUAL_NORMAL: normal size (320×25)
* @VISUAL_LARGE: large size (480×25)
* @VISUAL_EXTRA_LARGE: extra large size (600×30)
*
* The different visualisation sizes or qualities available for use
* with bacon_video_widget_set_visuals_quality().
**/
typedef enum {
VISUAL_SMALL = 0,
VISUAL_NORMAL,
......@@ -228,6 +313,16 @@ void bacon_video_widget_set_visuals_quality (BaconVideoWidget *bvw,
BvwVisualsQuality quality);
/* Picture settings */
/**
* BvwVideoProperty:
* @BVW_VIDEO_BRIGHTNESS: the video brightness
* @BVW_VIDEO_CONTRAST: the video contrast
* @BVW_VIDEO_SATURATION: the video saturation
* @BVW_VIDEO_HUE: the video hue
*
* The video properties queryable with bacon_video_widget_get_video_property(),
* and settable with bacon_video_widget_set_video_property().
**/
typedef enum {
BVW_VIDEO_BRIGHTNESS,
BVW_VIDEO_CONTRAST,
......@@ -235,6 +330,17 @@ typedef enum {
BVW_VIDEO_HUE
} BvwVideoProperty;
/**
* BvwAspectRatio:
* @BVW_RATIO_AUTO: automatic
* @BVW_RATIO_SQUARE: square (1:1)
* @BVW_RATIO_FOURBYTHREE: four-by-three (4:3)
* @BVW_RATIO_ANAMORPHIC: anamorphic (16:9)
* @BVW_RATIO_DVB: DVB (20:9)
*
* The pixel aspect ratios available in which to display videos using
* @bacon_video_widget_set_aspect_ratio().
**/
typedef enum {
BVW_RATIO_AUTO = 0,
BVW_RATIO_SQUARE = 1,
......@@ -249,8 +355,7 @@ void bacon_video_widget_set_deinterlacing (BaconVideoWidget *bvw,
gboolean bacon_video_widget_get_deinterlacing (BaconVideoWidget *bvw);
void bacon_video_widget_set_aspect_ratio (BaconVideoWidget *bvw,
BvwAspectRatio
ratio);
BvwAspectRatio ratio);
BvwAspectRatio bacon_video_widget_get_aspect_ratio
(BaconVideoWidget *bvw);
......@@ -262,14 +367,35 @@ void bacon_video_widget_set_zoom (BaconVideoWidget *bvw,
double bacon_video_widget_get_zoom (BaconVideoWidget *bvw);
int bacon_video_widget_get_video_property (BaconVideoWidget *bvw,
BvwVideoProperty
type);
BvwVideoProperty type);
void bacon_video_widget_set_video_property (BaconVideoWidget *bvw,
BvwVideoProperty
type,
BvwVideoProperty type,
int value);
/* DVD functions */
/**
* BvwDVDEvent:
* @BVW_DVD_ROOT_MENU: root menu
* @BVW_DVD_TITLE_MENU: title menu
* @BVW_DVD_SUBPICTURE_MENU: subpicture menu (if available)
* @BVW_DVD_AUDIO_MENU: audio menu (if available)
* @BVW_DVD_ANGLE_MENU: angle menu (if available)
* @BVW_DVD_CHAPTER_MENU: chapter menu
* @BVW_DVD_NEXT_CHAPTER: the next chapter
* @BVW_DVD_PREV_CHAPTER: the previous chapter
* @BVW_DVD_NEXT_TITLE: the next title in the current chapter
* @BVW_DVD_PREV_TITLE: the previous title in the current chapter
* @BVW_DVD_NEXT_ANGLE: the next angle
* @BVW_DVD_PREV_ANGLE: the previous angle
* @BVW_DVD_ROOT_MENU_UP: go up in the menu
* @BVW_DVD_ROOT_MENU_DOWN: go down in the menu
* @BVW_DVD_ROOT_MENU_LEFT: go left in the menu
* @BVW_DVD_ROOT_MENU_RIGHT: go right in the menu
* @BVW_DVD_ROOT_MENU_SELECT: select the current menu entry
*
* The DVD navigation actions available to fire as DVD events to
* the #BaconVideoWidget.
**/
typedef enum {
BVW_DVD_ROOT_MENU,
BVW_DVD_TITLE_MENU,
......@@ -291,8 +417,7 @@ typedef enum {
} BvwDVDEvent;
void bacon_video_widget_dvd_event (BaconVideoWidget *bvw,
BvwDVDEvent
type);
BvwDVDEvent type);
GList *bacon_video_widget_get_languages (BaconVideoWidget *bvw);
int bacon_video_widget_get_language (BaconVideoWidget *bvw);
void bacon_video_widget_set_language (BaconVideoWidget *bvw,
......@@ -312,6 +437,17 @@ gboolean bacon_video_widget_can_get_frames (BaconVideoWidget *bvw,
GdkPixbuf *bacon_video_widget_get_current_frame (BaconVideoWidget *bvw);
/* Audio-out functions */
/**
* BvwAudioOutType:
* @BVW_AUDIO_SOUND_STEREO: stereo output
* @BVW_AUDIO_SOUND_4CHANNEL: 4-channel output
* @BVW_AUDIO_SOUND_41CHANNEL: 4.1-channel output
* @BVW_AUDIO_SOUND_5CHANNEL: 5-channel output
* @BVW_AUDIO_SOUND_51CHANNEL: 5.1-channel output
* @BVW_AUDIO_SOUND_AC3PASSTHRU: AC3 passthrough output
*
* The audio output types available for use with bacon_video_widget_set_audio_out_type().
**/
typedef enum {
BVW_AUDIO_SOUND_STEREO,
BVW_AUDIO_SOUND_4CHANNEL,
......@@ -324,8 +460,7 @@ typedef enum {
BvwAudioOutType bacon_video_widget_get_audio_out_type
(BaconVideoWidget *bvw);
gboolean bacon_video_widget_set_audio_out_type (BaconVideoWidget *bvw,
BvwAudioOutType
type);
BvwAudioOutType type);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment