]> git.sesse.net Git - mlt/commitdiff
Remaining audio handling switched to stacks; Minor corrections to compositing and...
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 25 Jan 2005 12:35:26 +0000 (12:35 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 25 Jan 2005 12:35:26 +0000 (12:35 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@629 d19143bc-622f-0410-bfdd-b5b2a6649095

18 files changed:
src/modules/avformat/filter_avresample.c
src/modules/avformat/producer_avformat.c
src/modules/core/filter_channelcopy.c
src/modules/core/filter_watermark.c
src/modules/core/producer_noise.c
src/modules/core/producer_ppm.c
src/modules/core/transition_composite.c
src/modules/core/transition_luma.c
src/modules/core/transition_mix.c
src/modules/core/transition_region.c
src/modules/dv/producer_libdv.c
src/modules/feeds/PAL/etv.properties
src/modules/jackrack/filter_jackrack.c
src/modules/normalize/filter_volume.c
src/modules/plus/transition_affine.c
src/modules/resample/filter_resample.c
src/modules/sox/filter_sox.c
src/modules/vorbis/producer_vorbis.c

index ae0c5dfbd5f28796f142eef2d80f69a78e4fb63e..4ed2abafab404ebcbad6a4d4c000d1017fa087e4 100644 (file)
@@ -60,9 +60,6 @@ static int resample_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        if ( output_rate == 0 )
                output_rate = *frequency;
 
-       // Restore the original get_audio
-       frame->get_audio = mlt_frame_pop_audio( frame );
-
        // Get the producer's audio
        mlt_frame_get_audio( frame, buffer, format, frequency, &channels_avail, samples );
 
@@ -153,16 +150,13 @@ static int resample_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
 static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 {
        // Only call this if we have a means to get audio
-       if ( frame->get_audio != NULL )
+       if ( mlt_frame_is_test_audio( frame ) != 0 )
        {
-               // Push the original method on to the stack
-               mlt_frame_push_audio( frame, frame->get_audio );
-
                // Push the filter on to the stack
                mlt_frame_push_audio( frame, this );
 
                // Assign our get_audio method
-               frame->get_audio = resample_get_audio;
+               mlt_frame_push_audio( frame, resample_get_audio );
        }
 
        return frame;
index 24a7828a4debfd63afd523451d93d31f87b231c3..a9979c17016a741d5e52dd119576bb5ff5a14391 100644 (file)
@@ -921,7 +921,6 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        else
        {
                // Get silence and don't touch the context
-               frame->get_audio = NULL;
                mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples );
        }
 
@@ -984,7 +983,7 @@ static void producer_set_up_audio( mlt_producer this, mlt_frame frame )
                // No codec, no show...
                if ( codec != NULL )
                {
-                       frame->get_audio = producer_get_audio;
+                       mlt_frame_push_audio( frame, producer_get_audio );
                        mlt_properties_set_data( frame_properties, "avformat_producer", this, 0, NULL, NULL );
                }
        }
index d0ee59ba63ba56df583700c7ffbadce99b103267..8de9913fb703b642612f241bca25113228ec2214 100644 (file)
@@ -38,9 +38,6 @@ static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format
        int from = mlt_properties_get_int( properties, "channelcopy.from" );
        int to = mlt_properties_get_int( properties, "channelcopy.to" );
 
-       // Restore the original get_audio
-       frame->get_audio = mlt_properties_get_data( properties, "channelcopy.get_audio", NULL );
-
        // Get the producer's audio
        mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples );
 
@@ -76,11 +73,8 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
        mlt_properties_set_int( frame_props, "channelcopy.to", mlt_properties_get_int( properties, "to" ) );
        mlt_properties_set_int( frame_props, "channelcopy.from", mlt_properties_get_int( properties, "from" ) );
 
-       // Backup the original get_audio (it's still needed)
-       mlt_properties_set_data( frame_props, "channelcopy.get_audio", frame->get_audio, 0, NULL, NULL );
-
        // Override the get_audio method
-       frame->get_audio = filter_get_audio;
+       mlt_frame_push_audio( frame, filter_get_audio );
 
        return frame;
 }
index b4bd6a70b0999d306f553f66d12c4e9126b14eef..bfd491ee64f9225af40a3e52ec5e4d82b1f045b6 100644 (file)
@@ -174,7 +174,6 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                                if ( rescale == NULL || !strcmp( rescale, "none" ) )
                                        rescale = "hyper";
                                mlt_transition_process( composite, b_frame, frame );
-                               mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_int( a_props, "consumer_aspect_ratio" ) );
                                mlt_properties_set_int( a_props, "consumer_deinterlace", 1 );
                                mlt_properties_set_int( b_props, "consumer_deinterlace", 1 );
                                mlt_properties_set( a_props, "rescale.interp", rescale );
index 7746c0d855afb8f22e559feeb8fc6b10f907049c..8bc21c30e6ed422669bb4107234033fde857b2b5 100644 (file)
@@ -170,7 +170,7 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
                mlt_frame_push_get_image( *frame, producer_get_image );
 
                // Specify the audio
-               ( *frame )->get_audio = producer_get_audio;
+               mlt_frame_push_audio( *frame, producer_get_audio );
        }
 
        // Calculate the next timecode
index bd7269237caac57f8a574bdebfd5a8de13ef03f3..480ef4a1275893890098dca34178c743cf69a1d6 100644 (file)
@@ -249,7 +249,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        mlt_properties_set_data( properties, "audio.pipe", audio, 0, NULL, NULL );
 
        // Hmm - register audio callback
-       ( *frame )->get_audio = producer_get_audio;
+       mlt_frame_push_audio( *frame, producer_get_audio );
 
        // Update timecode on the frame we're creating
        mlt_frame_set_position( *frame, mlt_producer_position( producer ) );
index 93574a5b445bf8917500b31d8d75d088f720ee01..bac5561397010dfccbdcf947fde61f2425b56b1b 100644 (file)
@@ -106,13 +106,16 @@ static mlt_geometry transition_parse_keys( mlt_transition this, int normalised_w
        mlt_position in = mlt_transition_get_in( this );
        mlt_position out = mlt_transition_get_out( this );
        int length = out - in + 1;
+       double cycle = mlt_properties_get_double( properties, "cycle" );
 
        // Get the new style geometry string
        char *property = mlt_properties_get( properties, "geometry" );
 
        // Allow a geometry repeat cycle
-       if ( mlt_properties_get_int( properties, "cycle" ) )
-               length = mlt_properties_get_int( properties, "cycle" );
+       if ( cycle >= 1 )
+               length = cycle;
+       else if ( cycle > 0 )
+               length *= cycle;
 
        // Parse the geometry if we have one
        mlt_geometry_parse( geometry, property, length, normalised_width, normalised_height );
@@ -730,20 +733,9 @@ static int get_b_frame_image( mlt_transition this, mlt_frame b_frame, uint8_t **
                alignment_calculate( geometry );
 
        // Adjust to consumer scale
-       int x = geometry->item.x * *width / geometry->nw;
-       int y = geometry->item.y * *height / geometry->nh;
        *width = geometry->sw * *width / geometry->nw;
        *height = geometry->sh * *height / geometry->nh;
 
-       //x = ( x | 1 ) ^ 1;
-
-       // optimization points - no work to do
-       if ( *width < 1 || *height < 1 )
-               return 1;
-
-       if ( ( x < 0 && -x >= *width ) || ( y < 0 && -y >= *height ) )
-               return 1;
-
        ret = mlt_frame_get_image( b_frame, image, &format, width, height, 1 );
 
        return ret;
@@ -777,8 +769,11 @@ static mlt_geometry composite_calculate( mlt_transition this, struct geometry_s
        else
        {
                int length = mlt_transition_get_out( this ) - mlt_transition_get_in( this ) + 1;
-               if ( mlt_properties_get_int( properties, "cycle" ) )
-                       length = mlt_properties_get_int( properties, "cycle" );
+               double cycle = mlt_properties_get_double( properties, "cycle" );
+               if ( cycle > 1 )
+                       length = cycle;
+               else if ( cycle > 0 )
+                       length *= cycle;
                mlt_geometry_refresh( start, mlt_properties_get( properties, "geometry" ), length, normalised_width, normalised_height );
        }
 
@@ -927,15 +922,25 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
        // Get the transition from the a frame
        mlt_transition this = mlt_frame_pop_service( a_frame );
 
-       // This compositer is yuv422 only
-       *format = mlt_image_yuv422;
-
-       // Get the image from the a frame
-       mlt_frame_get_image( a_frame, image, format, width, height, 1 );
+       // Get in and out
+       int out = ( int )mlt_frame_pop_service( a_frame );
+       int in = ( int )mlt_frame_pop_service( a_frame );
 
        // Get the properties from the transition
        mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
 
+       // TODO: clean up always_active behaviour
+       if ( mlt_properties_get_int( properties, "always_active" ) )
+       {
+               mlt_events_block( properties, properties );
+               mlt_properties_set_int( properties, "in", in );
+               mlt_properties_set_int( properties, "out", out );
+               mlt_events_unblock( properties, properties );
+       }
+
+       // This compositer is yuv422 only
+       *format = mlt_image_yuv422;
+
        if ( b_frame != NULL )
        {
                // Get the properties of the a frame
@@ -959,6 +964,26 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                // Do the calculation
                composite_calculate( this, &result, a_frame, position );
 
+               // Since we are the consumer of the b_frame, we must pass along these
+               // consumer properties from the a_frame
+               mlt_properties_set_double( b_props, "consumer_deinterlace", mlt_properties_get_double( a_props, "consumer_deinterlace" ) );
+               mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
+               mlt_properties_set_int( b_props, "normalised_width", mlt_properties_get_double( a_props, "normalised_width" ) );
+               mlt_properties_set_int( b_props, "normalised_height", mlt_properties_get_double( a_props, "normalised_height" ) );
+
+               // TODO: Dangerous/temporary optimisation - if nothing to do, then do nothing
+               if ( mlt_properties_get_int( properties, "no_alpha" ) && 
+                        result.item.x == 0 && result.item.y == 0 && result.item.w == *width && result.item.h == *height && result.item.mix == 100 )
+               {
+                       mlt_frame_get_image( b_frame, image, format, width, height, 1 );
+                       if ( !mlt_frame_is_test_card( a_frame ) )
+                               mlt_frame_replace_image( a_frame, *image, *format, *width, *height );
+                       return 0;
+               }
+
+               // Get the image from the a frame
+               mlt_frame_get_image( a_frame, image, format, width, height, 1 );
+
                // Optimisation - no compositing required
                if ( result.item.mix == 0 || ( result.item.w == 0 && result.item.h == 0 ) )
                        return 0;
@@ -977,13 +1002,6 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                        mlt_properties_set_int( b_props, "dest_height", mlt_properties_get_int( a_props, "dest_height" ) );
                }
 
-               // Since we are the consumer of the b_frame, we must pass along these
-               // consumer properties from the a_frame
-               mlt_properties_set_double( b_props, "consumer_deinterlace", mlt_properties_get_double( a_props, "consumer_deinterlace" ) );
-               mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
-               mlt_properties_set_int( b_props, "normalised_width", mlt_properties_get_double( a_props, "normalised_width" ) );
-               mlt_properties_set_int( b_props, "normalised_height", mlt_properties_get_double( a_props, "normalised_height" ) );
-
                // Special case for titling...
                if ( mlt_properties_get_int( properties, "titles" ) )
                {
@@ -1034,6 +1052,10 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                        }
                }
        }
+       else
+       {
+               mlt_frame_get_image( a_frame, image, format, width, height, 1 );
+       }
 
        return 0;
 }
@@ -1046,11 +1068,28 @@ static mlt_frame composite_process( mlt_transition this, mlt_frame a_frame, mlt_
        // Get a unique name to store the frame position
        char *name = mlt_properties_get( MLT_TRANSITION_PROPERTIES( this ), "_unique_id" );
 
-       // Assign the current position to the name
-       mlt_properties_set_position( MLT_FRAME_PROPERTIES( a_frame ), name, mlt_frame_get_position( a_frame ) );
+       // UGH - this is a TODO - find a more reliable means of obtaining in/out for the always_active case
+       if ( mlt_properties_get_int(  MLT_TRANSITION_PROPERTIES( this ), "always_active" ) == 0 )
+       {
+               mlt_frame_push_service( a_frame, ( void * )mlt_properties_get_int( MLT_TRANSITION_PROPERTIES( this ), "in" ) );
+               mlt_frame_push_service( a_frame, ( void * )mlt_properties_get_int( MLT_TRANSITION_PROPERTIES( this ), "out" ) );
+
+               // Assign the current position to the name
+               mlt_properties_set_position( MLT_FRAME_PROPERTIES( a_frame ), name, mlt_frame_get_position( a_frame ) );
+
+               // Propogate the transition properties to the b frame
+               mlt_properties_set_double( MLT_FRAME_PROPERTIES( b_frame ), "relative_position", position_calculate( this, mlt_frame_get_position( a_frame ) ) );
+       }
+       else
+       {
+               mlt_properties props = mlt_properties_get_data( MLT_FRAME_PROPERTIES( b_frame ), "_producer", NULL );
+               mlt_frame_push_service( a_frame, ( void * )mlt_properties_get_int( props, "in" ) );
+               mlt_frame_push_service( a_frame, ( void * )mlt_properties_get_int( props, "out" ) );
+               mlt_properties_set_int( MLT_FRAME_PROPERTIES( b_frame ), "relative_position", mlt_properties_get_int( props, "_frame" ) );
 
-       // Propogate the transition properties to the b frame
-       mlt_properties_set_double( MLT_FRAME_PROPERTIES( b_frame ), "relative_position", position_calculate( this, mlt_frame_get_position( a_frame ) ) );
+               // Assign the current position to the name
+               mlt_properties_set_position( MLT_FRAME_PROPERTIES( a_frame ), name, mlt_properties_get_position( MLT_FRAME_PROPERTIES( b_frame ), "relative_position" ) );
+       }
        
        mlt_frame_push_service( a_frame, this );
        mlt_frame_push_frame( a_frame, b_frame );
@@ -1076,6 +1115,9 @@ mlt_transition transition_composite_init( char *arg )
                // Default factory
                mlt_properties_set( properties, "factory", "fezzik" );
 
+               // Inform apps and framework that this is a video only transition
+               mlt_properties_set_int( properties, "_transition_type", 1 );
+
 #ifdef USE_MMX
                //mlt_properties_set_int( properties, "_MMX", composite_have_mmx() );
 #endif
index 435aeb30b8ddff70209896e4ca927e1bcd1555ce..9da80b32005c8816ff8a9cffdeeb9dde177f13a3 100644 (file)
@@ -547,6 +547,9 @@ mlt_transition transition_luma_init( char *lumafile )
                // Set the main property
                mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "resource", lumafile );
                
+               // Inform apps and framework that this is a video only transition
+               mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "_transition_type", 1 );
+
                return transition;
        }
        return NULL;
index fbe911bc2d971fa9356cb2a23e18e96ab0af3f1d..ce0d06fa48ef9c14bc65a379e7942704657946ad 100644 (file)
 
 static int transition_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
 {
-       // Get the properties of the a frame
-       mlt_properties a_props = MLT_FRAME_PROPERTIES( frame );
-
        // Get the b frame from the stack
        mlt_frame b_frame = mlt_frame_pop_audio( frame );
 
        // Get the properties of the b frame
        mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
 
-       // Restore the original get_audio
-       frame->get_audio = mlt_properties_get_data( a_props, "mix.get_audio", NULL );
-
        double mix_start = 0.5, mix_end = 0.5;
        if ( mlt_properties_get( b_props, "audio.previous_mix" ) != NULL )
                mix_start = mlt_properties_get_double( b_props, "audio.previous_mix" );
@@ -71,55 +65,73 @@ static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt
        if ( mlt_properties_get( properties, "start" ) != NULL )
        {
                // Determine the time position of this frame in the transition duration
-               mlt_position in = mlt_transition_get_in( this );
-               mlt_position out = mlt_transition_get_out( this );
-               mlt_position time = mlt_frame_get_position( b_frame );
+               mlt_properties props = mlt_properties_get_data( MLT_FRAME_PROPERTIES( b_frame ), "_producer", NULL );
+               int always_active = mlt_properties_get_int(  MLT_TRANSITION_PROPERTIES( this ), "always_active" );
+               mlt_position in = !always_active ? mlt_transition_get_in( this ) : mlt_properties_get_int( props, "in" );
+               mlt_position out = !always_active ? mlt_transition_get_out( this ) : mlt_properties_get_int( props, "out" );
+               int length = mlt_properties_get_int(  MLT_TRANSITION_PROPERTIES( this ), "length" );
+               mlt_position time = !always_active ? mlt_frame_get_position( b_frame ) : mlt_properties_get_int( props, "_frame" );
                double mix = ( double )( time - in ) / ( double )( out - in + 1 );
-               
-               // If there is an end mix level adjust mix to the range
-               if ( mlt_properties_get( properties, "end" ) != NULL )
-               {
-                       double start = mlt_properties_get_double( properties, "start" );
-                       double end = mlt_properties_get_double( properties, "end" );
-                       mix = start + ( end - start ) * mix;
-               }
-               // A negative means total crossfade (uses position)
-               else if ( mlt_properties_get_double( properties, "start" ) >= 0 )
+
+               // TODO: Check the logic here - shouldn't we be computing current and next mixing levels in all cases?
+               if ( length == 0 )
                {
-                       // Otherwise, start/constructor is a constant mix level
-                   mix = mlt_properties_get_double( properties, "start" );
-               }
+                       // If there is an end mix level adjust mix to the range
+                       if ( mlt_properties_get( properties, "end" ) != NULL )
+                       {
+                               double start = mlt_properties_get_double( properties, "start" );
+                               double end = mlt_properties_get_double( properties, "end" );
+                               mix = start + ( end - start ) * mix;
+                       }
+                       // A negative means total crossfade (uses position)
+                       else if ( mlt_properties_get_double( properties, "start" ) >= 0 )
+                       {
+                               // Otherwise, start/constructor is a constant mix level
+                       mix = mlt_properties_get_double( properties, "start" );
+                       }
+               
+                       // Finally, set the mix property on the frame
+                       mlt_properties_set_double( b_props, "audio.mix", mix );
        
-               // Finally, set the mix property on the frame
-               mlt_properties_set_double( b_props, "audio.mix", mix );
-
-               // Initialise transition previous mix value to prevent an inadvertant jump from 0
-               if ( mlt_properties_get( properties, "previous_mix" ) == NULL )
+                       // Initialise transition previous mix value to prevent an inadvertant jump from 0
+                       if ( mlt_properties_get( properties, "previous_mix" ) == NULL )
+                               mlt_properties_set_double( properties, "previous_mix", mlt_properties_get_double( b_props, "audio.mix" ) );
+                               
+                       // Tell b frame what the previous mix level was
+                       mlt_properties_set_double( b_props, "audio.previous_mix", mlt_properties_get_double( properties, "previous_mix" ) );
+
+                       // Save the current mix level for the next iteration
                        mlt_properties_set_double( properties, "previous_mix", mlt_properties_get_double( b_props, "audio.mix" ) );
-                       
-               // Tell b frame what the previous mix level was
-               mlt_properties_set_double( b_props, "audio.previous_mix", mlt_properties_get_double( properties, "previous_mix" ) );
-
-               // Save the current mix level for the next iteration
-               mlt_properties_set_double( properties, "previous_mix", mlt_properties_get_double( b_props, "audio.mix" ) );
                
-               mlt_properties_set_double( b_props, "audio.reverse", mlt_properties_get_double( properties, "reverse" ) );
-       }
-
-       // Ensure that the tractor knows this isn't test audio...
-       if ( mlt_properties_get_int( MLT_FRAME_PROPERTIES( a_frame ), "test_audio" ) )
-       {
-               mlt_properties_set_int( MLT_FRAME_PROPERTIES( a_frame ), "test_audio", 0 );
-               mlt_properties_set_int( MLT_FRAME_PROPERTIES( a_frame ), "silent_audio", 1 );
+                       mlt_properties_set_double( b_props, "audio.reverse", mlt_properties_get_double( properties, "reverse" ) );
+               }
+               else
+               {
+                       double level = mlt_properties_get_double( properties, "start" );
+                       double mix_start = level;
+                       double mix_end = mix_start;
+                       double mix_increment = 1.0 / length;
+                       if ( time - in < length )
+                       {
+                               mix_start = mix_start * ( ( double )( time - in ) / length );
+                               mix_end = mix_start + mix_increment;
+                       }
+                       else if ( time > out - length )
+                       {
+                               mix_end = mix_start * ( ( double )( out - time - in ) / length );
+                               mix_start = mix_end - mix_increment;
+                       }
+
+                       mix_start = mix_start < 0 ? 0 : mix_start > level ? level : mix_start;
+                       mix_end = mix_end < 0 ? 0 : mix_end > level ? level : mix_end;
+                       mlt_properties_set_double( b_props, "audio.previous_mix", mix_start );
+                       mlt_properties_set_double( b_props, "audio.mix", mix_end );
+               }
        }
 
-       // Backup the original get_audio (it's still needed)
-       mlt_properties_set_data( MLT_FRAME_PROPERTIES( a_frame ), "mix.get_audio", a_frame->get_audio, 0, NULL, NULL );
-
        // Override the get_audio method
-       a_frame->get_audio = transition_get_audio;
-       
        mlt_frame_push_audio( a_frame, b_frame );
+       mlt_frame_push_audio( a_frame, transition_get_audio );
        
        return a_frame;
 }
@@ -135,7 +147,8 @@ mlt_transition transition_mix_init( char *arg )
                this->process = transition_process;
                if ( arg != NULL )
                        mlt_properties_set_double( MLT_TRANSITION_PROPERTIES( this ), "start", atof( arg ) );
-               mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( this ), "_accepts_blanks", 1 );
+               // Inform apps and framework that this is an audio only transition
+               mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( this ), "_transition_type", 2 );
        }
        return this;
 }
index 4934d3bebdea36425d73124910552e318401ea32..1bf836ee4377c1b20b5823c873a5e2070cc394c6 100644 (file)
@@ -441,6 +441,9 @@ mlt_transition transition_region_init( void *arg )
                
                // Resource defines the shape of the region
                mlt_properties_set( properties, "resource", arg == NULL ? "rectangle" : arg );
+
+               // Inform apps and framework that this is a video only transition
+               mlt_properties_set_int( properties, "_transition_type", 1 );
        }
 
        // Return the transition
index 0faa05a64466994ece38df1fa9afafd64967e9ef..9516c10339454559f025dd00e19ae9093ead0896 100644 (file)
@@ -374,7 +374,6 @@ static int producer_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_forma
        else
        {
                // No audio available on the frame, so get test audio (silence)
-               this->get_audio = NULL;
                mlt_frame_get_audio( this, buffer, format, frequency, channels, samples );
        }
 
@@ -424,7 +423,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                        dv_format_wide( dv_decoder ) ? ( this->is_pal ? 118.0/81.0 : 40.0/33.0 ) : ( this->is_pal ? 59.0/54.0 : 10.0/11.0 ) );
 
                // Hmm - register audio callback
-               ( *frame )->get_audio = producer_get_audio;
+               mlt_frame_push_audio( *frame, producer_get_audio );
 
                // Push the quality string
                mlt_frame_push_service( *frame, mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "quality" ) );
index 25bc45c0f31ac231ee742f5008590bd37ef1c499..85edcbe28184d5f51ce038f08e6fed80d144da6b 100644 (file)
@@ -15,7 +15,7 @@
 
 location=region
 .description=Titles
-.properties.markup=filter[1].producer.markup
+.properties.markup=filter[1].producer.text
 .properties.font=filter[1].producer.font
 .properties.size=filter[1].producer.size
 .period=2
@@ -27,7 +27,7 @@ location=region
 .filter[0].resource=colour:0x6c010100
 .filter[1]=watermark
 .filter[1].resource=pango:
-.filter[1].producer.markup=
+.filter[1].producer.text=
 .filter[1].producer.font=Sans
 .filter[1].producer.size=24
 .filter[1].composite.geometry=0,0:95%x100%
@@ -37,10 +37,9 @@ location=region
 
 courtesy=region
 .description=Courtesy
-.properties.markup=filter[1].producer.markup
+.properties.markup=filter[1].producer.text
 .properties.font=filter[1].producer.font
 .properties.size=filter[1].producer.size
-.type.markup=text
 .period=2
 .properties.length[0]=composite.out
 .composite.geometry=0,115:230x30:0;12=,:x:100
@@ -50,7 +49,7 @@ courtesy=region
 .filter[0].resource=colour:0x6c010100
 .filter[1]=watermark
 .filter[1].resource=pango:
-.filter[1].producer.markup=ETV Exclusive
+.filter[1].producer.text=
 .filter[1].producer.font=Sans
 .filter[1].producer.size=24
 .filter[1].composite.geometry=0,0:95%x100%
@@ -60,10 +59,9 @@ courtesy=region
 
 exclusive=region
 .description=Exclusive
-.properties.markup=filter[1].producer.markup
+.properties.markup=filter[1].producer.text
 .properties.font=filter[1].producer.font
 .properties.size=filter[1].producer.size
-.type.markup=text
 .period=2
 .properties.length[0]=composite.out
 .composite.geometry=-230,115:230x30;12=0
@@ -71,7 +69,7 @@ exclusive=region
 .filter[0].resource=colour:0x6c010100
 .filter[1]=watermark
 .filter[1].resource=pango:
-.filter[1].producer.markup=ETV Exclusive
+.filter[1].producer.text=ETV Exclusive
 .filter[1].producer.font=Sans
 .filter[1].producer.size=24
 .filter[1].producer.weight=700
@@ -91,7 +89,7 @@ file_shot=region
 .filter[0].resource=colour:0x6c010100
 .filter[1]=watermark
 .filter[1].resource=pango:
-.filter[1].producer.markup=File Shot
+.filter[1].producer.text=File Shot
 .filter[1].producer.font=Sans
 .filter[1].producer.size=18
 .filter[1].producer.weight=700
@@ -112,7 +110,7 @@ special=region
 .filter[0].composite.geometry=100%,0%:100%x100%:0;12=0%,0%:x:100
 .filter[1]=watermark
 .filter[1].resource=pango:
-.filter[1].producer.markup=Special
+.filter[1].producer.text=Special
 .filter[1].producer.font=Sans
 .filter[1].producer.size=24
 .filter[1].producer.weight=700
@@ -123,10 +121,9 @@ special=region
 
 ticker=region
 .description=Tickertape
-.properties.markup=filter[1].producer.markup
+.properties.markup=filter[1].producer.text
 .properties.font=filter[1].producer.font
 .properties.size=filter[1].producer.size
-.type.markup=text
 .properties.length[0]=filter[1].composite.out
 .composite.geometry=0,500:722x75
 .filter[0]=watermark
@@ -134,7 +131,7 @@ ticker=region
 .filter[0].composite.titles=1
 .filter[1]=watermark
 .filter[1].resource=pango:
-.filter[1].producer.markup=Ticker - provided for reference
+.filter[1].producer.text=Ticker - provided for reference
 .filter[1].producer.font=Sans
 .filter[1].producer.size=24
 .filter[1].producer.weight=700
@@ -144,8 +141,8 @@ ticker=region
 
 super=region
 .description=Transcription
-.properties.0=filter[1].producer.markup
-.properties.1=filter[2].producer.markup
+.properties.0=filter[1].producer.text
+.properties.1=filter[2].producer.text
 .properties.align=filter[1].composite.valign
 .properties.weight=filter[1].producer.weight
 .properties.f0=filter[1].producer.font
@@ -163,8 +160,7 @@ super=region
 .filter[0].composite.geometry=0,0:100%:100%:70
 .filter[1]=watermark
 .filter[1].resource=pango:
-.filter[1].producer.encoding=iso8859-1
-.filter[1].producer.markup=
+.filter[1].producer.text=
 .filter[1].producer.font=Sans
 .filter[1].producer.size=32
 .filter[1].producer.weight=700
@@ -174,8 +170,7 @@ super=region
 .filter[1].composite.valign=top
 .filter[2]=watermark
 .filter[2].resource=pango:
-.filter[2].producer.encoding=iso8859-1
-.filter[2].producer.markup=
+.filter[2].producer.text=
 .filter[2].producer.font=Sans
 .filter[2].producer.size=32
 .filter[2].producer.fgcolour=0x6c0101ff
index 37c75da6e7d2a57ff3fa9a9ed2455900f15dbc6f..a8803c82aaea851621d1f98ed034edb1a64c025d 100644 (file)
@@ -236,9 +236,6 @@ static int jackrack_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        // Get the filter properties
        mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
 
-       // Restore the original get_audio
-       frame->get_audio = mlt_frame_pop_audio( frame );
-       
        int jack_frequency = mlt_properties_get_int( filter_properties, "_sample_rate" );
 
        // Get the producer's audio
@@ -313,12 +310,11 @@ static int jackrack_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
 
 static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 {
-       if ( frame->get_audio != NULL )
+       if ( mlt_frame_is_test_audio( frame ) != 0 )
        {
                mlt_properties properties = MLT_FILTER_PROPERTIES( this );
-               mlt_frame_push_audio( frame, frame->get_audio );
                mlt_frame_push_audio( frame, this );
-               frame->get_audio = jackrack_get_audio;
+               mlt_frame_push_audio( frame, jackrack_get_audio );
                
                if ( mlt_properties_get_int( properties, "_sync" ) )
                        initialise_jack_ports( properties );
index c4822d1d9c51f1aadce015a31cd800f241fd2450..2c129c6a4e25d2f3747041cbcdbd9ac11e852d10 100644 (file)
@@ -186,9 +186,6 @@ static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format
        if ( mlt_properties_get( properties, "volume.limiter" ) != NULL )
                limiter_level = mlt_properties_get_double( properties, "volume.limiter" );
        
-       // Restore the original get_audio
-       frame->get_audio = mlt_properties_get_data( properties, "volume.get_audio", NULL );
-
        // Get the producer's audio
        mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples );
 //     fprintf( stderr, "filter_volume: frequency %d\n", *frequency );
@@ -435,11 +432,8 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
        // Put a filter reference onto the frame
        mlt_properties_set_data( properties, "filter_volume", this, 0, NULL, NULL );
 
-       // Backup the original get_audio (it's still needed)
-       mlt_properties_set_data( properties, "volume.get_audio", frame->get_audio, 0, NULL, NULL );
-
        // Override the get_audio method
-       frame->get_audio = filter_get_audio;
+       mlt_frame_push_audio( frame, filter_get_audio );
 
        return frame;
 }
index 806b14084d7883e4211430413b72cc974e97a5e2..6e10ab437ff954b5760615a6c9d973142af2fa8d 100644 (file)
@@ -700,6 +700,8 @@ mlt_transition transition_affine_init( char *arg )
                mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "sy", 1 );
                mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "distort", 0 );
                mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "start", "0,0:100%x100%" );
+               // Inform apps and framework that this is a video only transition
+               mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "_transition_type", 1 );
                transition->process = transition_process;
        }
        return transition;
index dbcc11889bab51b7b8509924668739a11d63aebc..72df0119a18664f923d0600a059069e8f2fc87f8 100644 (file)
@@ -58,9 +58,6 @@ static int resample_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        if ( output_rate == 0 )
                output_rate = *frequency;
 
-       // Restore the original get_audio
-       frame->get_audio = mlt_frame_pop_audio( frame );
-
        // Get the producer's audio
        mlt_frame_get_audio( frame, buffer, format, frequency, &channels_avail, samples );
 
@@ -164,11 +161,10 @@ static int resample_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
 
 static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 {
-       if ( frame->get_audio != NULL )
+       if ( mlt_frame_is_test_audio( frame ) != 0 )
        {
-               mlt_frame_push_audio( frame, frame->get_audio );
                mlt_frame_push_audio( frame, this );
-               frame->get_audio = resample_get_audio;
+               mlt_frame_push_audio( frame, resample_get_audio );
        }
 
        return frame;
index 355a8abad0eb407c5b18cad15c073618a546fd1c..8a1eed875304439ae157eb2d00ba5a807a6e0856 100644 (file)
@@ -125,9 +125,6 @@ static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format
        int i; // channel
        int count = mlt_properties_get_int( filter_properties, "effect_count" );
 
-       // Restore the original get_audio
-       frame->get_audio = mlt_frame_pop_audio( frame );
-
        // Get the producer's audio
        mlt_frame_get_audio( frame, buffer, format, frequency, &channels_avail, samples );
 
@@ -337,12 +334,11 @@ static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format
 
 static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 {
-       if ( frame->get_audio != NULL )
+       if ( mlt_frame_is_test_audio( frame ) != 0 )
        {
                // Add the filter to the frame
-               mlt_frame_push_audio( frame, frame->get_audio );
                mlt_frame_push_audio( frame, this );
-               frame->get_audio = filter_get_audio;
+               mlt_frame_push_audio( frame, filter_get_audio );
                
                // Parse the window property and allocate smoothing buffer if needed
                mlt_properties properties = MLT_FILTER_PROPERTIES( this );
index 76671a2730d4334c3dc1ca65da5f0c4edaba0c40..951d95f249a1131723fb6fab1377c48af2052542 100644 (file)
@@ -171,7 +171,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        mlt_position position = mlt_properties_get_position( frame_properties, "vorbis_position" );
 
        // Get the producer 
-       mlt_producer this = mlt_properties_get_data( frame_properties, "vorbis_producer", NULL );
+       mlt_producer this = mlt_frame_pop_audio( frame );
 
        // Get the producer properties
        mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
@@ -278,7 +278,6 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
                }
                else
                {
-                       frame->get_audio = NULL;
                        mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples );
                        audio_used = 0;
                }
@@ -289,7 +288,6 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        else
        {
                // Get silence and don't touch the context
-               frame->get_audio = NULL;
                *samples = mlt_sample_calculator( fps, *frequency, position );
                mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples );
        }
@@ -300,21 +298,6 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        return 0;
 }
 
-/** Set up audio handling.
-*/
-
-static void producer_set_up_audio( mlt_producer this, mlt_frame frame )
-{
-       // Get the properties
-       mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
-
-       // Set the audio method
-       frame->get_audio = producer_get_audio;
-
-       // Set the producer on the frame
-       mlt_properties_set_data( properties, "vorbis_producer", this, 0, NULL, NULL );
-}
-
 /** Our get frame implementation.
 */
 
@@ -330,7 +313,8 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
        mlt_properties_set_position( MLT_FRAME_PROPERTIES( *frame ), "vorbis_position", mlt_producer_position( this ) );
 
        // Set up the audio
-       producer_set_up_audio( this, *frame );
+       mlt_frame_push_audio( *frame, this );
+       mlt_frame_push_audio( *frame, producer_get_audio );
 
        // Calculate the next timecode
        mlt_producer_prepare_next( this );