]> git.sesse.net Git - mlt/commitdiff
Add consumer property top_field_first.
authorDan Dennedy <dan@dennedy.org>
Fri, 2 Sep 2011 03:29:55 +0000 (20:29 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 2 Sep 2011 03:29:55 +0000 (20:29 -0700)
src/framework/mlt_consumer.c
src/framework/mlt_consumer.h
src/framework/mlt_tractor.c
src/framework/mlt_transition.c
src/modules/core/filter_resize.c

index 31da9f7723fbac4e5e0f6336bc814ac68860a9a8..88d6b29a971b63dae2f63722f1a0fab7f5ac3269 100644 (file)
@@ -570,6 +570,7 @@ mlt_frame mlt_consumer_get_frame( mlt_consumer self )
                mlt_properties_set_double( frame_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "aspect_ratio" ) );
                mlt_properties_set_int( frame_properties, "consumer_deinterlace", mlt_properties_get_int( properties, "progressive" ) | mlt_properties_get_int( properties, "deinterlace" ) );
                mlt_properties_set( frame_properties, "deinterlace_method", mlt_properties_get( properties, "deinterlace_method" ) );
+               mlt_properties_set_int( frame_properties, "consumer_tff", mlt_properties_get_int( properties, "top_field_first" ) );
        }
 
        // Return the frame
index 5d8e1954b19f7a00e517ee084e19bff005276120..be938e996e71082b35cc2574d985c3d6eee62094 100644 (file)
@@ -67,6 +67,7 @@
  * \properties \em display_aspect_num the numerator of the video frame aspect ratio, overrides \p mlt_profile_s
  * \properties \em display_aspect_den the denominator of the video frame aspect ratio, overrides \p mlt_profile_s
  * \properties \em priority the OS scheduling priority for the render threads when real_time is not 0.
+ * \properties \em top_field_first when not progressive, whether interlace field order is top-field-first, defaults to 0
  */
 
 struct mlt_consumer_s
index 202977ba38f236533af7eaae7e3c32b7aa7c841b..17b0a47d1fa6a16c9491c467f95e0180d4e1478a 100644 (file)
@@ -272,6 +272,7 @@ static int producer_get_image( mlt_frame self, uint8_t **buffer, mlt_image_forma
        mlt_properties_set( frame_properties, "deinterlace_method", mlt_properties_get( properties, "deinterlace_method" ) );
        mlt_properties_set_int( frame_properties, "normalised_width", mlt_properties_get_int( properties, "normalised_width" ) );
        mlt_properties_set_int( frame_properties, "normalised_height", mlt_properties_get_int( properties, "normalised_height" ) );
+       mlt_properties_set_int( frame_properties, "consumer_tff", mlt_properties_get_int( properties, "consumer_tff" ) );
        mlt_frame_get_image( frame, buffer, format, width, height, writable );
        mlt_frame_set_image( self, *buffer, 0, NULL );
        mlt_properties_set_int( properties, "width", *width );
@@ -282,6 +283,7 @@ static int producer_get_image( mlt_frame self, uint8_t **buffer, mlt_image_forma
        mlt_properties_set_int( properties, "distort", mlt_properties_get_int( frame_properties, "distort" ) );
        mlt_properties_set_int( properties, "colorspace", mlt_properties_get_int( frame_properties, "colorspace" ) );
        mlt_properties_set_int( properties, "force_full_luma", mlt_properties_get_int( frame_properties, "force_full_luma" ) );
+       mlt_properties_set_int( properties, "top_field_first", mlt_properties_get_int( frame_properties, "top_field_first" ) );
        data = mlt_frame_get_alpha_mask( frame );
        mlt_properties_get_data( frame_properties, "alpha", &size );
        mlt_frame_set_alpha( self, data, size, NULL );
index dc4bc0fb2bdec3dc21256d3f188b616401355ce4..7657d6ec743fd1d736cc1be7abc5b052cd56795a 100644 (file)
@@ -345,7 +345,7 @@ static int get_image_b( mlt_frame b_frame, uint8_t **image, mlt_image_format *fo
                mlt_properties_set_double( b_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
 
        mlt_properties_pass_list( b_props, a_props,
-               "consumer_deinterlace, deinterlace_method, consumer_aspect_ratio" );
+               "consumer_deinterlace, deinterlace_method, consumer_aspect_ratio, consumer_tff" );
 
        return mlt_frame_get_image( b_frame, image, format, width, height, writable );
 }
index 35939b2b258518da47b87f6f379343b61206cbbd..3ba73ce29929ed9d0349a037bf6315feb2a356de 100644 (file)
@@ -272,13 +272,14 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                char *op = mlt_properties_get( MLT_FILTER_PROPERTIES( filter ), "scale" );
                int bpp;
                int size = mlt_image_format_size( *format, owidth, oheight, &bpp );
+               int tff = mlt_properties_get_int( properties, "consumer_tff" );
 
                // Provides a manual override for misreported field order
                if ( mlt_properties_get( properties, "meta.top_field_first" ) )
                        mlt_properties_set_int( properties, "top_field_first", mlt_properties_get_int( properties, "meta.top_field_first" ) );
 
                // Correct field order if needed
-               if ( mlt_properties_get_int( properties, "top_field_first" ) == 1 &&
+               if ( mlt_properties_get_int( properties, "top_field_first" ) != tff &&
                     mlt_properties_get( properties, "progressive" ) &&
                     mlt_properties_get_int( properties, "progressive" ) == 0 )
                {
@@ -291,8 +292,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        *image = new_image;
                        
                        // Set the normalised field order
-                       mlt_properties_set_int( properties, "top_field_first", 0 );
-                       mlt_properties_set_int( properties, "meta.top_field_first", 0 );
+                       mlt_properties_set_int( properties, "top_field_first", tff );
+                       mlt_properties_set_int( properties, "meta.top_field_first", tff );
                }
 
                if ( !strcmp( op, "affine" ) )