beautypg.com

Google Flix Engine Linux Reference Manual User Manual

Page 423

background image

7.11 CGI

417

$sc = Flix2_AddMuxer($muxerptr, $flix, ${$name});

::process_sc(’Flix2_AddMuxer’,$sc);

#retrieve the muxer handle to be used in all Muxer API function calls

$muxer = flix2plgnhandlep_value($muxerptr);

}

sub muxer_interface($$$)

{

my ($funcname,$name,$value) = @_;

package On2::flixengine2;

print "$funcname( $name, $value )";

$sc = &$funcname($muxer,${$name},($funcname=~/AsStr/ or $value!~/[[:alpha:]_]/)?$value:${$value});

::process_sc($funcname,$sc);

}

sub encode()

{

package On2::flixengine2;

print "Flix2_Encode()";

my ($sc) = Flix2_Encode($flix);

::process_sc(’Flix2_Encode’,$sc);

print "
\n";

print CGI::br,"Encoding...(video frames encoded, percent complete). ",

"Total frames will reset when doing 2pass.",CGI::br;

my $ier;

do {

$ier= Flix2_IsEncoderRunning($flix);

my ($sc, $tf)= encoding_status_GetTotalFrames($flix);

my $p= encoding_status_PercentComplete($flix);

print "($tf, $p%)
" if ($sc==$ON2_OK);

sleep 1;

} while($ier);

print "
Done!";

::print_encoder_status();

Flix2_Destroy($flix);

delete_flix2plgnhandlep($filterptr) if($filterptr);

delete_flix2plgnhandlep($codecptr) if($codecptr);

delete_flix2plgnhandlep($muxerptr) if($muxerptr);

delete_flix2handlep($flixptr);

}

$| = 1; #auto flush

print header;

print start_html("Flix CGI Process Sample - Perl");

$rpchost = "localhost";

my $prefix = "/var/www/cgi-bin/";

my $outdir = $prefix."flixmedia/out/";

print "


";

print "

process_sample.cgi version 1.8
";

print "Flix Engine client library v".

On2::flixengine2::Flix2_Version()."
";

($_= On2::flixengine2::Flix2_Copyright()) =~ s/\n/
/g;

print "$_

";

##verify outdir’s presence and accessibility

if ($rpchost eq "localhost" && !(-d $outdir && -w $outdir)) {

my ($i,$tt)=("’$outdir’",’$outdir’);

print "

****************************************
\n".

"WARNING: $i MUST exist and be writeable by flixd.\n".

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