1 #include <framework/mlt_factory.h>
3 #include <framework/mlt_producer.h>
4 #include <framework/mlt_consumer.h>
5 #include <framework/mlt_filter.h>
6 #include <framework/mlt_tractor.h>
7 #include <framework/mlt_transition.h>
8 #include <framework/mlt_multitrack.h>
12 int main( int argc
, char **argv
)
18 mlt_factory_init( "../modules" );
25 // Start the consumer...
26 mlt_consumer sdl_out
= mlt_factory_consumer( "sdl", NULL
);
28 fprintf( stderr
, "Press return to continue\n" );
29 fgets( temp
, 132, stdin
);
31 // Create the producer(s)
32 mlt_producer dv1
= mlt_factory_producer( "libdv", file1
);
33 mlt_producer dv2
= mlt_factory_producer( "libdv", file2
);
34 //mlt_producer dv1 = producer_ppm_init( NULL );
35 //mlt_producer dv2 = producer_ppm_init( NULL );
37 // Connect a producer to our sdl consumer
38 mlt_consumer_connect( sdl_out
, mlt_producer_service( dv1
) );
40 fprintf( stderr
, "Press return to continue\n" );
41 fgets( temp
, 132, stdin
);
43 // Register producers(s) with a multitrack object
44 mlt_multitrack multitrack
= mlt_multitrack_init( );
45 mlt_multitrack_connect( multitrack
, dv1
, 0 );
46 mlt_multitrack_connect( multitrack
, dv2
, 1 );
48 // Create a filter and associate it to track 0
49 mlt_filter filter
= mlt_factory_filter( "deinterlace", NULL
);
50 mlt_filter_connect( filter
, mlt_multitrack_service( multitrack
), 0 );
51 mlt_filter_set_in_and_out( filter
, 0, 5 );
54 mlt_filter greyscale
= mlt_factory_filter( "greyscale", NULL
);
55 mlt_filter_connect( greyscale
, mlt_filter_service( filter
), 0 );
56 mlt_filter_set_in_and_out( greyscale
, 0, 10 );
58 // Buy a tractor and connect it to the filter
59 mlt_tractor tractor
= mlt_tractor_init( );
60 mlt_tractor_connect( tractor
, mlt_filter_service( greyscale
) );
62 // Connect the tractor to the consumer
63 mlt_consumer_connect( sdl_out
, mlt_tractor_service( tractor
) );
65 // Do stuff until we're told otherwise...
66 fprintf( stderr
, "Press return to continue\n" );
67 fgets( temp
, 132, stdin
);
69 // Close everything...
70 //mlt_consumer_close( sdl_out );
71 //mlt_tractor_close( tractor );
72 //mlt_filter_close( filter );
73 //mlt_filter_close( greyscale );
74 //mlt_multitrack_close( multitrack );
75 //mlt_producer_close( dv1 );
76 //mlt_producer_close( dv2 );