From fd3aef837f5389623f29fee989c74f056723aa4c Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Tue, 3 Aug 2004 17:50:49 +0000 Subject: [PATCH] Mutable shapes on regions git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@351 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/core/filter_watermark.c | 4 ++-- src/modules/core/transition_region.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/core/filter_watermark.c b/src/modules/core/filter_watermark.c index f23ac60..afe036e 100644 --- a/src/modules/core/filter_watermark.c +++ b/src/modules/core/filter_watermark.c @@ -53,7 +53,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format char *resource = mlt_properties_get( properties, "resource" ); // Get the old resource - char *old_resource = mlt_properties_get( properties, "old_resource" ); + char *old_resource = mlt_properties_get( properties, "_old_resource" ); // Create a composite if we don't have one if ( composite == NULL ) @@ -95,7 +95,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format mlt_properties_set( mlt_producer_properties( producer ), "eof", "loop" ); // Set the old resource - mlt_properties_set( properties, "old_resource", resource ); + mlt_properties_set( properties, "_old_resource", resource ); } } diff --git a/src/modules/core/transition_region.c b/src/modules/core/transition_region.c index a4b4cab..2cbc978 100644 --- a/src/modules/core/transition_region.c +++ b/src/modules/core/transition_region.c @@ -245,6 +245,9 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for // Get the resource of this filter (could be a shape [rectangle/circle] or an alpha provider of choice char *resource = mlt_properties_get( properties, "resource" ); + // Get the old resource in case it's changed + char *old_resource = mlt_properties_get( properties, "_old_resource" ); + // String to hold the filter to query on char id[ 256 ]; @@ -288,11 +291,14 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for mlt_producer producer = mlt_properties_get_data( properties, "producer", NULL ); // If We have no producer then create one - if ( producer == NULL ) + if ( producer == NULL || ( old_resource != NULL && strcmp( resource, old_resource ) ) ) { // Get the factory producer service char *factory = mlt_properties_get( properties, "factory" ); + // Store the old resource + mlt_properties_set( properties, "_old_resource", resource ); + // Special case circle resource if ( strcmp( resource, "circle" ) == 0 ) { -- 1.7.4.4