[Sumover-dev] [svn commit] r4076 - vic/branches/mpeg4/tcl

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Thu Jun 21 12:56:46 BST 2007


Author: piers
Date: Thu Jun 21 12:56:45 2007
New Revision: 4076

Modified:
   vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl

Log:
Added dynamic check for h263 & h264 codecs - to control display of the codecs in the control panel.

Modified: vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl
==============================================================================
--- vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl	(original)
+++ vic/branches/mpeg4/tcl/ui-ctrlmenu.tcl	Thu Jun 21 12:56:45 2007
@@ -893,21 +893,25 @@
 	pack $w.tb -fill x -padx 6 -side left -expand 1
 }
 
-proc build.format w {
-	set encoder [new module h264]
+proc codecexists c {
+	set encoder [new module $c]
 	if { $encoder == "" }  {
-	  set gpl 1
-        } else {
+	  return 0
+    } else {
 	  delete $encoder
-	  set gpl 0
-        }
+	  return 1
+    }
+}
+proc build.format w {
 
 	format_col $w.p0 nv nvdct 
-	format_col $w.p1 h261 h263
-	format_col $w.p2 h263+ h261as
-	if { $gpl == 0 } {
+	format_col $w.p1 h261 h261as 
+	if { [codecexists h263] } {
+		format_col $w.p2 h263 h263+ 
+	}
+	if { [codecexists h264] } {
 	  format_col $w.p3 mpeg4 h264
-        }
+    }
 	format_col $w.p4 raw cellb
 	format_col $w.p5 bvc pvh:
 	format_col $w.p6 jpeg null
@@ -915,11 +919,14 @@
 	
 	frame $w.glue0
 	frame $w.glue1
-	if { $gpl == 0 } {
-	    pack $w.p0 $w.p1 $w.p2 $w.p3 $w.p4 $w.p5 $w.p6 -side left
-	} else {
-	    pack $w.p0 $w.p1 $w.p2  $w.p4 $w.p5 $w.p6 -side left
+	pack $w.p0 $w.p1 -side left
+	if { [codecexists h263] } {
+	    pack $w.p2 -side left
+	}
+	if { [codecexists h264] } {
+	    pack $w.p3 -side left
 	}
+	pack $w.p4 $w.p5 $w.p6 -side left
 
 }
 



More information about the Sumover-dev mailing list