add video_standard enum to mlt_frame, add mlt_consumer_properties, add properties...
[melted] / 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 int vstd = mlt_video_standard_ntsc;
21 mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd );
22 mlt_properties_set_int( mlt_consumer_properties( consumer ), "video_standard", mlt_video_standard_ntsc );
23
24 // Create the producer(s)
25 mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
26
27 #if 0
28 // Connect the tractor to the consumer
29 mlt_consumer_connect( consumer, mlt_producer_service( dv1 ) );
30
31 // Do stuff until we're told otherwise...
32 fprintf( stderr, "Press return to continue\n" );
33 fgets( temp, 132, stdin );
34 mlt_consumer_close( consumer );
35 return 0;
36 #endif
37
38 //mlt_producer dv1 = producer_pixbuf_init( file1 );
39 //mlt_producer dv2 = producer_libdv_init( file2 );
40 //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
41 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>" );
42 mlt_properties_set_int( mlt_producer_properties( dv2 ), "video_standard", mlt_video_standard_ntsc );
43 mlt_properties_set_int( mlt_producer_properties( dv2 ), "bgcolor", 0x0000007f );
44 mlt_properties_set_int( mlt_producer_properties( dv2 ), "pad", 8 );
45
46 // Register producers(s) with a multitrack object
47 mlt_multitrack multitrack = mlt_multitrack_init( );
48 mlt_multitrack_connect( multitrack, dv1, 0 );
49 mlt_multitrack_connect( multitrack, dv2, 1 );
50
51 // Create a filter and associate it to track 0
52 // mlt_filter filter = mlt_factory_filter( "deinterlace", NULL );
53 // mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 );
54 // mlt_filter_set_in_and_out( filter, 0, 1000 );
55
56 // Define a transition
57 mlt_transition transition = mlt_factory_transition( "composite", NULL );
58 mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 );
59 mlt_transition_set_in_and_out( transition, 0, 1000 );
60
61 // Buy a tractor and connect it to the filter
62 mlt_tractor tractor = mlt_tractor_init( );
63 mlt_tractor_connect( tractor, mlt_transition_service( transition ) );
64
65 // Connect the tractor to the consumer
66 mlt_consumer_connect( consumer, mlt_tractor_service( tractor ) );
67
68 // Do stuff until we're told otherwise...
69 fprintf( stderr, "Press return to continue\n" );
70 fgets( temp, 132, stdin );
71
72 // Close everything...
73 mlt_consumer_close( consumer );
74 //mlt_tractor_close( tractor );
75 //mlt_filter_close( filter );
76 //mlt_multitrack_close( multitrack );
77 //mlt_producer_close( dv1 );
78 //mlt_producer_close( dv2 );
79
80 return 0;
81 }