[cheese/three-point-oh] Added methods to enable/disable live preview of individual effects



commit d8319056ca667cad6a726fe6f424d3bc080319d2
Author: Yuvaraj Pandian T <yuvipanda gmail com>
Date:   Fri Jul 9 01:22:17 2010 +0530

    Added methods to enable/disable live preview of individual effects

 libcheese/cheese-effect.c   |   14 ++++++++++++++
 libcheese/cheese-effect.h   |    3 ++-
 src/vapi/cheese-common.vapi |    5 +++++
 3 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/libcheese/cheese-effect.c b/libcheese/cheese-effect.c
index 9e995d4..ee7fa06 100644
--- a/libcheese/cheese-effect.c
+++ b/libcheese/cheese-effect.c
@@ -101,6 +101,20 @@ cheese_effect_class_init (CheeseEffectClass *klass)
 
 }
 
+void
+cheese_effect_enable_preview (CheeseEffect *self)
+{
+  CheeseEffectPrivate *priv = CHEESE_EFFECT_GET_PRIVATE (self);
+  g_object_set (G_OBJECT (priv->control_valve), "drop", FALSE, NULL);
+}
+
+void
+cheese_effect_disable_preview (CheeseEffect *self)
+{
+  CheeseEffectPrivate *priv = CHEESE_EFFECT_GET_PRIVATE (self);
+  g_object_set (G_OBJECT (priv->control_valve), "drop", TRUE, NULL);
+}
+
 static void
 cheese_effect_init (CheeseEffect *self)
 {
diff --git a/libcheese/cheese-effect.h b/libcheese/cheese-effect.h
index 81ffc59..e736c46 100644
--- a/libcheese/cheese-effect.h
+++ b/libcheese/cheese-effect.h
@@ -33,7 +33,8 @@ typedef struct {
 GType cheese_effect_get_type (void);
 
 CheeseEffect* cheese_effect_new (void);
-
+void cheese_effect_enable_preview (CheeseEffect* self);
+void cheese_effect_disable_preview (CheeseEffect* self);
 G_END_DECLS
 
 #endif /* _CHEESE_EFFECT_H_ */
diff --git a/src/vapi/cheese-common.vapi b/src/vapi/cheese-common.vapi
index 1c1da6a..21c58a6 100644
--- a/src/vapi/cheese-common.vapi
+++ b/src/vapi/cheese-common.vapi
@@ -12,6 +12,11 @@ namespace Cheese
 		public string name {owned get; set;}
 		[NoAccessorMethod]
 		public string pipeline_desc {owned get; set;}
+		[NoAccessorMethod]
+		public Gst.Element control_valve {get; set;}
+
+		public void enable_preview();
+		public void disable_preview();
 	}
 
   [CCode (cheader_filename = "cheese-camera.h")]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]