[totem] Add a connection-speed property to BaconVideoWidget
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] Add a connection-speed property to BaconVideoWidget
- Date: Sat, 4 Sep 2010 15:46:35 +0000 (UTC)
commit 06d6373ebf7a1c802099f83b7470a37d369e9a72
Author: Philip Withnall <philip tecnocode co uk>
Date: Thu Aug 19 09:31:09 2010 +0100
Add a connection-speed property to BaconVideoWidget
docs/reference/totem-sections.txt | 3 ++
src/backend/bacon-video-widget-gst-0.10.c | 23 +++++++++++++++++++-
src/backend/bacon-video-widget.h | 32 +++++++++++++++++++++++++++++
3 files changed, 57 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/totem-sections.txt b/docs/reference/totem-sections.txt
index ed5230d..793e7d8 100644
--- a/docs/reference/totem-sections.txt
+++ b/docs/reference/totem-sections.txt
@@ -177,6 +177,7 @@ BaconVideoWidget
BaconVideoWidgetClass
BvwAspectRatio
BvwAudioOutType
+BvwConnectionSpeed
BvwDVDEvent
BvwMetadataType
BvwVisualsQuality
@@ -250,6 +251,7 @@ bacon_video_widget_step
<SUBSECTION Standard>
BVW_TYPE_ASPECT_RATIO
BVW_TYPE_AUDIO_OUT_TYPE
+BVW_TYPE_CONNECTION_SPEED
BVW_TYPE_DVD_EVENT
BVW_TYPE_ERROR
BVW_TYPE_METADATA_TYPE
@@ -258,6 +260,7 @@ BVW_TYPE_VIDEO_PROPERTY
BVW_TYPE_VISUALS_QUALITY
bvw_aspect_ratio_get_type
bvw_audio_out_type_get_type
+bvw_connection_speed_get_type
bvw_dvd_event_get_type
bvw_error_get_type
bvw_metadata_type_get_type
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index eda50c4..24f14ba 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -81,6 +81,7 @@
#include "bacon-video-widget.h"
#include "bacon-video-widget-gst-missing-plugins.h"
#include "baconvideowidget-marshal.h"
+#include "bacon-video-widget-enums.h"
#include "video-utils.h"
#include "gstscreenshot.h"
#include "bacon-resize.h"
@@ -136,7 +137,8 @@ enum
PROP_VOLUME,
PROP_DOWNLOAD_FILENAME,
PROP_AUTO_RESIZE,
- PROP_DEINTERLACING
+ PROP_DEINTERLACING,
+ PROP_CONNECTION_SPEED
};
static const gchar *video_props_str[4] = {
@@ -1167,6 +1169,18 @@ bacon_video_widget_class_init (BaconVideoWidgetClass * klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * BaconVideoWidget:connection-speed:
+ *
+ * The connection speed to use when calculating how much of a network stream to buffer.
+ **/
+ g_object_class_install_property (object_class, PROP_CONNECTION_SPEED,
+ g_param_spec_enum ("connection-speed", NULL,
+ NULL, BVW_TYPE_CONNECTION_SPEED,
+ BVW_SPEED_LAN,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
/* Signals */
/**
* BaconVideoWidget::error:
@@ -2815,6 +2829,9 @@ bacon_video_widget_set_property (GObject * object, guint property_id,
case PROP_DEINTERLACING:
bacon_video_widget_set_deinterlacing (bvw, g_value_get_boolean (value));
break;
+ case PROP_CONNECTION_SPEED:
+ bacon_video_widget_set_connection_speed (bvw, g_value_get_enum (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -2871,6 +2888,9 @@ bacon_video_widget_get_property (GObject * object, guint property_id,
case PROP_DEINTERLACING:
g_value_set_boolean (value, bacon_video_widget_get_deinterlacing (bvw));
break;
+ case PROP_CONNECTION_SPEED:
+ g_value_set_enum (value, bvw->priv->connection_speed);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -3240,6 +3260,7 @@ bacon_video_widget_set_connection_speed (BaconVideoWidget * bvw, int speed)
bvw->priv->connection_speed = speed;
gconf_client_set_int (bvw->priv->gc,
GCONF_PREFIX"/connection_speed", speed, NULL);
+ g_object_notify (G_OBJECT (bvw), "connection-speed");
}
if (bvw->priv->play != NULL &&
diff --git a/src/backend/bacon-video-widget.h b/src/backend/bacon-video-widget.h
index dcd29eb..b86a6b6 100644
--- a/src/backend/bacon-video-widget.h
+++ b/src/backend/bacon-video-widget.h
@@ -220,6 +220,38 @@ gboolean bacon_video_widget_get_auto_resize (BaconVideoWidget *bvw);
void bacon_video_widget_set_auto_resize (BaconVideoWidget *bvw,
gboolean auto_resize);
+/**
+ * BvwConnectionSpeed:
+ * @BVW_SPEED_14_4_MODEM: 14.4 Kbps Modem
+ * @BVW_SPEED_19_2_MODEM: 19.2 Kbps Modem
+ * @BVW_SPEED_28_8_MODEM: 28.8 Kbps Modem
+ * @BVW_SPEED_33_6_MODEM: 33.6 Kbps Modem
+ * @BVW_SPEED_34_4_MODEM: 34.4 Kbps Modem
+ * @BVW_SPEED_56_ISDN: 56 Kbps Modem/ISDN
+ * @BVW_SPEED_112_ISDN: 112 Kbps Dual ISDN/DSL
+ * @BVW_SPEED_256_DSL: 256 Kbps DSL/Cable
+ * @BVW_SPEED_384_DSL: 384 Kbps DSL/Cable
+ * @BVW_SPEED_512_DSL: 512 Kbps DSL/Cable
+ * @BVW_SPEED_1500_T1: 1.5 Mbps T1/Intranet/LAN
+ * @BVW_SPEED_LAN: Intranet/LAN
+ *
+ * The different connection speeds understood by bacon_video_widget_set_connection_speed().
+ */
+typedef enum {
+ BVW_SPEED_14_4_MODEM = 0,
+ BVW_SPEED_19_2_MODEM,
+ BVW_SPEED_28_8_MODEM,
+ BVW_SPEED_33_6_MODEM,
+ BVW_SPEED_34_4_MODEM,
+ BVW_SPEED_56_ISDN,
+ BVW_SPEED_112_ISDN,
+ BVW_SPEED_256_DSL,
+ BVW_SPEED_384_DSL,
+ BVW_SPEED_512_DSL,
+ BVW_SPEED_1500_T1,
+ BVW_SPEED_LAN
+} BvwConnectionSpeed;
+
void bacon_video_widget_set_connection_speed (BaconVideoWidget *bvw,
int speed);
int bacon_video_widget_get_connection_speed (BaconVideoWidget *bvw);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]