fixup and optimize edge conditions of composite; updated property handling of produce...
[melted] / src / tests / dan.c
index cdfd211..8e499bc 100644 (file)
@@ -18,8 +18,8 @@ int main( int argc, char **argv )
 
        // Start the consumer...
        int vstd = mlt_video_standard_ntsc;
-       mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd );
-       mlt_properties_set_int( mlt_consumer_properties( consumer ), "video_standard", mlt_video_standard_ntsc );
+       //mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd );
+       mlt_consumer consumer = mlt_factory_consumer( "sdl", "NTSC" );
 
        // Create the producer(s)
        mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
@@ -38,10 +38,15 @@ int main( int argc, char **argv )
        //mlt_producer dv1 = producer_pixbuf_init( file1 );
        //mlt_producer dv2 = producer_libdv_init( file2 );
        //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
-       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>" );
+       mlt_producer dv2 = mlt_factory_producer( "pango", NULL ); //"<span font_desc=\"Sans Bold 36\">Mutton <span font_desc=\"Luxi Serif Bold Oblique 36\">Lettuce</span> Tomato</span>" );
+       mlt_properties_set( mlt_producer_properties( dv2 ), "font", "Sans Bold 36" );
+       mlt_properties_set( mlt_producer_properties( dv2 ), "text", "Mutton Lettuce\nTomato" );
        mlt_properties_set_int( mlt_producer_properties( dv2 ), "video_standard", mlt_video_standard_ntsc );
        mlt_properties_set_int( mlt_producer_properties( dv2 ), "bgcolor", 0x0000007f );
        mlt_properties_set_int( mlt_producer_properties( dv2 ), "pad", 8 );
+       mlt_properties_set_int( mlt_producer_properties( dv2 ), "align", 1 );
+       mlt_properties_set_int( mlt_producer_properties( dv2 ), "x", -20 );
+       mlt_properties_set_int( mlt_producer_properties( dv2 ), "y", 40 );
 
        // Register producers(s) with a multitrack object
        mlt_multitrack multitrack = mlt_multitrack_init( );
@@ -49,14 +54,14 @@ int main( int argc, char **argv )
        mlt_multitrack_connect( multitrack, dv2, 1 );
 
        // Create a filter and associate it to track 0
-//     mlt_filter filter = mlt_factory_filter( "deinterlace", NULL );
-//     mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 );
-//     mlt_filter_set_in_and_out( filter, 0, 1000 );
+       mlt_filter filter = mlt_factory_filter( "deinterlace", NULL );
+       mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 );
+       mlt_filter_set_in_and_out( filter, 0, 1000 );
 
        // Define a transition
        mlt_transition transition = mlt_factory_transition( "composite", NULL );
-       mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 );
-       mlt_transition_set_in_and_out( transition, 0, 1000 );
+       mlt_transition_connect( transition, mlt_filter_service( filter ), 0, 1 );
+       mlt_transition_set_in_and_out( transition, 0, 5.0 );
 
        // Buy a tractor and connect it to the filter
        mlt_tractor tractor = mlt_tractor_init( );
@@ -69,6 +74,13 @@ int main( int argc, char **argv )
        fprintf( stderr, "Press return to continue\n" );
        fgets( temp, 132, stdin );
 
+       mlt_properties_set( mlt_producer_properties( dv2 ), "font", "Sans Oblique 36" );
+       mlt_properties_set( mlt_producer_properties( dv2 ), "text", "Mutton\nLettuce Tomato" );
+
+       // Do stuff until we're told otherwise...
+       fprintf( stderr, "Press return to continue\n" );
+       fgets( temp, 132, stdin );
+       
        // Close everything...
        mlt_consumer_close( consumer );
        mlt_tractor_close( tractor );