]> git.sesse.net Git - mlt/commitdiff
replace this with frame and filter
authorDan Dennedy <dan@dennedy.org>
Thu, 13 Sep 2012 17:00:35 +0000 (10:00 -0700)
committerDan Dennedy <dan@dennedy.org>
Thu, 13 Sep 2012 17:00:35 +0000 (10:00 -0700)
src/modules/xine/filter_deinterlace.c

index c028da916b9870baf7599a81e33d03742a1895f9..ab14dc068a3972e5164ba051ab5f5e5b5298d7b1 100644 (file)
@@ -176,15 +176,15 @@ static int deinterlace_yadif( mlt_frame frame, mlt_filter filter, uint8_t **imag
 /** Do it :-).
 */
 
-static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
+static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
 {
        int error = 0;
-       mlt_properties properties = MLT_FRAME_PROPERTIES( this );
+       mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
        int deinterlace = mlt_properties_get_int( properties, "consumer_deinterlace" );
        int progressive = mlt_properties_get_int( properties, "progressive" );
        
        // Pop the service off the stack
-       mlt_filter filter = mlt_frame_pop_service( this );
+       mlt_filter filter = mlt_frame_pop_service( frame );
 
        // Get the input image
        if ( deinterlace && !progressive )
@@ -217,13 +217,13 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                if ( method == DEINTERLACE_YADIF )
                {
                        int mode = 0;
-                       error = deinterlace_yadif( this, filter, image, format, width, height, mode );
+                       error = deinterlace_yadif( frame, filter, image, format, width, height, mode );
                        progressive = mlt_properties_get_int( properties, "progressive" );
                }
                else if ( method == DEINTERLACE_YADIF_NOSPATIAL )
                {
                        int mode = 2;
-                       error = deinterlace_yadif( this, filter, image, format, width, height, mode );
+                       error = deinterlace_yadif( frame, filter, image, format, width, height, mode );
                        progressive = mlt_properties_get_int( properties, "progressive" );
                }
                if ( error || ( method > DEINTERLACE_NONE && method < DEINTERLACE_YADIF ) )
@@ -236,7 +236,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                                method = DEINTERLACE_ONEFIELD;
                        
                        // Get the current frame's image
-                       error = mlt_frame_get_image( this, image, format, width, height, writable );
+                       error = mlt_frame_get_image( frame, image, format, width, height, writable );
                        progressive = mlt_properties_get_int( properties, "progressive" );
 
                        // Check that we aren't already progressive
@@ -247,13 +247,13 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                                uint8_t *new_image = mlt_pool_alloc( image_size );
 
                                deinterlace_yuv( new_image, image, *width * 2, *height, method );
-                               mlt_frame_set_image( this, new_image, image_size, mlt_pool_release );
+                               mlt_frame_set_image( frame, new_image, image_size, mlt_pool_release );
                                *image = new_image;
                        }
                }
                else if ( method == DEINTERLACE_NONE )
                {
-                       error = mlt_frame_get_image( this, image, format, width, height, writable );
+                       error = mlt_frame_get_image( frame, image, format, width, height, writable );
                }
                
                mlt_log_debug( MLT_FILTER_SERVICE( filter ), "error %d deint %d prog %d fmt %s method %s\n",
@@ -268,7 +268,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
        else
        {
                // Pass through
-               error = mlt_frame_get_image( this, image, format, width, height, writable );
+               error = mlt_frame_get_image( frame, image, format, width, height, writable );
        }
 
        if ( !deinterlace || progressive )
@@ -285,10 +285,10 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
 /** Deinterlace filter processing - this should be lazy evaluation here...
 */
 
-static mlt_frame deinterlace_process( mlt_filter this, mlt_frame frame )
+static mlt_frame deinterlace_process( mlt_filter filter, mlt_frame frame )
 {
-       // Push this on to the service stack
-       mlt_frame_push_service( frame, this );
+       // Push filter on to the service stack
+       mlt_frame_push_service( frame, filter );
 
        // Push the get_image method on to the stack
        mlt_frame_push_get_image( frame, filter_get_image );
@@ -307,13 +307,13 @@ static void on_service_changed( mlt_service owner, mlt_service filter )
 
 mlt_filter filter_deinterlace_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
-       mlt_filter this = mlt_filter_new( );
-       if ( this != NULL )
+       mlt_filter filter = mlt_filter_new( );
+       if ( filter != NULL )
        {
-               this->process = deinterlace_process;
-               mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "method", arg );
-               mlt_events_listen( MLT_FILTER_PROPERTIES( this ), this, "service-changed", (mlt_listener) on_service_changed ); 
+               filter->process = deinterlace_process;
+               mlt_properties_set( MLT_FILTER_PROPERTIES( filter ), "method", arg );
+               mlt_events_listen( MLT_FILTER_PROPERTIES( filter ), filter, "service-changed", (mlt_listener) on_service_changed );
        }
-       return this;
+       return filter;
 }