1 #include "mlt_producer.h"
2 #include "mlt_consumer.h"
3 #include "mlt_filter.h"
4 #include "mlt_tractor.h"
5 #include "mlt_transition.h"
6 #include "mlt_multitrack.h"
8 #include "producer_libdv.h"
9 #include "producer_ppm.h"
10 #include "filter_deinterlace.h"
11 #include "filter_greyscale.h"
12 #include "consumer_sdl.h"
16 int main( int argc
, char **argv
)
22 // Start the consumer...
23 mlt_consumer sdl_out
= consumer_sdl_init( NULL
);
25 fprintf( stderr
, "Press return to continue\n" );
26 fgets( temp
, 132, stdin
);
33 // Create the producer(s)
34 //mlt_producer dv1 = producer_ppm_init( NULL );
35 //mlt_producer dv2 = producer_ppm_init( NULL );
36 mlt_producer dv1
= producer_libdv_init( file1
);
37 mlt_producer dv2
= producer_libdv_init( file2
);
39 mlt_consumer_connect( sdl_out
, mlt_producer_service( dv1
) );
41 fprintf( stderr
, "Press return to continue\n" );
42 fgets( temp
, 132, stdin
);
44 // Register producers(s) with a multitrack object
45 mlt_multitrack multitrack
= mlt_multitrack_init( );
46 mlt_multitrack_connect( multitrack
, dv1
, 0 );
47 mlt_multitrack_connect( multitrack
, dv2
, 1 );
49 // Create a filter and associate it to track 0
50 mlt_filter filter
= filter_deinterlace_init( NULL
);
51 mlt_filter_connect( filter
, mlt_multitrack_service( multitrack
), 0 );
52 mlt_filter_set_in_and_out( filter
, 0, 5 );
55 mlt_filter greyscale
= filter_greyscale_init( NULL
);
56 mlt_filter_connect( greyscale
, mlt_filter_service( filter
), 0 );
57 mlt_filter_set_in_and_out( greyscale
, 0, 10 );
59 // Buy a tractor and connect it to the filter
60 mlt_tractor tractor
= mlt_tractor_init( );
61 mlt_tractor_connect( tractor
, mlt_filter_service( greyscale
) );
63 // Connect the tractor to the consumer
64 mlt_consumer_connect( sdl_out
, mlt_tractor_service( tractor
) );
66 // Do stuff until we're told otherwise...
67 fprintf( stderr
, "Press return to continue\n" );
68 fgets( temp
, 132, stdin
);
70 // Close everything...
71 mlt_consumer_close( sdl_out
);
72 mlt_tractor_close( tractor
);
73 mlt_filter_close( filter
);
74 mlt_multitrack_close( multitrack
);
75 mlt_producer_close( dv1
);
76 mlt_producer_close( dv2
);