cheese r699 - in branches/cheese-vala: . src



Author: jhaitsma
Date: Sun Apr 27 21:18:10 2008
New Revision: 699
URL: http://svn.gnome.org/viewvc/cheese?rev=699&view=rev

Log:
First start with cheese-webcam.vala


Modified:
   branches/cheese-vala/   (props changed)
   branches/cheese-vala/src/Makefile.am
   branches/cheese-vala/src/cheese-webcam.vala
   branches/cheese-vala/src/cheese-window.vala

Modified: branches/cheese-vala/src/Makefile.am
==============================================================================
--- branches/cheese-vala/src/Makefile.am	(original)
+++ branches/cheese-vala/src/Makefile.am	Sun Apr 27 21:18:10 2008
@@ -10,7 +10,8 @@
 	--pkg gee-1.0 \
 	--pkg libgnomeui-2.0 \
 	--pkg gdk-pixbuf-2.0 \
-	--pkg gnome-vfs-2.0
+	--pkg gnome-vfs-2.0 \
+	--pkg hal
 	
 AM_CPPFLAGS = \
 	-DBINDIR=\"$(bindir)\"			 	\
@@ -38,7 +39,7 @@
 	$(cheese_VALASOURCES:.vala=.h) 
 
 cheese.vala.stamp: $(cheese_VALASOURCES)
-	$(VALAC) $(VALA_CFLAGS) $^
+	$(VALAC) -C $(VALA_CFLAGS) $^
 	touch $@
 
 cheese_LDADD = \

Modified: branches/cheese-vala/src/cheese-webcam.vala
==============================================================================
--- branches/cheese-vala/src/cheese-webcam.vala	(original)
+++ branches/cheese-vala/src/cheese-webcam.vala	Sun Apr 27 21:18:10 2008
@@ -19,9 +19,118 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-using GLib;
-using Gst;
+using GLib, Gst, Gtk, Gee, Hal;
 
 public class Cheese.Webcam : GLib.Object {
 
+	public signal void photo_saved ();
+	public signal void video_saved ();
+
+	public enum Effect {
+		NO_EFFECT       = (0),
+		MAUVE           = (1 << 0),
+		NOIR_BLANC      = (1 << 1),
+		SATURATION      = (1 << 2),
+		HULK            = (1 << 3),
+		VERTICAL_FLIP   = (1 << 4),
+		HORIZONTAL_FLIP = (1 << 5),
+		SHAGADELIC      = (1 << 6),
+		VERTIGO         = (1 << 7),
+		EDGE            = (1 << 8),
+		DICE            = (1 << 9),
+		WARP            = (1 << 10)
+	}
+	
+	enum ColorSpace {
+		YUV,
+		RGB
+	}
+	
+	struct EffectToPipeline {
+		Effect effect;
+		string pipeline_desc;
+		ColorSpace colorspace; /* The color space the effect works in */
+	} 
+
+	const EffectToPipeline[] EFFECT_TO_PIPELINE = {
+		{Effect.NO_EFFECT, "identity", ColorSpace.RGB},
+		{Effect.MAUVE, "videobalance saturation=1.5 hue=+0.5", ColorSpace.YUV},
+		{Effect.NOIR_BLANC, "videobalance saturation=0", ColorSpace.YUV},
+		{Effect.SATURATION, "videobalance saturation=2", ColorSpace.YUV},
+		{Effect.HULK, "videobalance saturation=1.5 hue=-0.5", ColorSpace.YUV},
+		{Effect.VERTICAL_FLIP, "videoflip method=5", ColorSpace.YUV},
+		{Effect.HORIZONTAL_FLIP, "videoflip method=4", ColorSpace.YUV},
+		{Effect.SHAGADELIC, "shagadelictv", ColorSpace.RGB},
+		{Effect.VERTIGO, "vertigotv", ColorSpace.RGB},
+		{Effect.EDGE, "edgetv", ColorSpace.RGB},
+		{Effect.DICE, "dicetv", ColorSpace.RGB},
+		{Effect.WARP, "warptv", ColorSpace.RGB}
+	};
+
+	public DrawingArea video_screen {get; construct;}
+
+	Element pipeline; 
+  	Bus     bus;
+	/* We build the active pipeline by linking the appropriate pipelines 
+	   listed below */
+	Element webcam_source_bin;
+	Element video_display_bin;
+
+	Element photo_save_bin;
+	Element video_save_bin;
+
+	Element video_source;
+	Element capsfilter;
+	Element video_file_sink;
+	Element photo_sink;
+	Element audio_source;
+	Element audio_enc;
+	Element video_enc;
+
+	Element effect_filter;
+	Element csp_post_effect;
+
+	ulong photo_handler_signal_id;
+
+	bool is_recording;
+	bool pipeline_is_playing;
+	string photo_filename;
+/*    
+  XF86VidModeGamma normal_gamma;
+  float flash_intensity;
+*/
+	int num_webcam_devices;
+	string device_name;
+  /*
+	CheeseWebcamDevice *webcam_devices;
+  int x_resolution;
+  int y_resolution;
+  int selected_device;
+  CheeseVideoFormat *current_format;
+  GHashTable *supported_resolutions;
+
+*/
+
+
+	public void setup () {
+	}
+
+	public void play () {
+	}
+
+	public void stop () {
+	}
+
+	public void start_recording (string filename) {
+	}
+
+	public void stop_recording () {
+	}
+
+	public void take_photo (string filename) {
+	}
+
+	public int get_num_devices () {
+		return 0;
+	}
 }

Modified: branches/cheese-vala/src/cheese-window.vala
==============================================================================
--- branches/cheese-vala/src/cheese-window.vala	(original)
+++ branches/cheese-vala/src/cheese-window.vala	Sun Apr 27 21:18:10 2008
@@ -84,7 +84,7 @@
 	Label label_video;
 
 
-	Widget screen;
+	DrawingArea screen;
 	Button take_picture;
 /*
 #ifdef HILDON
@@ -310,7 +310,7 @@
 			video_vbox = (VBox) get_object ("video_vbox");
 			notebook = (Widget) get_object ("notebook");
 			notebook_bar = (Widget) get_object ("notebook_bar");
-			screen = (Widget) get_object ("video_screen");
+			screen = (DrawingArea) get_object ("video_screen");
 			take_picture = (Button) get_object ("take_picture");
 			thumb_container = (Container) get_object ("thumb_scrollwindow");
 			throbber_frame = (Widget) get_object ("throbber_frame");



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