Google Flix Engine Linux Reference Manual User Manual

Page 465

Advertising
background image

7.13 CGI

459

global $flix;

print "<br>Encoder Status<br>";

$res= Flix2_GetEncoderState($flix);

print "&nbsp;Flix2_GetEncoderState: $res[1]<br>";

$res= Flix2_Errno($flix);

printf("&nbsp;Flix2_Errno: sc:%d flixerrno:%d syserrno:%d<br>",

$res[0],$res[1],$res[2]);

}

function process_sc($func, $sc) {

global $flix;

echo "<td align=\"center\">$sc</td>";

if($sc != ON2_OK) {

$res = Flix2_Errno($flix);

printf("<td>Flix2_Errno: sc:%d %s:%d syserrno:%d</td>",

$res[0],($sc==ON2_NET_ERROR)?"rpcerr":"flixerrno",$res[1],$res[2]);

die("Error calling $func, sc= $sc;".

"esc= $res[0] Flix2_Errno( $res[1], $res[2] )\n");

}

echo "</tr>";

}

function SimpleGet($func) {

global $flix;

$res = call_user_func($func, $flix);

$sc = $res[0];

if($sc != ON2_OK) {die ($func . ’ failed: sc=’ . $sc);}

return $res[1];

}

function SimpleSet($func, $arg) {

global $flix;

echo "<tr><td>$func( $arg )</td>";

if(!strcmp($func,"Flix2_SetInputFile")||!strcmp($func,"Flix2_SetOutputFile")) {

$sc = call_user_func($func, $flix, $arg);

} else {

$sc = call_user_func($func, $flix, constant("$arg"));

}

process_sc($func,$sc);

return $sc;

}

function init_codec($name)

{

global $flix, $codec, $codecptr;

##if name is a codec name, e.g. FE2_CODEC_VP6, add an instance

##we’ll assume all Flix2_CodecSetParam’s relate to this codec until we

##hit the next codec name

if($codecptr) { delete_flix2plgnhandlep($codecptr); }

echo "<tr><td>Flix2_AddCodec( ".$name." )</td>";

$codecptr = new_flix2plgnhandlep();

$sc = Flix2_AddCodec($codecptr, $flix, constant("$name"));

process_sc(’Flix2_AddCodec’,$sc);

#retrieve the codec handle to be used in all Codec API function calls

$codec = flix2plgnhandlep_value($codecptr);

}

function codec_interface($funcname, $name, $value)

Generated on Tue Jul 20 17:39:03 2010 for Flix Engine Linux by Doxygen

Advertising