[totem] Add brightness, contrast, saturation and hue properties to BaconVideoWidget
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] Add brightness, contrast, saturation and hue properties to BaconVideoWidget
- Date: Wed, 15 Dec 2010 22:40:37 +0000 (UTC)
commit e8982e9aec77cafee4839dd9820bd9c01ad73c2d
Author: Philip Withnall <philip tecnocode co uk>
Date: Wed Dec 15 21:29:52 2010 +0000
Add brightness, contrast, saturation and hue properties to BaconVideoWidget
src/backend/bacon-video-widget-gst-0.10.c | 77 ++++++++++++++++++++++++++++-
1 files changed, 76 insertions(+), 1 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index bbf41f6..45443f8 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -136,7 +136,11 @@ enum
PROP_AUTO_RESIZE,
PROP_DEINTERLACING,
PROP_CONNECTION_SPEED,
- PROP_VISUALIZATION_QUALITY
+ PROP_VISUALIZATION_QUALITY,
+ PROP_BRIGHTNESS,
+ PROP_CONTRAST,
+ PROP_SATURATION,
+ PROP_HUE
};
static const gchar *video_props_str[4] = {
@@ -1185,6 +1189,50 @@ bacon_video_widget_class_init (BaconVideoWidgetClass * klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * BaconVideoWidget:brightness:
+ *
+ * The brightness of the video display.
+ **/
+ g_object_class_install_property (object_class, PROP_BRIGHTNESS,
+ g_param_spec_int ("brightness", NULL,
+ NULL, 0, 65535, 32768,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * BaconVideoWidget:contrast:
+ *
+ * The contrast of the video display.
+ **/
+ g_object_class_install_property (object_class, PROP_CONTRAST,
+ g_param_spec_int ("contrast", NULL,
+ NULL, 0, 65535, 32768,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * BaconVideoWidget:saturation:
+ *
+ * The saturation of the video display.
+ **/
+ g_object_class_install_property (object_class, PROP_SATURATION,
+ g_param_spec_int ("saturation", NULL,
+ NULL, 0, 65535, 32768,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
+ * BaconVideoWidget:hue:
+ *
+ * The hue of the video display.
+ **/
+ g_object_class_install_property (object_class, PROP_HUE,
+ g_param_spec_int ("hue", NULL,
+ NULL, 0, 65535, 32768,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
/* Signals */
/**
* BaconVideoWidget::error:
@@ -2805,6 +2853,18 @@ bacon_video_widget_set_property (GObject * object, guint property_id,
case PROP_VISUALIZATION_QUALITY:
bacon_video_widget_set_visualization_quality (bvw, g_value_get_enum (value));
break;
+ case PROP_BRIGHTNESS:
+ bacon_video_widget_set_video_property (bvw, BVW_VIDEO_BRIGHTNESS, g_value_get_int (value));
+ break;
+ case PROP_CONTRAST:
+ bacon_video_widget_set_video_property (bvw, BVW_VIDEO_CONTRAST, g_value_get_int (value));
+ break;
+ case PROP_SATURATION:
+ bacon_video_widget_set_video_property (bvw, BVW_VIDEO_SATURATION, g_value_get_int (value));
+ break;
+ case PROP_HUE:
+ bacon_video_widget_set_video_property (bvw, BVW_VIDEO_HUE, g_value_get_int (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -2867,6 +2927,18 @@ bacon_video_widget_get_property (GObject * object, guint property_id,
case PROP_VISUALIZATION_QUALITY:
g_value_set_enum (value, bvw->priv->visq);
break;
+ case PROP_BRIGHTNESS:
+ g_value_set_int (value, bacon_video_widget_get_video_property (bvw, BVW_VIDEO_BRIGHTNESS));
+ break;
+ case PROP_CONTRAST:
+ g_value_set_int (value, bacon_video_widget_get_video_property (bvw, BVW_VIDEO_CONTRAST));
+ break;
+ case PROP_SATURATION:
+ g_value_set_int (value, bacon_video_widget_get_video_property (bvw, BVW_VIDEO_SATURATION));
+ break;
+ case PROP_HUE:
+ g_value_set_int (value, bacon_video_widget_get_video_property (bvw, BVW_VIDEO_HUE));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -5458,6 +5530,9 @@ bacon_video_widget_set_video_property (BaconVideoWidget *bvw,
}
}
+ /* Notify of the property change */
+ g_object_notify (G_OBJECT (bvw), video_props_str[type]);
+
/* save in GSettings */
g_settings_set_int (bvw->priv->settings, video_props_str[type], value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]