[Sumover-dev] [svn commit] r4302 - in vic/branches/mpeg4: video

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Sun Oct 26 10:31:00 GMT 2008


Author: douglask
Date: Sun Oct 26 10:27:23 2008
New Revision: 4302

Modified:
   vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl
   vic/branches/mpeg4/video/grabber-macosx.cpp

Log:
The workaround in tcl/ui-ctrlmenu.tcl to prevent VIC crashing with the message "pure virtual method" when compiled with earlier versions of g++ has been removed in order to allow changing of encoders and capture size. 

grabber-macosx.cpp was modified to handle format changes


Modified: vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl
==============================================================================
--- vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl	(original)
+++ vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl	Sun Oct 26 10:27:23 2008
@@ -436,14 +436,10 @@
 
 proc close_device {} {
 	global V
-	# XXX: bypassing the pure virtual funtion call problem under macosx
-	# need to figure out where is the bug
-        if { ![string match [ windowingsystem] "aqua"]} { 
-	    delete $V(encoder)
-	    delete $V(grabber)
- 	    unset V(grabber) 
-	    unset V(encoder)
-        }
+	delete $V(encoder)
+	delete $V(grabber)
+ 	unset V(grabber) 
+	unset V(encoder)
 	if [info exists V(capwin)] {
 		# delete the C++ object, then destrory the tk window
 		delete $V(capwin)

Modified: vic/branches/mpeg4/video/grabber-macosx.cpp
==============================================================================
--- vic/branches/mpeg4/video/grabber-macosx.cpp	(original)
+++ vic/branches/mpeg4/video/grabber-macosx.cpp	Sun Oct 26 10:27:23 2008
@@ -221,7 +221,9 @@
 	
     // Don't do anything if QuickTime failed.
     if (!quicktime_) return;
-	
+
+    format();
+
     // start the sequencer
     err = SGStartRecord(seqGrab);
 	
@@ -399,10 +401,9 @@
 			err = SGPrepare(seqGrab, false, true);
 			
         } else {
-			fprintf(stderr, "      format() - reformat not implemented!\n");
-			//            UnlockPixels(GetGWorldPixMap(gWorld_));
-			//            UpdateGWorld(&gWorld_, kYUVUPixelFormat, &frameRect_, 0, NULL, 0);
-			//            if (!LockPixels(GetGWorldPixMap(gWorld_))) throw Exception("LockPixels");
+			UnlockPixels(GetGWorldPixMap(gWorld_));
+			UpdateGWorld(&gWorld_, kYUVUPixelFormat, &frameRect_, 0, NULL, 0);
+			if (!LockPixels(GetGWorldPixMap(gWorld_))) throw Exception("LockPixels");
         }
     } catch (Exception e) {
         fprintf(stderr, "QuickTime error[%d]: %s\n", err, e.string);
@@ -451,10 +452,8 @@
 		if (strcmp(argv[1], "decimate") == 0) {
 			decimate_ = atoi(argv[2]);
 			if (running_) {
-				stop();
+				stop(); start();
 			}
-			format();
-			start();
 			return(TCL_OK);
 
 		} else if (strcmp(argv[1], "port") == 0) {
@@ -473,6 +472,10 @@
 			else
 				input_standard_ = ntscIn;
 
+                        if (running_) {
+                                stop(); start();
+                        }
+
 			return(TCL_OK);
 
         } else if (strcmp(argv[1], "useconfig") == 0) {



More information about the Sumover-dev mailing list