208ee49eb6c194fdf52a106dff902b5be158b954
[melted] / mlt / src / tests / dan.c
1
2 #include <framework/mlt.h>
3
4 #include <stdio.h>
5
6 int main( int argc, char **argv )
7 {
8 char temp[ 132 ];
9 char *file1 = NULL;
10 char *file2 = NULL;
11
12 mlt_factory_init( "../modules" );
13
14 if ( argc >= 2 )
15 file1 = argv[ 1 ];
16 if ( argc >= 3 )
17 file2 = argv[ 2 ];
18
19 // Start the consumer...
20 mlt_consumer consumer = mlt_factory_consumer( "bluefish", NULL );
21
22 // Create the producer(s)
23 mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
24
25 //mlt_producer dv1 = producer_pixbuf_init( file1 );
26 //mlt_producer dv2 = producer_libdv_init( file2 );
27 //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
28 mlt_producer dv2 = mlt_factory_producer( "pango", "<span font_desc=\"Sans Bold 36\">Mutton <span font_desc=\"Luxi Serif Bold Oblique 36\">Lettuce</span> Tomato</span>" );
29
30 // Register producers(s) with a multitrack object
31 mlt_multitrack multitrack = mlt_multitrack_init( );
32 mlt_multitrack_connect( multitrack, dv1, 0 );
33 mlt_multitrack_connect( multitrack, dv2, 1 );
34
35 // Create a filter and associate it to track 0
36 // mlt_filter filter = mlt_factory_filter( "deinterlace", NULL );
37 // mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 );
38 // mlt_filter_set_in_and_out( filter, 0, 1000 );
39
40 // Define a transition
41 mlt_transition transition = mlt_factory_transition( "composite", NULL );
42 mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 );
43 mlt_transition_set_in_and_out( transition, 0, 1000 );
44
45 // Buy a tractor and connect it to the filter
46 mlt_tractor tractor = mlt_tractor_init( );
47 mlt_tractor_connect( tractor, mlt_transition_service( transition ) );
48
49 // Connect the tractor to the consumer
50 mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) );
51
52 // Do stuff until we're told otherwise...
53 fprintf( stderr, "Press return to continue\n" );
54 fgets( temp, 132, stdin );
55
56 // Close everything...
57 mlt_consumer_close( consumer );
58 //mlt_tractor_close( tractor );
59 //mlt_filter_close( filter );
60 //mlt_multitrack_close( multitrack );
61 //mlt_producer_close( dv1 );
62 //mlt_producer_close( dv2 );
63
64 return 0;
65 }