]> git.sesse.net Git - mlt/commitdiff
src/framework/mlt_frame.c
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 5 Jul 2005 09:31:09 +0000 (09:31 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 5 Jul 2005 09:31:09 +0000 (09:31 +0000)
+ Correction for aspect ratio of synthesized test card

src/framework/mlt_playlist.c
+ Special case for handling fx cuts

src/modules/fezzik.dict
+ Convenience jfx and jef extensions for jahshaka

src/modules/core/transition_composite.c
+ Ensure that scaling and correct image extraction is handled

src/modules/core/transition_luma.c
+ Ensure that scaling and correct image extraction is handled

src/modules/gtk2/producer_pixbuf.c
+ Allow user overrides for progressive and aspect_ration

src/modules/westley/producer_westley.c
+ Special case for fx cuts

git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@748 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_frame.c
src/framework/mlt_playlist.c
src/modules/core/transition_composite.c
src/modules/core/transition_luma.c
src/modules/fezzik.dict
src/modules/gtk2/producer_pixbuf.c
src/modules/westley/producer_westley.c

index 712c8c25a0347dc71727187a4d96ea35ab18a4ed..2c67e761bab89cb801c7af8b223a14db292f9639 100644 (file)
@@ -312,7 +312,7 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
 
                mlt_properties_set_int( properties, "width", *width );
                mlt_properties_set_int( properties, "height", *height );
-               mlt_properties_set_int( properties, "aspect_ratio", 1 );
+               mlt_properties_set_int( properties, "aspect_ratio", 0 );
 
                switch( *format )
                {
index 0433a743779b084bbafa0c415e5c148cd6e2d54e..632eefb1eee8b1190798662d633da91111dcdbbd 100644 (file)
@@ -263,6 +263,18 @@ static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer source,
        // Fetch the cuts parent properties
        parent = MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( producer ) );
 
+       // Remove fezzik normalisers for fx cuts
+       if ( mlt_properties_get_int( parent, "meta.fx_cut" ) )
+       {
+               mlt_service service = MLT_PRODUCER_SERVICE( mlt_producer_cut_parent( producer ) );
+               mlt_filter filter = mlt_service_filter( service, 0 );
+               while ( filter != NULL && mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik" ) )
+               {
+                       mlt_service_detach( service, filter );
+                       filter = mlt_service_filter( service, 0 );
+               }
+       }
+
        // Check that we have room
        if ( this->count >= this->size )
        {
index 21909e8e026a7d945c930d699dc4e29114dd2308..1b4c5eec557a18ab7edc64dd941d496d3a23328d 100644 (file)
@@ -1012,6 +1012,10 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                int width_b = *width;
                int height_b = *height;
        
+               // Vars for alphas
+               uint8_t *alpha_a = NULL;
+               uint8_t *alpha_b = NULL;
+
                // Composites always need scaling... defaulting to lowest
                char *rescale = mlt_properties_get( a_props, "rescale.interp" );
                if ( rescale == NULL || !strcmp( rescale, "none" ) )
@@ -1040,10 +1044,14 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                }
 
                if ( a_frame == b_frame )
+               {
                        get_b_frame_image( this, b_frame, &image_b, &width_b, &height_b, &result );
+                       alpha_b = mlt_frame_get_alpha_mask( b_frame );
+               }
 
                // Get the image from the a frame
                mlt_frame_get_image( a_frame, image, format, width, height, 1 );
+               alpha_a = mlt_frame_get_alpha_mask( a_frame );
 
                // Optimisation - no compositing required
                if ( result.item.mix == 0 || ( result.item.w == 0 && result.item.h == 0 ) )
@@ -1076,8 +1084,6 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                {
                        uint8_t *dest = *image;
                        uint8_t *src = image_b;
-                       uint8_t *alpha_b = mlt_frame_get_alpha_mask( b_frame );
-                       uint8_t *alpha_a = mlt_frame_get_alpha_mask( a_frame );
                        int progressive = 
                                        mlt_properties_get_int( a_props, "consumer_deinterlace" ) ||
                                        mlt_properties_get_int( properties, "progressive" );
@@ -1085,6 +1091,9 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                        
                        int32_t luma_softness = mlt_properties_get_double( properties, "softness" ) * ( 1 << 16 );
                        uint16_t *luma_bitmap = get_luma( properties, width_b, height_b );
+
+                       alpha_b = alpha_b == NULL ? mlt_frame_get_alpha_mask( b_frame ) : alpha_b;
+
                        composite_line_fn line_fn = composite_line_yuv;
 
                        if ( mlt_properties_get_int( properties, "or" ) )
index ebdc82cf15a159607acd858e9dd8ebce69aad619..29eb09582d1de3192150c692a12ca170c7089662 100644 (file)
@@ -481,7 +481,7 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
        int reverse = mlt_properties_get_int( properties, "reverse" );
        int invert = mlt_properties_get_int( properties, "invert" );
 
-       if ( mlt_properties_get( a_props, "rescale.interp" ) == NULL )
+       if ( mlt_properties_get( a_props, "rescale.interp" ) == NULL || !strcmp( mlt_properties_get( a_props, "rescale.interp" ), "none" ) )
                mlt_properties_set( a_props, "rescale.interp", "nearest" );
 
        // Since we are the consumer of the b_frame, we must pass along this
@@ -490,10 +490,7 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                mlt_properties_set_double( a_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
        if ( mlt_properties_get_double( b_props, "aspect_ratio" ) == 0.0 )
                mlt_properties_set_double( b_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
-       if ( !strcmp( mlt_properties_get( a_props, "rescale.interp" ), "none" ) )
-               mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "aspect_ratio" ) );
-       else
-               mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
+       mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
 
        // Honour the reverse here
        if ( mix >= 1.0 )
@@ -503,7 +500,8 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
        frame_delta *= reverse || invert ? -1.0 : 1.0;
 
        // Ensure we get scaling on the b_frame
-       mlt_properties_set( b_props, "rescale.interp", "nearest" );
+       if ( mlt_properties_get( b_props, "rescale.interp" ) == NULL || !strcmp( mlt_properties_get( b_props, "rescale.interp" ), "none" ) )
+               mlt_properties_set( b_props, "rescale.interp", "nearest" );
 
        if ( mlt_properties_get( properties, "fixed" ) )
                mix = mlt_properties_get_double( properties, "fixed" );
index cb18e3f524b66dda37a1ee01ae9c4e40277a4331..42dea24125141a6a99c3880132b207bda18032d4 100644 (file)
@@ -9,6 +9,8 @@ http://*=avformat
 *.dif=mcdv,libdv
 *.gif=pixbuf
 *.graphics=westley
+*.jfx=westley
+*.jef=westley
 *.jpg=pixbuf
 *.jpeg=pixbuf
 *.kino=westley
index df23189cf086fd0482e298a9c49054f6ba60a4de..e2f4d252bf5b23c3cab864a137e8c6b8378b4dd0 100644 (file)
@@ -79,6 +79,8 @@ mlt_producer producer_pixbuf_init( char *filename )
                // Set the default properties
                mlt_properties_set( properties, "resource", filename );
                mlt_properties_set_int( properties, "ttl", 25 );
+               mlt_properties_set_int( properties, "aspect_ratio", 1 );
+               mlt_properties_set_int( properties, "progressive", 1 );
                
                return producer;
        }
@@ -282,10 +284,12 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        // Get the real structure for this producer
        producer_pixbuf this = producer->child;
 
-       if ( this->count == 0 && mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "resource" ) != NULL )
+       // Fetch the producers properties
+       mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer );
+
+       if ( this->count == 0 && mlt_properties_get( producer_properties, "resource" ) != NULL )
        {
-               mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
-               char *filename = mlt_properties_get( properties, "resource" );
+               char *filename = mlt_properties_get( producer_properties, "resource" );
                
                // Read xml string
                if ( strstr( filename, "<svg" ) )
@@ -313,14 +317,14 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                                this->filenames[ this->count ++ ] = strdup( fullname );
 
                                // Teehe - when the producer closes, delete the temp file and the space allo
-                               mlt_properties_set_data( properties, "__temporary_file__", this->filenames[ this->count - 1 ], 0, ( mlt_destructor )unlink, NULL );
+                               mlt_properties_set_data( producer_properties, "__temporary_file__", this->filenames[ this->count - 1 ], 0, ( mlt_destructor )unlink, NULL );
                        }
                }
                // Obtain filenames
                else if ( strchr( filename, '%' ) != NULL )
                {
                        // handle picture sequences
-                       int i = mlt_properties_get_int( properties, "begin" );
+                       int i = mlt_properties_get_int( producer_properties, "begin" );
                        int gap = 0;
                        char full[1024];
 
@@ -396,8 +400,8 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                refresh_image( *frame, 0, 0 );
 
                // Set producer-specific frame properties
-               mlt_properties_set_int( properties, "progressive", 1 );
-               mlt_properties_set_double( properties, "aspect_ratio", 1 );
+               mlt_properties_set_int( properties, "progressive", mlt_properties_get_int( producer_properties, "progressive" ) );
+               mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_properties, "aspect_ratio" ) );
 
                // Set alpha call back
                ( *frame )->get_alpha_mask = producer_get_alpha_mask;
index 4921e78bb91cc13adc11ff35079f0ed9add9b278..0869e101c922d20bf2fdfae0e5d5779fa312b583 100644 (file)
@@ -445,6 +445,7 @@ static void on_end_producer( deserialise_context context, const xmlChar *name )
 
                qualify_property( context, properties, "resource" );
                char *resource = mlt_properties_get( properties, "resource" );
+               int fx_cut = mlt_properties_get_int( properties, "meta.fx_cut" );
 
                // Let Kino-SMIL src be a synonym for resource
                if ( resource == NULL )
@@ -454,7 +455,7 @@ static void on_end_producer( deserialise_context context, const xmlChar *name )
                }
 
                // Instantiate the producer
-               if ( mlt_properties_get( properties, "mlt_service" ) != NULL )
+               if ( !fx_cut && mlt_properties_get( properties, "mlt_service" ) != NULL )
                {
                        char temp[ 1024 ];
                        strncpy( temp, mlt_properties_get( properties, "mlt_service" ), 1024 );
@@ -465,6 +466,10 @@ static void on_end_producer( deserialise_context context, const xmlChar *name )
                        }
                        producer = MLT_SERVICE( mlt_factory_producer( "fezzik", temp ) );
                }
+               else
+               {
+                       producer = MLT_SERVICE( mlt_factory_producer( mlt_properties_get( properties, "mlt_service" ), resource ) );
+               }
 
                // Just in case the plugin requested doesn't exist...
                if ( producer == NULL && resource != NULL )