More event stuff
[melted] / mlt++ / swig / perl / play.pl
1 #!/bin/env perl
2
3 # Import required modules
4 use mltpp;
5
6 # Not sure why the mltpp::Factory.init method fails...
7 mltpp::mlt_factory_init( undef );
8
9 # Create the producer
10 $p = new mltpp::Producer( $ARGV[0] );
11
12 if ( $p->is_valid( ) )
13 {
14 # Loop the video
15 $p->set( "eof", "loop" );
16
17 # Create the consumer
18 $c = new mltpp::FilteredConsumer( "sdl" );
19
20 # Turn of the default rescaling
21 $c->set( "rescale", "none" );
22
23 # Connect the producer to the consumer
24 $c->connect( $p );
25
26 $e = $c->setup_wait_for( "consumer-stopped" );
27
28 # Start the consumer
29 $c->start;
30
31 # Wait until the user stops the consumer
32 $c->wait_for( $e );
33
34 $e = undef;
35 $c = undef;
36 $p = undef;
37 }
38 else
39 {
40 print "Unable to open $ARGV[0]\n";
41 }
42
43 mltpp::mlt_factory_close( );