]> git.sesse.net Git - mlt/blob - src/swig/perl/play.pl
Reorganize mlt++ files.
[mlt] / src / swig / perl / play.pl
1 #!/usr/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 # Establish the MLT profile
10 $profile = new mltpp::Profile( undef );
11
12 # Create the producer
13 $p = new mltpp::Producer( $profile, $ARGV[0] );
14
15 if ( $p->is_valid( ) )
16 {
17         # Loop the video
18         $p->set( "eof", "loop" );
19
20         # Create the consumer
21         $c = new mltpp::FilteredConsumer( $profile, "sdl" );
22
23         # Turn of the default rescaling
24         $c->set( "rescale", "none" );
25
26         # Connect the producer to the consumer
27         $c->connect( $p );
28         
29         $e = $c->setup_wait_for( "consumer-stopped" );
30
31         # Start the consumer
32         $c->start;
33
34         # Wait until the user stops the consumer
35         $c->wait_for( $e );
36
37         $e = undef;
38         $c = undef;
39         $p = undef;
40 }
41 else
42 {
43         print "Unable to open $ARGV[0]\n";
44 }
45
46 mltpp::mlt_factory_close( );