[Sumover-dev] [svn commit] r4780 - in vic/branches/mpeg4: tcl

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Fri Apr 16 15:07:13 BST 2010


Author: douglask
Date: Fri Apr 16 15:07:12 2010
New Revision: 4780

Modified:
   vic/branches/mpeg4/main.cpp
   vic/branches/mpeg4/tcl/ui-util.tcl

Log:
XML output from 'vic -Q' was not well-formed as it had two root elements. It now only has a single root element <vic>.  Confirmed with 'xmlwf' command on linux that it is well-formed.

Renamed print_input_device_details procedure to more appropriate print_capabilities_xml.


Modified: vic/branches/mpeg4/main.cpp
==============================================================================
--- vic/branches/mpeg4/main.cpp	(original)
+++ vic/branches/mpeg4/main.cpp	Fri Apr 16 15:07:12 2010
@@ -431,13 +431,13 @@
 }
 #endif
 
-void print_input_device_details(Tcl& tcl)
+void print_capabilities_xml(Tcl& tcl)
 {
 #ifdef WIN32
 		tcl.CreateCommand("puts", SimplePutsCmd, NULL);
 #endif
 
-	tcl.evalc("print_input_device_details");
+	tcl.evalc("print_capabilities_xml");
 	exit(0);
 }
 
@@ -717,7 +717,7 @@
 			break;
 
 		case 'Q':
-			print_input_device_details(tcl);
+			print_capabilities_xml(tcl);
 			break;
 
 		case 'r':

Modified: vic/branches/mpeg4/tcl/ui-util.tcl
==============================================================================
--- vic/branches/mpeg4/tcl/ui-util.tcl	(original)
+++ vic/branches/mpeg4/tcl/ui-util.tcl	Fri Apr 16 15:07:12 2010
@@ -313,72 +313,75 @@
 	return -1
 }
 
-proc print_input_device_details {} {
+proc print_capabilities_xml {} {
 	global inputDeviceList
 
 	puts "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
 	puts ""
+
+	puts "<vic>"
 	if {[llength $inputDeviceList] == 0} {
 		puts "<devices />"
-		return
-	}
-	puts "<devices>"
-	foreach v $inputDeviceList {
-		if {[$v attributes] != "disabled" &&
-			"[$v nickname]" != "still" && "[$v nickname]" != "filedev" } {
-
-			puts "	<device>"
-			set nickname [string map {"<" "&lt;"  ">" "&gt;"  "&" "&amp;"  "\"" "&quot;"  "'" "&apos;"} [$v nickname]]
-			puts "		<nickname>$nickname</nickname>"
-
-			set portnames [attribute_class [$v attributes] port]
-			if {[llength $portnames] == 0} {
-			puts "		<ports />"
-			} else {
-				puts "		<ports>"
-				foreach port $portnames {
-					set port [string map {"<" "&lt;"  ">" "&gt;"  "&" "&amp;"  "\"" "&quot;"  "'" "&apos;"} $port]
-					puts "			<port>$port</port>"
+	} else {
+		puts "	<devices>"
+		foreach v $inputDeviceList {
+			if {[$v attributes] != "disabled" &&
+				"[$v nickname]" != "still" && "[$v nickname]" != "filedev" } {
+
+				puts "		<device>"
+				set nickname [string map {"<" "&lt;"  ">" "&gt;"  "&" "&amp;"  "\"" "&quot;"  "'" "&apos;"} [$v nickname]]
+				puts "			<nickname>$nickname</nickname>"
+
+				set portnames [attribute_class [$v attributes] port]
+				if {[llength $portnames] == 0} {
+					puts "			<ports />"
+				} else {
+					puts "			<ports>"
+					foreach port $portnames {
+						set port [string map {"<" "&lt;"  ">" "&gt;"  "&" "&amp;"  "\"" "&quot;"  "'" "&apos;"} $port]
+						puts "				<port>$port</port>"
+					}
+					puts "			</ports>"
 				}
-				puts "		</ports>"
-			}
 
-			set typenames [attribute_class [$v attributes] type]
-			if {[llength $typenames] == 0} {
-				puts "		<types />"
-			} else {
-				puts "		<types>"
-				foreach type $typenames {
-					set type [string map {"<" "&lt;"  ">" "&gt;"  "&" "&amp;" "\""  "&quot;"  "'" "&apos;"} $type]
-					puts "			<type>$type</type>"
+				set typenames [attribute_class [$v attributes] type]
+				if {[llength $typenames] == 0} {
+					puts "			<types />"
+				} else {
+					puts "			<types>"
+					foreach type $typenames {
+						set type [string map {"<" "&lt;"  ">" "&gt;"  "&" "&amp;" "\""  "&quot;"  "'" "&apos;"} $type]
+						puts "				<type>$type</type>"
+					}
+					puts "			</types>"
 				}
-				puts "		</types>"
-			}
 
-			set sizeList [attribute_class [$v attributes] size]
-			if {[llength $sizeList] == 0} {
-				puts "		<sizes />"
-			} else {
-				puts "		<sizes>"
-				foreach size $sizeList {
-					set size [string map {"<" "&lt;"  ">" "&gt;"  "&" "&amp;"  "\"" "&quot;"  "'" "&apos;"} $size]
-					puts "			<size>$size</size>"
+				set sizeList [attribute_class [$v attributes] size]
+				if {[llength $sizeList] == 0} {
+					puts "			<sizes />"
+				} else {
+					puts "			<sizes>"
+					foreach size $sizeList {
+						set size [string map {"<" "&lt;"  ">" "&gt;"  "&" "&amp;"  "\"" "&quot;"  "'" "&apos;"} $size]
+						puts "				<size>$size</size>"
+					}
+					puts "			</sizes>"
 				}
-				puts "		</sizes>"
+				puts "		</device>"
 			}
-			puts "	</device>"
 		}
+		puts "	</devices>"
 	}
-	puts "</devices>"
 
-	puts "<codecs>"
+	puts "	<codecs>"
 	set codecList [list h261 h261as h263 h263+ mpeg4 h264 raw cellbbvc pvh jpeg]
 	foreach codec $codecList {
 		if { [codecexists $codec] } {
-			puts "	<codec>$codec</codec>"
+			puts "		<codec>$codec</codec>"
 		}
 	}
-	puts "</codecs>"
+	puts "	</codecs>"
+	puts "</vic>"
 	puts ""
 }
 



More information about the Sumover-dev mailing list