Big modification - switch to macros for parent class access
[melted] / src / modules / core / filter_region.c
index 635b390..1e7ad17 100644 (file)
@@ -33,7 +33,7 @@
 static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 {
        // Get the properties of the filter
-       mlt_properties properties = mlt_filter_properties( this );
+       mlt_properties properties = MLT_FILTER_PROPERTIES( this );
 
        // Get the region transition
        mlt_transition transition = mlt_properties_get_data( properties, "_transition", NULL );
@@ -46,10 +46,13 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 
                // Register with the filter
                mlt_properties_set_data( properties, "_transition", transition, 0, ( mlt_destructor )mlt_transition_close, NULL );
+
+               // Pass a reference to this filter down
+               mlt_properties_set_data( MLT_TRANSITION_PROPERTIES( transition ), "_region_filter", this, 0, NULL, NULL );
        }
 
        // Pass all properties down
-       mlt_properties_pass( mlt_transition_properties( transition ), properties, "" );
+       mlt_properties_pass( MLT_TRANSITION_PROPERTIES( transition ), properties, "" );
 
        // Process the frame
        return mlt_transition_process( transition, frame, NULL );
@@ -67,13 +70,16 @@ mlt_filter filter_region_init( void *arg )
        if ( this != NULL )
        {
                // Get the properties from the filter
-               mlt_properties properties = mlt_filter_properties( this );
+               mlt_properties properties = MLT_FILTER_PROPERTIES( this );
 
                // Assign the filter process method
                this->process = filter_process;
 
                // Resource defines the shape of the region
                mlt_properties_set( properties, "resource", arg == NULL ? "rectangle" : arg );
+
+               // Ensure that attached filters are handled privately
+               mlt_properties_set_int( properties, "_filter_private", 1 );
        }
 
        // Return the filter