[chronojump/video-capture: 7/7] WIP: Add initial tests for the capturer



commit a03bdfe3702aa0666e3ed68864ec8e4e48f1785b
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Dec 16 01:29:33 2010 +0100

    WIP: Add initial tests for the capturer

 Makefile.am            |    2 +-
 configure.ac           |    3 +++
 glade/chronojump.glade |   47 ++++++++++++++++++++++++++++++-----------------
 src/Makefile.am        |   12 ++++++++++++
 src/chronojump.cs      |    5 ++++-
 src/gui/chronojump.cs  |   27 +++++++++++++++++++++++++++
 6 files changed, 77 insertions(+), 19 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index b708b3d..a47f396 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,7 @@ if ENABLE_DEBUG
 endif
 if ENABLE_RELEASE
  SUBDIRS = chronopic-firmware chronojump_server chronopic-tests \
- 	src po manual libcesarplayer CesarPlayer
+ 	libcesarplayer CesarPlayer src po manual
 endif
 
 # Build ChangeLog from GIT history
diff --git a/configure.ac b/configure.ac
index c8f36ae..91c00bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,7 +110,10 @@ src/chronojump
 src/chronojump_mini
 src/chronojump.desktop
 libcesarplayer/Makefile
+libcesarplayer/src/Makefile
 CesarPlayer/Makefile
+CesarPlayer/AssemblyInfo.cs
+CesarPlayer/CesarPlayer.dll.config
 ])
 
 AC_OUTPUT
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 3a2b171..fbc5ed9 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <glade-interface>
   <!-- interface-requires gtk+ 2.6 -->
   <!-- interface-naming-policy toplevel-contextual -->
@@ -79,7 +79,7 @@
                           <widget class="GtkEntry" id="entry1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="invisible_char">&#x25CF;</property>
+                            <property name="invisible_char">â??</property>
                             <signal name="changed" handler="on_entries_required_changed"/>
                           </widget>
                           <packing>
@@ -604,7 +604,7 @@
                                   <widget class="GtkSpinButton" id="spinbutton_height">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
+                                    <property name="invisible_char">â??</property>
                                     <property name="adjustment">0 0 250 0.10000000000000001 10 10</property>
                                     <property name="climb_rate">1</property>
                                     <property name="digits">1</property>
@@ -660,7 +660,7 @@
                                   <widget class="GtkSpinButton" id="spinbutton_weight">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
+                                    <property name="invisible_char">â??</property>
                                     <property name="adjustment">0 0 300 0.10000000000000001 10 10</property>
                                     <property name="climb_rate">1</property>
                                     <property name="digits">1</property>
@@ -1508,7 +1508,7 @@
               <widget class="GtkEntry" id="entry_search_filter">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="invisible_char">&#x25CF;</property>
+                <property name="invisible_char">â??</property>
                 <signal name="changed" handler="on_entry_search_filter_changed"/>
               </widget>
               <packing>
@@ -4487,7 +4487,7 @@ options</property>
                                             <property name="visible">True</property>
                                             <property name="can_focus">True</property>
                                             <property name="tooltip" translatable="yes">Width of the line</property>
-                                            <property name="invisible_char">&#x25CF;</property>
+                                            <property name="invisible_char">â??</property>
                                             <property name="adjustment">1 1 5 1 1 0</property>
                                             <property name="climb_rate">1</property>
                                             <property name="snap_to_ticks">True</property>
@@ -11232,7 +11232,6 @@ Test&lt;/b&gt;</property>
     <property name="title" translatable="yes">Test image and description</property>
     <property name="modal">True</property>
     <property name="type_hint">dialog</property>
-    <property name="has_separator">False</property>
     <signal name="delete_event" handler="on_delete_event"/>
     <child internal-child="vbox">
       <widget class="GtkVBox" id="vbox100">
@@ -11693,7 +11692,7 @@ Test&lt;/b&gt;</property>
                 <property name="has_focus">True</property>
                 <property name="can_default">True</property>
                 <property name="has_default">True</property>
-                <property name="invisible_char">&#x25CF;</property>
+                <property name="invisible_char">â??</property>
                 <signal name="changed" handler="on_entry_description_changed"/>
               </widget>
               <packing>
@@ -11735,7 +11734,7 @@ comments</property>
               <widget class="GtkEntry" id="entry_angle_value">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="invisible_char">&#x25CF;</property>
+                <property name="invisible_char">â??</property>
                 <signal name="changed" handler="on_entry_angle_changed"/>
               </widget>
               <packing>
@@ -13568,7 +13567,7 @@ comments</property>
               <widget class="GtkEntry" id="entry">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="invisible_char">&#x25CF;</property>
+                <property name="invisible_char">â??</property>
               </widget>
               <packing>
                 <property name="expand">False</property>
@@ -13595,7 +13594,7 @@ comments</property>
               <widget class="GtkSpinButton" id="spin_double">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="invisible_char">&#x25CF;</property>
+                <property name="invisible_char">â??</property>
                 <property name="adjustment">0 0 300 0.01 10 10</property>
                 <property name="digits">2</property>
                 <property name="snap_to_ticks">True</property>
@@ -13620,7 +13619,7 @@ comments</property>
                       <widget class="GtkSpinButton" id="spin_feet">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="invisible_char">&#x25CF;</property>
+                        <property name="invisible_char">â??</property>
                         <property name="adjustment">0 0 8 1 1 1</property>
                         <property name="snap_to_ticks">True</property>
                         <property name="numeric">True</property>
@@ -13655,7 +13654,7 @@ comments</property>
                       <widget class="GtkSpinButton" id="spin_inches">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="invisible_char">&#x25CF;</property>
+                        <property name="invisible_char">â??</property>
                         <property name="adjustment">0 0 11 0.01 1 1</property>
                         <property name="digits">2</property>
                         <property name="snap_to_ticks">True</property>
@@ -15371,7 +15370,7 @@ by you</property>
                       <widget class="GtkEntry" id="entry_cp_other">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="invisible_char">&#x25CF;</property>
+                        <property name="invisible_char">â??</property>
                         <signal name="changed" handler="on_entries_required_changed"/>
                       </widget>
                       <packing>
@@ -15581,7 +15580,7 @@ by you</property>
                           <widget class="GtkEntry" id="entry_device_other">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="invisible_char">&#x25CF;</property>
+                            <property name="invisible_char">â??</property>
                             <signal name="changed" handler="on_entries_required_changed"/>
                           </widget>
                           <packing>
@@ -16627,7 +16626,7 @@ by you</property>
       <widget class="GtkVBox" id="vbox69">
         <property name="visible">True</property>
         <child>
-          <widget class="GtkMenuBar" id="menubar1">
+          <widget class="GtkMenuBar" id="C">
             <property name="visible">True</property>
             <child>
               <widget class="GtkMenuItem" id="session">
@@ -17630,6 +17629,20 @@ by you</property>
                       </widget>
                     </child>
                     <child>
+                      <widget class="GtkImageMenuItem" id="menuitem_camera_record">
+                        <property name="label" translatable="yes">camera record</property>
+                        <property name="visible">True</property>
+                        <property name="use_stock">False</property>
+                        <signal name="activate" handler="on_menuitem_camera_record_activate"/>
+                        <child internal-child="image">
+                          <widget class="GtkImage" id="image45">
+                            <property name="visible">True</property>
+                            <property name="stock">gtk-missing-image</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
                       <widget class="GtkImageMenuItem" id="menuitem_report_window">
                         <property name="label" translatable="yes">Report</property>
                         <property name="visible">True</property>
@@ -20270,7 +20283,7 @@ by you</property>
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">True</property>
                                                         <property name="max_length">4</property>
-                                                        <property name="invisible_char">&#x25CF;</property>
+                                                        <property name="invisible_char">â??</property>
                                                         <property name="width_chars">4</property>
                                                         <signal name="changed" handler="on_entry_run_analysis_distance_changed"/>
                                                       </widget>
diff --git a/src/Makefile.am b/src/Makefile.am
index 8fab6ac..eb8d84e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,6 +11,12 @@ COMPILE_TARGET = exe
 BUILD_DIR = bin/Debug
 CHRONOJUMP_EXE_MDB_SOURCE=bin/Debug/Chronojump.exe.mdb
 CHRONOJUMP_MINI_EXE=bin/Debug/Chronojump_Mini.exe
+PROJECT_REFERENCES =  \
+	../CesarPlayer/bin/Debug/CesarPlayer.dll
+CESARPLAYER_DLL_SOURCE=../CesarPlayer/bin/Debug/CesarPlayer.dll
+CESARPLAYER_DLL=$(BUILD_DIR)/CesarPlayer.dll
+CESARPLAYER_DLL_MDB_SOURCE=../CesarPlayer/bin/Debug/CesarPlayer.dll.mdb
+CESARPLAYER_DLL_MDB=$(BUILD_DIR)/CesarPlayer.dll.mdb
 endif
 
 if ENABLE_RELEASE
@@ -22,6 +28,10 @@ COMPILE_TARGET = exe
 BUILD_DIR = bin/Release
 CHRONOJUMP_EXE_MDB_SOURCE=
 CHRONOJUMP_MINI_EXE=bin/Release/Chronojump_Mini.exe
+PROJECT_REFERENCES =  \
+	../CesarPlayer/bin/Release/CesarPlayer.dll
+CESARPLAYER_DLL_SOURCE=../CesarPlayer/bin/Release/CesarPlayer.dll
+CESARPLAYER_DLL=$(BUILD_DIR)/CesarPlayer.dll
 endif
 
 AL=al2
@@ -35,6 +45,7 @@ COMMONAPPLICATIONDATA_ROOT = \
  
 
 PROGRAMFILES = \
+	$(CESARPLAYER_DLL) \
 	$(CHRONOJUMP_MINI_EXE)
 
 LINUX_DESKTOPAPPLICATIONS = \
@@ -341,6 +352,7 @@ CHRONOJUMP_EXE_MDB = $(BUILD_DIR)/ChronoJump.exe.mdb
 CHRONOJUMP=$(BUILD_DIR)/chronojump
 CHRONOJUMP_MINI=$(BUILD_DIR)/chronojump_mini
 
+$(eval $(call emit-deploy-target,CESARPLAYER_DLL))
 $(eval $(call emit-deploy-wrapper,CHRONOJUMP,chronojump,x))
 $(eval $(call emit-deploy-wrapper,CHRONOJUMP_MINI,chronojump_mini,x))
 $(eval $(call emit-deploy-target,CHRONOJUMP_DESKTOP))
diff --git a/src/chronojump.cs b/src/chronojump.cs
index 7e92bd4..8a1a9d4 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -87,6 +87,7 @@ public class ChronoJump
 					
 			
 		new ChronoJump(args);
+		
 	}
 
 	bool createdSplashWin = false;
@@ -103,6 +104,8 @@ public class ChronoJump
 		fakeSplashButton = new Gtk.Button();
 		fakeSplashButton.Clicked += new EventHandler(on_splash_ended);
 
+		LongoMatch.Video.Capturer.GstCameraCapturer.InitBackend("");
+
 		thread = new Thread(new ThreadStart(sqliteThings));
 		GLib.Idle.Add (new GLib.IdleHandler (PulseGTK));
 		thread.Start(); 
@@ -259,7 +262,7 @@ Log.WriteLine("doing backup");
 
 		splashMessageChange(5);  //check for new version
 
-		messageToShowOnBoot += recuperateBrokenEvents();
+		//messageToShowOnBoot += recuperateBrokenEvents();
 
 		//connect to server to Ping
 		versionAvailable = "";
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index b6c798f..ad4ef4d 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -27,6 +27,9 @@ using System.IO.Ports;
 using Mono.Unix;
 using System.IO; //"File" things
 using System.Collections; //ArrayList
+using LongoMatch.Gui;
+using LongoMatch.Video.Capturer;
+using LongoMatch.Video.Common;
 
 
 public class ChronoJumpWindow 
@@ -2143,6 +2146,30 @@ public class ChronoJumpWindow
 		}
 	}
 
+	/* ---------------------------------------------------------
+	 * ----------------  CAMERA CALLBACKS ----------------------
+	 *  --------------------------------------------------------
+	 */
+	private void on_menuitem_camera_record_activate(object o, EventArgs args) {
+		CapturerBin capturer = new CapturerBin();
+		CapturePropertiesStruct s = new CapturePropertiesStruct();
+
+		s.OutputFile = "/tmp/test_longomatch_is_very_cool.avi";
+		s.VideoBitrate =  1000;
+		s.CaptureSourceType = CaptureSourceType.Raw;
+		s.Width = 360;
+		s.Height = 288;
+
+		capturer.CaptureProperties = s;
+		capturer.Type = CapturerType.Live;
+		capturer.Visible=true;
+		
+		Gtk.Window d = new Gtk.Window("Capturer");
+		d.Add(capturer);
+		d.ShowAll();
+		capturer.Run();
+	}
+
 
 	/* ---------------------------------------------------------
 	 * ----------------  SOME CALLBACKS ------------------------



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