]> git.sesse.net Git - mlt/commitdiff
replace legacy real_width and _height with meta.media.width and .height
authorDan Dennedy <dan@dennedy.org>
Mon, 5 Mar 2012 05:04:36 +0000 (21:04 -0800)
committerDan Dennedy <dan@dennedy.org>
Mon, 5 Mar 2012 07:08:07 +0000 (23:08 -0800)
This takes advantage of mlt_producer copying all meta properties from
producer to frame so we do not have to remember to do it everywhere it
is needed.

19 files changed:
src/framework/mlt_tractor.c
src/modules/avformat/producer_avformat.c
src/modules/core/consumer_multi.c
src/modules/core/filter_crop.c
src/modules/core/filter_rescale.c
src/modules/core/filter_resize.c
src/modules/core/producer_colour.c
src/modules/core/producer_consumer.c
src/modules/core/producer_loader.c
src/modules/core/transition_composite.c
src/modules/dv/producer_libdv.c
src/modules/gtk2/producer_pango.c
src/modules/gtk2/producer_pixbuf.c
src/modules/kdenlive/producer_framebuffer.c
src/modules/plus/transition_affine.c
src/modules/sdl/producer_sdl_image.c
src/modules/swfdec/producer_swfdec.c
src/modules/videostab/filter_videostab2.c
src/modules/vmfx/producer_pgm.c

index 97c6a172e604893859032936d4a20596a112791f..714b2df5ded7958f76cc1d5916a19004ca4685a3 100644 (file)
@@ -500,8 +500,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int tra
                                mlt_properties_set_data( video_properties, "global_queue", data_queue, 0, destroy_data_queue, NULL );
                                mlt_properties_set_int( frame_properties, "width", mlt_properties_get_int( video_properties, "width" ) );
                                mlt_properties_set_int( frame_properties, "height", mlt_properties_get_int( video_properties, "height" ) );
-                               mlt_properties_set_int( frame_properties, "real_width", mlt_properties_get_int( video_properties, "real_width" ) );
-                               mlt_properties_set_int( frame_properties, "real_height", mlt_properties_get_int( video_properties, "real_height" ) );
+                               mlt_properties_pass_list( frame_properties, video_properties, "meta.media.width, meta.media.height" );
                                mlt_properties_set_int( frame_properties, "progressive", mlt_properties_get_int( video_properties, "progressive" ) );
                                mlt_properties_set_double( frame_properties, "aspect_ratio", mlt_properties_get_double( video_properties, "aspect_ratio" ) );
                                mlt_properties_set_int( frame_properties, "image_count", image_count );
index 74658a8b9a2d65b514052e1e277bab6b537456fc..208e8406e3c5491d397b03e49811119bfa87921d 100644 (file)
@@ -2099,11 +2099,8 @@ static void producer_set_up_video( producer_avformat self, mlt_frame frame )
                // Set the width and height
                mlt_properties_set_int( frame_properties, "width", self->video_codec->width );
                mlt_properties_set_int( frame_properties, "height", self->video_codec->height );
-               // real_width and real_height are deprecated in favor of meta.media.width and .height
                mlt_properties_set_int( properties, "meta.media.width", self->video_codec->width );
                mlt_properties_set_int( properties, "meta.media.height", self->video_codec->height );
-               mlt_properties_set_int( frame_properties, "real_width", self->video_codec->width );
-               mlt_properties_set_int( frame_properties, "real_height", self->video_codec->height );
                mlt_properties_set_double( frame_properties, "aspect_ratio", aspect_ratio );
                mlt_properties_set_int( frame_properties, "colorspace", self->colorspace );
 
@@ -2111,7 +2108,6 @@ static void producer_set_up_video( producer_avformat self, mlt_frame frame )
                if ( self->video_codec->height == 1088 && mlt_profile_dar( mlt_service_profile( MLT_PRODUCER_SERVICE( producer ) ) ) == 16.0/9.0 )
                {
                        mlt_properties_set_int( properties, "meta.media.height", 1080 );
-                       mlt_properties_set_int( frame_properties, "real_height", 1080 );
                }
 
                // Add our image operation
index 948bf4a9fe9c2325e8bdae445272068a6bf4b644..03a849ea268fc7c0d8364f2560574377a8e33880 100644 (file)
@@ -85,7 +85,7 @@ static void create_filter( mlt_profile profile, mlt_service service, char *effec
 
        // The swscale and avcolor_space filters require resolution as arg to test compatibility
        if ( strncmp( effect, "swscale", 7 ) == 0 || strncmp( effect, "avcolo", 6 ) == 0 )
-               arg = (char*) mlt_properties_get_int( MLT_SERVICE_PROPERTIES( service ), "_real_width" );
+               arg = (char*) mlt_properties_get_int( MLT_SERVICE_PROPERTIES( service ), "meta.media.width" );
 
        mlt_filter filter = mlt_factory_filter( profile, id, arg );
        if ( filter != NULL )
index 168f687b9b0d0ed80a1b7d7e0ae4d3c257569aaf..f8ba65ed2ae4aee82ae14e8e65e5dfad15483cc5 100644 (file)
@@ -158,8 +158,8 @@ static mlt_frame filter_process( mlt_filter filter, mlt_frame frame )
                int right  = mlt_properties_get_int( filter_props, "right" );
                int top    = mlt_properties_get_int( filter_props, "top" );
                int bottom = mlt_properties_get_int( filter_props, "bottom" );
-               int width  = mlt_properties_get_int( frame_props, "real_width" );
-               int height = mlt_properties_get_int( frame_props, "real_height" );
+               int width  = mlt_properties_get_int( frame_props, "meta.media.width" );
+               int height = mlt_properties_get_int( frame_props, "meta.media.height" );
                int use_profile = mlt_properties_get_int( filter_props, "use_profile" );
                mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
 
@@ -214,8 +214,8 @@ static mlt_frame filter_process( mlt_filter filter, mlt_frame frame )
                mlt_properties_set_int( frame_props, "crop.bottom", bottom );
                mlt_properties_set_int( frame_props, "crop.original_width", width );
                mlt_properties_set_int( frame_props, "crop.original_height", height );
-               mlt_properties_set_int( frame_props, "real_width", width - left - right );
-               mlt_properties_set_int( frame_props, "real_height", height - top - bottom );
+               mlt_properties_set_int( frame_props, "meta.media.width", width - left - right );
+               mlt_properties_set_int( frame_props, "meta.media.height", height - top - bottom );
        }
        return frame;
 }
index 0f9bb9701770f4e1b58feffeef200c93c03e4888..2f7f933fab6517ffde052efc05be9145626e1d00 100644 (file)
@@ -184,11 +184,11 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                        mlt_properties_set( properties, "rescale.interp", interps );
                }
        
-               // If real_width/height exist, we want that as minimum information
-               if ( mlt_properties_get_int( properties, "real_width" ) )
+               // If meta.media.width/height exist, we want that as minimum information
+               if ( mlt_properties_get_int( properties, "meta.media.width" ) )
                {
-                       iwidth = mlt_properties_get_int( properties, "real_width" );
-                       iheight = mlt_properties_get_int( properties, "real_height" );
+                       iwidth = mlt_properties_get_int( properties, "meta.media.width" );
+                       iheight = mlt_properties_get_int( properties, "meta.media.height" );
                }
        
                // Let the producer know what we are actually requested to obtain
index 84c91f74f8e9f5d2ceef95c95b9ffe36c44f27bd..17a6aa389d186b8e60ec7246033b92a4ea17ff4c 100644 (file)
@@ -212,8 +212,8 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                // Normalise the input and out display aspect
                int normalised_width = profile->width;
                int normalised_height = profile->height;
-               int real_width = mlt_properties_get_int( properties, "real_width" );
-               int real_height = mlt_properties_get_int( properties, "real_height" );
+               int real_width = mlt_properties_get_int( properties, "meta.media.width" );
+               int real_height = mlt_properties_get_int( properties, "meta.media.height" );
                if ( real_width == 0 )
                        real_width = mlt_properties_get_int( properties, "width" );
                if ( real_height == 0 )
index 91c354b134d296433ed241dd400b85e60f589a27..99598fec1434704c9ffd3910102bde8106eb98cd 100644 (file)
@@ -221,8 +221,8 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        mlt_frame_set_image( frame, *buffer, size, mlt_pool_release );
        mlt_frame_set_alpha( frame, alpha, alpha_size, mlt_pool_release );
        mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_props, "aspect_ratio" ) );
-       mlt_properties_set_int( properties, "real_width", *width );
-       mlt_properties_set_int( properties, "real_height", *height );
+       mlt_properties_set_int( properties, "meta.media.width", *width );
+       mlt_properties_set_int( properties, "meta.media.height", *height );
 
 
        return 0;
index ab11b4ded82c56f94c25f645c2585a269dcfda26..e31fc84e6440c93d0f79e2c0cd4bdfbc689d6cb9 100644 (file)
@@ -192,8 +192,8 @@ static int get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
                mlt_properties_set_double( frame_props, "aspect_ratio", mlt_profile_sar( cx->profile ) );
                mlt_properties_set_int( frame_props, "width", cx->profile->width );
                mlt_properties_set_int( frame_props, "height", cx->profile->height );
-               mlt_properties_set_int( frame_props, "real_width", cx->profile->width );
-               mlt_properties_set_int( frame_props, "real_height", cx->profile->height );
+               mlt_properties_set_int( frame_props, "meta.media.width", cx->profile->width );
+               mlt_properties_set_int( frame_props, "meta.media.height", cx->profile->height );
                mlt_properties_set_int( frame_props, "progressive", cx->profile->progressive );
        }
 
index 2cebacca9b0495fc0a6f29a6efe541a0ab006f77..d381e3bc58b51968c571036ec1e6c033679302f7 100644 (file)
@@ -143,7 +143,7 @@ static void create_filter( mlt_profile profile, mlt_producer producer, char *eff
 
        // The swscale and avcolor_space filters require resolution as arg to test compatibility
        if ( strncmp( effect, "swscale", 7 ) == 0 || strncmp( effect, "avcolo", 6 ) == 0 )
-               arg = (char*) mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( producer ), "_real_width" );
+               arg = (char*) mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( producer ), "meta.media.width" );
 
        mlt_filter filter = mlt_factory_filter( profile, id, arg );
        if ( filter != NULL )
index 83d21d31d19251e858fb37d7110667d28aec8683..45d6a23be54021d48d1909f0b9788ee526796ea1 100644 (file)
@@ -772,8 +772,8 @@ static int get_b_frame_image( mlt_transition self, mlt_frame b_frame, uint8_t **
        // TODO: Use the animatable w and h of the crop geometry to scale independently of crop rectangle
        if ( mlt_properties_get( properties, "crop" ) )
        {
-               int real_width = get_value( b_props, "real_width", "width" );
-               int real_height = get_value( b_props, "real_height", "height" );
+               int real_width = get_value( b_props, "meta.media.width", "width" );
+               int real_height = get_value( b_props, "meta.media.height", "height" );
                double input_ar = mlt_properties_get_double( b_props, "aspect_ratio" );
                int scaled_width = rint( ( input_ar == 0.0 ? output_ar : input_ar ) / output_ar * real_width );
                int scaled_height = real_height;
@@ -786,8 +786,8 @@ static int get_b_frame_image( mlt_transition self, mlt_frame b_frame, uint8_t **
                // Adjust b_frame pixel aspect
                int normalised_width = geometry->item.w;
                int normalised_height = geometry->item.h;
-               int real_width = get_value( b_props, "real_width", "width" );
-               int real_height = get_value( b_props, "real_height", "height" );
+               int real_width = get_value( b_props, "meta.media.width", "width" );
+               int real_height = get_value( b_props, "meta.media.height", "height" );
                double input_ar = mlt_properties_get_double( b_props, "aspect_ratio" );
                int scaled_width = rint( ( input_ar == 0.0 ? output_ar : input_ar ) / output_ar * real_width );
                int scaled_height = real_height;
index 5125d2e3d7505708533a1961cc80c863017d0f27..c461aaa0c7e0f03913433dd43962aef2d526f9d0 100644 (file)
@@ -289,6 +289,8 @@ static int producer_collect_info( producer_libdv this, mlt_profile profile )
                        mlt_properties_set( properties, "meta.media.1.stream.type", "audio" );
                        mlt_properties_set( properties, "meta.media.1.codec.name", "pcm_s16le" );
                        mlt_properties_set( properties, "meta.media.1.codec.long_name", "signed 16-bit little-endian PCM" );
+                       mlt_properties_set_int( properties, "meta.media.width", 720 );
+                       mlt_properties_set_int( properties, "meta.media.height", this->is_pal ? 576 : 480 );
 
                        // Return the decoder
                        dv_decoder_return( dv_decoder );
@@ -503,8 +505,6 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                // Update other info on the frame
                mlt_properties_set_int( properties, "width", 720 );
                mlt_properties_set_int( properties, "height", this->is_pal ? 576 : 480 );
-               mlt_properties_set_int( properties, "real_width", 720 );
-               mlt_properties_set_int( properties, "real_height", this->is_pal ? 576 : 480 );
                mlt_properties_set_int( properties, "top_field_first", !this->is_pal ? 0 : ( data[ 5 ] & 0x07 ) == 0 ? 0 : 1 );
                mlt_properties_set_int( properties, "colorspace", 601 );
        
index ef4985c5d3818812355706799a7f8172eeaa761f..363e53916093265560b6bcf00417721f3491bd97 100644 (file)
@@ -442,8 +442,8 @@ static void refresh_image( mlt_frame frame, int width, int height )
                        g_object_ref( pixbuf );
                        mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), "pixbuf", pixbuf, 0, ( mlt_destructor )g_object_unref, NULL );
 
-                       mlt_properties_set_int( producer_props, "real_width", gdk_pixbuf_get_width( pixbuf ) );
-                       mlt_properties_set_int( producer_props, "real_height", gdk_pixbuf_get_height( pixbuf ) );
+                       mlt_properties_set_int( producer_props, "meta.media.width", gdk_pixbuf_get_width( pixbuf ) );
+                       mlt_properties_set_int( producer_props, "meta.media.height", gdk_pixbuf_get_height( pixbuf ) );
 
                        // Store the width/height of the pixbuf temporarily
                        this->width = gdk_pixbuf_get_width( pixbuf );
@@ -484,8 +484,6 @@ static void refresh_image( mlt_frame frame, int width, int height )
        // Set width/height
        mlt_properties_set_int( properties, "width", this->width );
        mlt_properties_set_int( properties, "height", this->height );
-       mlt_properties_set_int( properties, "real_width", mlt_properties_get_int( producer_props, "real_width" ) );
-       mlt_properties_set_int( properties, "real_height", mlt_properties_get_int( producer_props, "real_height" ) );
 }
 
 static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
index 493c79308137aed4a8f12fbc40237c751e613acc..c4288dc0944056572c9605ec4e68297f6db27ba5 100644 (file)
@@ -321,8 +321,8 @@ static int refresh_pixbuf( producer_pixbuf self, mlt_frame frame )
                        self->height = gdk_pixbuf_get_height( self->pixbuf );
 
                        mlt_events_block( producer_props, NULL );
-                       mlt_properties_set_int( producer_props, "_real_width", self->width );
-                       mlt_properties_set_int( producer_props, "_real_height", self->height );
+                       mlt_properties_set_int( producer_props, "meta.media.width", self->width );
+                       mlt_properties_set_int( producer_props, "meta.media.height", self->height );
                        mlt_properties_set_int( producer_props, "_disable_exif", disable_exif );
                        mlt_events_unblock( producer_props, NULL );
 
@@ -333,8 +333,6 @@ static int refresh_pixbuf( producer_pixbuf self, mlt_frame frame )
        // Set width/height of frame
        mlt_properties_set_int( properties, "width", self->width );
        mlt_properties_set_int( properties, "height", self->height );
-       mlt_properties_set_int( properties, "real_width", mlt_properties_get_int( producer_props, "_real_width" ) );
-       mlt_properties_set_int( properties, "real_height", mlt_properties_get_int( producer_props, "_real_height" ) );
 
        return current_idx;
 }
index 7df00cc5a8095d152cb7f4c4cc9706c45c34cca4..a7a81ff025483417db1da39c3839b5dcb2f8f914 100644 (file)
@@ -237,8 +237,8 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                // Give the returned frame temporal identity
                mlt_frame_set_position( *frame, mlt_producer_position( producer ) );
 
-               mlt_properties_set_int( frame_properties, "real_width", mlt_properties_get_int( properties, "width" ) );
-               mlt_properties_set_int( frame_properties, "real_height", mlt_properties_get_int( properties, "height" ) );
+               mlt_properties_set_int( frame_properties, "meta.media.width", mlt_properties_get_int( properties, "width" ) );
+               mlt_properties_set_int( frame_properties, "meta.media.height", mlt_properties_get_int( properties, "height" ) );
                mlt_properties_pass_list( frame_properties, properties, "width, height" );
        }
 
index cbac275889122e41f78b1b4d547e9a4bb57364c2..0ee92d3e63f3656e4ec2b1c9b17fa3dca6fa083f 100644 (file)
@@ -421,8 +421,8 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
        result.y = ( result.y * *height / normalised_height );
 
        // Request full resolution of b frame image.
-       b_width = mlt_properties_get_int( b_props, "real_width" );
-       b_height = mlt_properties_get_int( b_props, "real_height" );
+       b_width = mlt_properties_get_int( b_props, "meta.media.width" );
+       b_height = mlt_properties_get_int( b_props, "meta.media.height" );
        mlt_properties_set_int( b_props, "rescale_width", b_width );
        mlt_properties_set_int( b_props, "rescale_height", b_height );
 
index 2890ad319acecfee100447dd95cd921d26838720..6bee9ee2130ef1197c08a73ce27e7ee13ff453d3 100644 (file)
@@ -157,8 +157,8 @@ static SDL_Surface *load_image( mlt_producer producer )
                                surface->refcount ++;
                                mlt_properties_set_data( properties, "_surface", surface, 0, ( mlt_destructor )SDL_FreeSurface, 0 );
                                mlt_properties_set( properties, "_last_resource", this_resource );
-                               mlt_properties_set_int( properties, "_real_width", surface->w );
-                               mlt_properties_set_int( properties, "_real_height", surface->h );
+                               mlt_properties_set_int( properties, "meta.media.width", surface->w );
+                               mlt_properties_set_int( properties, "meta.media.height", surface->h );
                        }
                }
                else if ( surface != NULL )
@@ -195,8 +195,6 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                        mlt_properties_set_int( properties, "progressive", 1 );
                        mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_props, "aspect_ratio" ) );
                        mlt_properties_set_data( properties, "surface", surface, 0, ( mlt_destructor )SDL_FreeSurface, NULL );
-                       mlt_properties_set_int( properties, "real_width", surface->w );
-                       mlt_properties_set_int( properties, "real_height", surface->h );
 
                        // Push the get_image method
                        mlt_frame_push_get_image( *frame, producer_get_image );
index 4d70e14114d49d397212867b2db3cd3df001a340..88d338f955bad8c34102f27b4bd774b0d5cc63b0 100644 (file)
@@ -180,8 +180,6 @@ static int get_frame( mlt_producer producer, mlt_frame_ptr frame, int index )
        mlt_properties_set_int( properties, "test_image", 0 );
        mlt_properties_set_int( properties, "width", swfdec->width );
        mlt_properties_set_int( properties, "height", swfdec->height );
-       mlt_properties_set_int( properties, "real_width", swfdec->width );
-       mlt_properties_set_int( properties, "real_height", swfdec->height );
        mlt_properties_set_int( properties, "progressive", 1 );
        mlt_properties_set_double( properties, "aspect_ratio", 1.0 );
        mlt_properties_set_position( properties, "swfdec.position", mlt_producer_frame( producer ) );
index a71e6064a76e2d60a3004e4d020894e9578d45f8..d6bd6855c71b190500577ebf0b5e911d7968eddf 100644 (file)
@@ -174,8 +174,8 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
 
                                        int interp = 2;
                                        float scale_zoom=1.0;
-                                       if (*width!=mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "real_width" ))
-                                               scale_zoom=(float)*width/(float)mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "real_width" );
+                                       if ( *width != mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "meta.media.width" ) )
+                                               scale_zoom = (float) *width / (float) mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "meta.media.width" );
                                        if ( strcmp( interps, "nearest" ) == 0 || strcmp( interps, "neighbor" ) == 0 )
                                                interp = 0;
                                        else if ( strcmp( interps, "tiles" ) == 0 || strcmp( interps, "fast_bilinear" ) == 0 )
index 3988da64c1cc102d190d4be28a4b1fc3092e24be..5a74fa036ec896d450b9ae0f97f41d652102dd5c 100644 (file)
@@ -45,8 +45,8 @@ mlt_producer producer_pgm_init( mlt_profile profile, mlt_service_type type, cons
                        this->close = ( mlt_destructor )producer_close;
                        mlt_properties_set( properties, "resource", resource );
                        mlt_properties_set_data( properties, "image", image, 0, mlt_pool_release, NULL );
-                       mlt_properties_set_int( properties, "real_width", width );
-                       mlt_properties_set_int( properties, "real_height", height );
+                       mlt_properties_set_int( properties, "meta.media.width", width );
+                       mlt_properties_set_int( properties, "meta.media.height", height );
                }
                else
                {
@@ -155,8 +155,8 @@ static int read_pgm( char *name, uint8_t **image, int *width, int *height, int *
 static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
 {
        mlt_producer producer = mlt_frame_pop_service( this );
-       int real_width = mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "real_width" );
-       int real_height = mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "real_height" );
+       int real_width = mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "meta.media.width" );
+       int real_height = mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "meta.media.height" );
        int size = real_width * real_height;
        uint8_t *image = mlt_pool_alloc( size * 2 );
        uint8_t *source = mlt_properties_get_data( MLT_PRODUCER_PROPERTIES( producer ), "image", NULL );
@@ -183,7 +183,6 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
 
        // Pass the data on the frame properties
-       mlt_properties_pass_list( properties, MLT_PRODUCER_PROPERTIES( producer ), "real_width,real_height" );
        mlt_properties_set_int( properties, "has_image", 1 );
        mlt_properties_set_int( properties, "progressive", 1 );
        mlt_properties_set_double( properties, "aspect_ratio", 1 );