Added play.pl
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 23 Aug 2004 19:15:02 +0000 (19:15 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 23 Aug 2004 19:15:02 +0000 (19:15 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@386 d19143bc-622f-0410-bfdd-b5b2a6649095

mlt++/swig/perl/play.pl [new file with mode: 0755]

diff --git a/mlt++/swig/perl/play.pl b/mlt++/swig/perl/play.pl
new file mode 100755 (executable)
index 0000000..1b2e5ac
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/env perl
+
+# Import required modules
+use mltpp;
+
+# Not sure why the mltpp::Factory.init method fails...
+mltpp::mlt_factory_init( undef );
+
+# Create the producer
+$p = new mltpp::Producer( $ARGV[0] );
+
+if ( $p->is_valid( ) )
+{
+       # Loop the video
+       $p->set( "eof", "loop" );
+
+       # Create the consumer
+       $c = new mltpp::Consumer( "sdl" );
+
+       # Turn of the default rescaling
+       $c->set( "rescale", "none" );
+
+       # Connect the producer to the consumer
+       $c->connect( $p );
+       
+       # Start the consumer
+       $c->start;
+
+       # Wait until the user stops the consumer
+       while ( !$c->is_stopped ) {
+               sleep( 1 );
+       }
+}
+else
+{
+       print "Unable to open $ARGV[0]\n";
+}
+