]> git.sesse.net Git - mlt/blob - src/tests/dan.c
add sample aspect ratio scaling output to producer_pixbuf, fix a bug in rgb to yuv...
[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 sdl_out = mlt_factory_consumer( "sdl", NULL );
21
22         // Create the producer(s)
23         mlt_producer dv1 = mlt_factory_producer( "libdv", file1 );
24         //mlt_producer dv1 = producer_pixbuf_init( file1 );
25         //mlt_producer dv2 = producer_libdv_init( file2 );
26         //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
27         mlt_producer dv2 = mlt_factory_producer( "pango", "<span font_desc=\"Sans Bold 24\">Mutton Lettuce Tomato</span>" );
28
29         // Register producers(s) with a multitrack object
30         mlt_multitrack multitrack = mlt_multitrack_init( );
31         mlt_multitrack_connect( multitrack, dv1, 0 );
32         mlt_multitrack_connect( multitrack, dv2, 1 );
33
34         // Create a filter and associate it to track 0
35         mlt_filter filter = mlt_factory_filter( "deinterlace", NULL );
36         mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 );
37         mlt_filter_set_in_and_out( filter, 0, 1000 );
38
39         // Define a transition
40         mlt_transition transition = mlt_factory_transition( "composite", NULL );
41         mlt_transition_connect( transition, mlt_filter_service( filter ), 0, 1 );
42         mlt_transition_set_in_and_out( transition, 0, 1000 );
43
44         // Buy a tractor and connect it to the filter
45         mlt_tractor tractor = mlt_tractor_init( );
46         mlt_tractor_connect( tractor, mlt_transition_service( transition ) );
47
48         // Connect the tractor to the consumer
49         mlt_consumer_connect( sdl_out, mlt_tractor_service( tractor ) );
50
51         // Do stuff until we're told otherwise...
52         fprintf( stderr, "Press return to continue\n" );
53         fgets( temp, 132, stdin );
54
55         // Close everything...
56         //mlt_consumer_close( sdl_out );
57         //mlt_tractor_close( tractor );
58         //mlt_filter_close( filter );
59         //mlt_multitrack_close( multitrack );
60         //mlt_producer_close( dv1 );
61         //mlt_producer_close( dv2 );
62
63         return 0;
64 }