X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Ftests%2Fdan.c;h=3488768d253e4f2e234093d65e40d471ad60fcaa;hb=07b78feef159c84412ba097240d9755381c6fbd6;hp=99469a8dddbde1948209a68c01e67f5cf9244985;hpb=3e0edf239fc98d1180f73ff3ba4a0c1331147fae;p=melted diff --git a/src/tests/dan.c b/src/tests/dan.c index 99469a8..3488768 100644 --- a/src/tests/dan.c +++ b/src/tests/dan.c @@ -1,5 +1,8 @@ #include +#include "../modules/dv/producer_libdv.h" +#include "../modules/dv/consumer_libdv.h" +//#include "../modules/sdl/consumer_sdl.h" #include @@ -9,7 +12,8 @@ int main( int argc, char **argv ) char *file1 = NULL; char *file2 = NULL; - mlt_factory_init( "../modules" ); +// mlt_factory_init( "../modules" ); + mlt_pool_init( ); if ( argc >= 2 ) file1 = argv[ 1 ]; @@ -17,25 +21,30 @@ int main( int argc, char **argv ) file2 = argv[ 2 ]; // Start the consumer... - int vstd = mlt_video_standard_ntsc; + //int vstd = mlt_video_standard_ntsc; //mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd ); - mlt_consumer consumer = mlt_factory_consumer( "sdl", "NTSC" ); + //mlt_consumer consumer = mlt_factory_consumer( "sdl", NULL ); + mlt_consumer consumer = consumer_libdv_init( NULL ); // Create the producer(s) - mlt_producer dv1 = mlt_factory_producer( "mcdv", file1 ); - mlt_producer_set_in_and_out( dv1, 0.0, 2.0 ); - - mlt_producer dv2 = mlt_factory_producer( "mcmpeg", file2 ); + //mlt_producer dv1 = mlt_factory_producer( "libdv", file1 ); + mlt_producer dv1 = producer_libdv_init( file1 ); + //mlt_producer_set_in_and_out( dv1, 0, 5 ); + + mlt_producer dv2;// = mlt_factory_producer( "libdv", file2 ); //mlt_producer_set_in_and_out( dv2, 10.0, 30.0 ); -#if 0 +#if 1 // Connect the consumer to the producer mlt_consumer_connect( consumer, mlt_producer_service( dv1 ) ); // Do stuff until we're told otherwise... + mlt_consumer_start( consumer ); fprintf( stderr, "Press return to continue\n" ); fgets( temp, 132, stdin ); + mlt_consumer_stop( consumer ); mlt_consumer_close( consumer ); + mlt_pool_close( ); return 0; #endif @@ -43,22 +52,23 @@ int main( int argc, char **argv ) //mlt_producer dv2 = producer_libdv_init( file2 ); //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 ); #if 0 - mlt_producer dv2 = mlt_factory_producer( "pango", NULL ); //"Mutton Lettuce Tomato" ); - 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 ); + mlt_producer title = mlt_factory_producer( "pango", NULL ); //"Mutton Lettuce Tomato" ); + mlt_properties_set_int( mlt_producer_properties( title ), "video_standard", mlt_video_standard_ntsc ); + mlt_properties_set( mlt_producer_properties( title ), "font", "Sans Bold 36" ); + mlt_properties_set( mlt_producer_properties( title ), "text", "Mutton Lettuce\nTomato" ); + mlt_properties_set_int( mlt_producer_properties( title ), "bgcolor", 0x0000007f ); + mlt_properties_set_int( mlt_producer_properties( title ), "pad", 8 ); + mlt_properties_set_int( mlt_producer_properties( title ), "align", 1 ); + mlt_properties_set_int( mlt_producer_properties( title ), "x", 20 ); + mlt_properties_set_int( mlt_producer_properties( title ), "y", 40 ); #endif mlt_playlist playlist1 = mlt_playlist_init(); mlt_playlist_append( playlist1, dv1 ); + mlt_playlist_blank( playlist1, 1.0 ); mlt_playlist playlist2 = mlt_playlist_init(); - mlt_playlist_blank( playlist2, 1.0 ); + mlt_playlist_blank( playlist2, 3.0 ); mlt_playlist_append( playlist2, dv2 ); // Register producers(s) with a multitrack object @@ -74,8 +84,8 @@ int main( int argc, char **argv ) // Define a transition mlt_transition transition = mlt_factory_transition( "luma", NULL ); mlt_transition_connect( transition, mlt_multitrack_service( multitrack ), 0, 1 ); - mlt_transition_set_in_and_out( transition, 1.0, 2.0 ); - mlt_properties_set( mlt_transition_properties( transition ), "filename", "clock.pgm" ); + mlt_transition_set_in_and_out( transition, 3.0, 5.0 ); + //mlt_properties_set( mlt_transition_properties( transition ), "filename", "clock.pgm" ); mlt_properties_set_double( mlt_transition_properties( transition ), "softness", 0.1 ); // Buy a tractor and connect it to the filter @@ -92,7 +102,7 @@ int main( int argc, char **argv ) // Close everything... mlt_consumer_close( consumer ); mlt_tractor_close( tractor ); -// mlt_filter_close( filter ); + mlt_transition_close( transition ); mlt_multitrack_close( multitrack ); mlt_producer_close( dv1 ); mlt_producer_close( dv2 );