]> git.sesse.net Git - mlt/commitdiff
hold modifications and test card env var
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 6 Apr 2004 13:34:24 +0000 (13:34 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 6 Apr 2004 13:34:24 +0000 (13:34 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@269 d19143bc-622f-0410-bfdd-b5b2a6649095

demo/mlt_news
docs/framework.txt
src/framework/mlt_consumer.c
src/framework/mlt_factory.c
src/framework/mlt_frame.c
src/framework/mlt_properties.c
src/modules/fezzik/producer_hold.c
src/modules/gtk2/filter_rescale.c
src/modules/sdl/consumer_sdl.c

index 3fa4603a9d4647f3fc16974ab0249d0b5a2c3216..75bbab13f2e803343aec7d6ce6f4c3f86ca24a8e 100644 (file)
@@ -1,7 +1,7 @@
 inigo \
 colour:black out=199 \
 -track \
-hold:clip1.mpeg out=149 clip1.mpeg \
+hold:clip1.mpeg out=99 clip1.mpeg \
 -track \
 clip2.mpeg out=199 \
 -track \
@@ -11,9 +11,9 @@ pango: text=" Breaking News
  MLT Rocks the World" bgcolour=0xff000080 out=349 \
 -transition mix:1 a_track=0 b_track=2 in=0 out=149 \
 -transition mix:1 a_track=0 b_track=1 in=150 out=199 \
--transition composite:50%,15%:40%x40% a_track=0 b_track=1 in=0 out=149 \
+-transition composite:50%,15%:40%x40% a_track=0 b_track=1 in=0 out=174 \
 -transition composite:10%,15%:40%x40% a_track=0 b_track=2 in=0 out=199 \
--transition composite:50%,15%:40%x40% end=0,0:100%x100% a_track=0 b_track=1 distort=true in=149 out=199 \
+-transition composite:50%,15%:40%x40% end=3%,2%:94%x96% a_track=0 b_track=1 distort=true in=174 out=199 \
 -transition composite:10%,65%:90%x20% a_track=0 b_track=3 in=0 out=199 \
 -transition composite:10%,65%:90%x20% a_track=1 b_track=3 in=200 out=499 \
 $*
index a118e93809d2d034a1320f6563ea9f204265d6f1..07cc71282241f5fe64dabaeb6249915db67c15b3 100644 (file)
@@ -260,6 +260,8 @@ Factories:
        +------------------+------------------------------------+------------------+
        |MLT_CONSUMER      |The default consumer                |"sdl" or other    |
        +------------------+------------------------------------+------------------+
+       |MLT_TEST_CARD     |The default test card producer      |any producer      |
+       +------------------+------------------------------------+------------------+
 
        These values are initialised from the environment variables of the same
        name.
index 829c3e83a79e43fec967f2783b19de93ce77780a..dc7dfa17e40665b36a2a58c62f1b783bb40467ec 100644 (file)
@@ -78,6 +78,9 @@ int mlt_consumer_init( mlt_consumer this, void *child )
                // Default of all consumers is real time
                mlt_properties_set_int( properties, "real_time", 1 );
 
+               // Default to environment test card
+               mlt_properties_set( properties, "test_card", mlt_environment( "MLT_TEST_CARD" ) );
+
                // Hmm - default all consumers to yuv422 :-/
                this->format = mlt_image_yuv422;
        }
index 4b92fe412eab40ffb6a715ab66686fa085387e65..38ac605b9ba7b88b62784f834bbfc02e6ac27fc1 100644 (file)
@@ -65,6 +65,7 @@ int mlt_factory_init( char *prefix )
                mlt_properties_set_or_default( global_properties, "MLT_NORMALISATION", getenv( "MLT_NORMALISATION" ), "PAL" );
                mlt_properties_set_or_default( global_properties, "MLT_PRODUCER", getenv( "MLT_PRODUCER" ), "fezzik" );
                mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" );
+               mlt_properties_set( global_properties, "MLT_TEST_CARD", getenv( "MLT_TEST_CARD" ) );
 
                // Create the object list.
                object_list = mlt_properties_new( );
index 0924cbbc780e9e0ee155c2c90cd0bc33885aa98b..1b147a6926ed111b2b12a59e94ba36f42534895d 100644 (file)
@@ -219,13 +219,14 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
                if ( test_frame != NULL )
                {
                        mlt_properties test_properties = mlt_frame_properties( test_frame );
-                       mlt_properties_set_double( test_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
-                       mlt_properties_set( test_properties, "rescale.interp", "nearest" );
+                       mlt_properties_pass( properties, test_properties, "" );
                        mlt_frame_get_image( test_frame, buffer, format, width, height, writable );
                        mlt_properties_set_data( properties, "test_card_frame", test_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
                        mlt_properties_set_data( properties, "image", *buffer, *width * *height * 2, NULL, NULL );
                        mlt_properties_set_int( properties, "width", *width );
                        mlt_properties_set_int( properties, "height", *height );
+                       mlt_properties_set( properties, "rescale.interps", "none" );
+                       mlt_properties_set( properties, "scale", "off" );
                }
                else
                {
index 899bf9ad60516ca2fe9c822dd732d508659ccc77..fa624d48a15ffd7b725cd4e91a654f1fabb4a9ab 100644 (file)
@@ -537,7 +537,7 @@ void mlt_properties_dump( mlt_properties this, FILE *output )
        property_list *list = this->private;
        int i = 0;
        for ( i = 0; i < list->count; i ++ )
-               fprintf( stderr, "%s=%s\n", list->name[ i ], mlt_properties_get( this, list->name[ i ] ) );
+               fprintf( output, "%s=%s\n", list->name[ i ], mlt_properties_get( this, list->name[ i ] ) );
 }
 
 /** Close the list.
index caff4b8a4c71b376e2cef96d5da986e001716bb5..d1fdf08bd33f08fc568f304b7f394b97c729e933 100644 (file)
@@ -86,19 +86,49 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        // Obtain the real frame
        mlt_frame real_frame = mlt_frame_pop_service( frame );
 
-       // We want distorted to ensure we don't hit the resize filter twice
-       mlt_properties_set_int( properties, "distort", 1 );
-
        // Get the image from the real frame
-       mlt_frame_get_image( real_frame, buffer, format, width, height, writable );
+       int size = 0;
+       *buffer = mlt_properties_get_data( mlt_frame_properties( real_frame ), "image", &size );
+       *width = mlt_properties_get_int( mlt_frame_properties( real_frame ), "width" );
+       *height = mlt_properties_get_int( mlt_frame_properties( real_frame ), "height" );
+
+       // If this is the first time, get it from the producer
+       if ( *buffer == NULL )
+       {
+               mlt_properties_pass( mlt_frame_properties( real_frame ), properties, "" );
+
+               // We'll deinterlace on the downstream deinterlacer
+               mlt_properties_set_int( mlt_frame_properties( real_frame ), "consumer_deinterlace", 1 );
+
+               // We want distorted to ensure we don't hit the resize filter twice
+               mlt_properties_set_int( mlt_frame_properties( real_frame ), "distort", 1 );
+
+               // Get the image
+               mlt_frame_get_image( real_frame, buffer, format, width, height, writable );
+       
+               // Make sure we get the size
+               *buffer = mlt_properties_get_data( mlt_frame_properties( real_frame ), "image", &size );
+       }
+
+       mlt_properties_pass( properties, mlt_frame_properties( real_frame ), "" );
 
        // Set the values obtained on the frame
-       mlt_properties_set_data( properties, "image", *buffer, *width * *height * 2, NULL, NULL );
-       mlt_properties_set_int( properties, "width", *width );
-       mlt_properties_set_int( properties, "height", *height );
+       if ( *buffer != NULL )
+       {
+               uint8_t *image = mlt_pool_alloc( size );
+               memcpy( image, *buffer, size );
+               *buffer = image;
+               mlt_properties_set_data( properties, "image", *buffer, size, mlt_pool_release, NULL );
+       }
+       else
+       {
+               // Pass the current image as is
+               mlt_properties_set_data( properties, "image", *buffer, size, NULL, NULL );
+       }
 
-       // We'll deinterlace on the downstream deinterlacer
-       mlt_properties_set_int( mlt_frame_properties( real_frame ), "consumer_deinterlace", 1 );
+       // Make sure that no further scaling is done
+       mlt_properties_set( properties, "rescale.interps", "none" );
+       mlt_properties_set( properties, "scale", "off" );
 
        // All done
        return 0;
@@ -116,22 +146,33 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
        if ( *frame != NULL )
        {
                // Define the real frame
-               mlt_frame real_frame = NULL;
-
-               // Get the producer
-               mlt_producer producer = mlt_properties_get_data( properties, "producer", NULL );
-
-               // Get the frame position requested
-               mlt_position position = mlt_properties_get_position( properties, "frame" );
-
-               // Seek the producer to the correct place
-               mlt_producer_seek( producer, position );
-
-               // Get the real frame
-               mlt_service_get_frame( mlt_producer_service( producer ), &real_frame, index );
-
-               // Ensure that the real frame gets wiped
-               mlt_properties_set_data( mlt_frame_properties( *frame ), "real_frame", real_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
+               mlt_frame real_frame = mlt_properties_get_data( properties, "real_frame", NULL );
+
+               // Obtain real frame if we don't have it
+               if ( real_frame == NULL )
+               {
+                       // Get the producer
+                       mlt_producer producer = mlt_properties_get_data( properties, "producer", NULL );
+
+                       // Get the frame position requested
+                       mlt_position position = mlt_properties_get_position( properties, "frame" );
+
+                       // Seek the producer to the correct place
+                       mlt_producer_seek( producer, position );
+
+                       // Get the real frame
+                       mlt_service_get_frame( mlt_producer_service( producer ), &real_frame, index );
+
+                       // Ensure that the real frame gets wiped eventually
+                       mlt_properties_set_data( properties, "real_frame", real_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
+               }
+               else
+               {
+                       // Temporary fix - ensure that we aren't seen as a test frame
+                       int8_t *image = mlt_properties_get_data( mlt_frame_properties( real_frame ), "image", NULL );
+                       mlt_properties_set_data( mlt_frame_properties( *frame ), "image", image, 0, NULL, NULL );
+                       mlt_properties_set_int( mlt_frame_properties( *frame ), "test_image", 0 );
+               }
 
                // Stack the real frame and method
                mlt_frame_push_service( *frame, real_frame );
@@ -139,9 +180,6 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
 
                // Ensure that the consumer sees what the real frame has
                mlt_properties_pass( mlt_frame_properties( *frame ), mlt_frame_properties( real_frame ), "" );
-
-               // Mirror the properties of the frame
-               mlt_properties_mirror( mlt_frame_properties( *frame ), mlt_frame_properties( real_frame ) );
        }
 
        // Move to the next position
index 92b2b7b6713c9de90daae075afd9204f622f9d82..f9789a6efc254c4d16b37286da2d4b401a2e702f 100644 (file)
@@ -50,13 +50,6 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
        char *interps = mlt_properties_get( properties, "rescale.interp" );
        int interp = PIXOPS_INTERP_BILINEAR;
        
-       if ( strcmp( interps, "nearest" ) == 0 )
-               interp = PIXOPS_INTERP_NEAREST;
-       else if ( strcmp( interps, "tiles" ) == 0 )
-               interp = PIXOPS_INTERP_TILES;
-       else if ( strcmp( interps, "hyper" ) == 0 )
-               interp = PIXOPS_INTERP_HYPER;
-
        // If real_width/height exist, we want that as minimum information
        if ( mlt_properties_get_int( properties, "real_width" ) )
        {
@@ -80,6 +73,16 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
        // Get the image as requested
        mlt_frame_get_image( this, &input, format, &iwidth, &iheight, writable );
 
+       // Get rescale interpretation again, in case the producer wishes to override scaling
+       interps = mlt_properties_get( properties, "rescale.interp" );
+
+       if ( strcmp( interps, "nearest" ) == 0 )
+               interp = PIXOPS_INTERP_NEAREST;
+       else if ( strcmp( interps, "tiles" ) == 0 )
+               interp = PIXOPS_INTERP_TILES;
+       else if ( strcmp( interps, "hyper" ) == 0 )
+               interp = PIXOPS_INTERP_HYPER;
+
        if ( input != NULL )
        {
                // If width and height are correct, don't do anything
index 41eea141ed2208dc5e9f56c5f469740213605637..0d17499b42402263d529de64b161df8d815bf5a6 100644 (file)
@@ -169,7 +169,14 @@ int consumer_start( mlt_consumer parent )
                pthread_attr_t thread_attributes;
                
                this->running = 1;
-               
+
+               // Allow the user to force resizing to window size
+               if ( mlt_properties_get_int( this->properties, "resize" ) )
+               {
+                       mlt_properties_set_int( this->properties, "width", this->width );
+                       mlt_properties_set_int( this->properties, "height", this->height );
+               }
+
                // Inherit the scheduling priority
                pthread_attr_init( &thread_attributes );
                pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );