]> git.sesse.net Git - mlt/commitdiff
Add filter_only to region transition.
authorj-b-m <jb@kdenlive.org>
Sat, 3 Sep 2011 22:33:16 +0000 (15:33 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 3 Sep 2011 22:33:16 +0000 (15:33 -0700)
YAML patch by Dan Dennedy

src/modules/core/transition_region.c
src/modules/core/transition_region.yml

index afab7f63b0cfa61e686f9f07fa088b2660a4e8cd..3822df9bbc532b28882e7d234ffe805aa9b0badf 100644 (file)
@@ -282,7 +282,7 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                // Index to hold the count
                int i = 0;
 
-               // We will get the 'b frame' from the composite only if it's NULL
+               // We will get the 'b frame' from the composite only if it's NULL (region filter)
                if ( b_frame == NULL )
                {
                        // Copy the region
@@ -293,6 +293,13 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                        mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), name, b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
                }
 
+               // filter_only prevents copying the alpha channel of the shape to the output frame
+               // by compositing filtered frame over itself
+               if ( mlt_properties_get_int( properties, "filter_only" ) )
+               {
+                       frame = composite_copy_region( composite, b_frame, position );
+               }
+
                // Make sure the filter is in the correct position
                while ( filter != NULL )
                {
index cf954706eabeb8094b68dce5c7276be683e36439..4c548f5a7b43fae2bfa81a780fe3920db93a601e 100644 (file)
@@ -43,3 +43,10 @@ parameters:
       
       See "composite" transition for details.
     readonly: no
+  - identifier: filter_only
+    title: Use region for filtering only
+    type: integer
+    minimum: 0
+    maximum: 1
+    default: 0
+    widget: checkbox