]> git.sesse.net Git - mlt/commitdiff
RPN clean up for frames
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Wed, 10 Mar 2004 15:25:53 +0000 (15:25 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Wed, 10 Mar 2004 15:25:53 +0000 (15:25 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@199 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_frame.c
src/framework/mlt_frame.h
src/modules/core/transition_composite.c
src/modules/core/transition_luma.c
src/modules/core/transition_mix.c
src/modules/core/transition_region.c

index 39055606a99643a7f8397e137342f701a23105fd..1f2f3d216bc4b83a9d48b89c75f0eb96c49b2ab6 100644 (file)
@@ -68,9 +68,8 @@ mlt_frame mlt_frame_init( )
                mlt_properties_set_data( properties, "alpha", NULL, 0, NULL, NULL );
 
                // Construct stacks for frames and methods
-               this->stack_get_image = mlt_deque_init( );
-               this->stack_frame = mlt_deque_init( );
-               this->stack_service = mlt_deque_init( );
+               this->stack_image = mlt_deque_init( );
+               this->stack_audio = mlt_deque_init( );
        }
 
        return this;
@@ -137,7 +136,7 @@ int mlt_frame_set_position( mlt_frame this, mlt_position value )
 
 int mlt_frame_push_get_image( mlt_frame this, mlt_get_image get_image )
 {
-       return mlt_deque_push_back( this->stack_get_image, get_image );
+       return mlt_deque_push_back( this->stack_image, get_image );
 }
 
 /** Pop a get_image callback.
@@ -145,7 +144,7 @@ int mlt_frame_push_get_image( mlt_frame this, mlt_get_image get_image )
 
 mlt_get_image mlt_frame_pop_get_image( mlt_frame this )
 {
-       return mlt_deque_pop_back( this->stack_get_image );
+       return mlt_deque_pop_back( this->stack_image );
 }
 
 /** Push a frame.
@@ -153,7 +152,7 @@ mlt_get_image mlt_frame_pop_get_image( mlt_frame this )
 
 int mlt_frame_push_frame( mlt_frame this, mlt_frame that )
 {
-       return mlt_deque_push_back( this->stack_frame, that );
+       return mlt_deque_push_back( this->stack_image, that );
 }
 
 /** Pop a frame.
@@ -161,7 +160,7 @@ int mlt_frame_push_frame( mlt_frame this, mlt_frame that )
 
 mlt_frame mlt_frame_pop_frame( mlt_frame this )
 {
-       return mlt_deque_pop_back( this->stack_frame );
+       return mlt_deque_pop_back( this->stack_image );
 }
 
 /** Push a service.
@@ -169,7 +168,7 @@ mlt_frame mlt_frame_pop_frame( mlt_frame this )
 
 int mlt_frame_push_service( mlt_frame this, void *that )
 {
-       return mlt_deque_push_back( this->stack_service, that );
+       return mlt_deque_push_back( this->stack_image, that );
 }
 
 /** Pop a service.
@@ -177,7 +176,23 @@ int mlt_frame_push_service( mlt_frame this, void *that )
 
 void *mlt_frame_pop_service( mlt_frame this )
 {
-       return mlt_deque_pop_back( this->stack_service );
+       return mlt_deque_pop_back( this->stack_image );
+}
+
+/** Push an audio item on the stack.
+*/
+
+int mlt_frame_push_audio( mlt_frame this, void *that )
+{
+       return mlt_deque_push_back( this->stack_audio, that );
+}
+
+/** Pop an audio item from the stack
+*/
+
+void *mlt_frame_pop_audio( mlt_frame this )
+{
+       return mlt_deque_pop_back( this->stack_audio );
 }
 
 int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
@@ -313,9 +328,8 @@ void mlt_frame_close( mlt_frame this )
 {
        if ( this != NULL )
        {
-               mlt_deque_close( this->stack_get_image );
-               mlt_deque_close( this->stack_frame );
-               mlt_deque_close( this->stack_service );
+               mlt_deque_close( this->stack_image );
+               mlt_deque_close( this->stack_audio );
                mlt_properties_close( &this->parent );
                free( this );
        }
index 253429330939d7e3d558df748b130a412aa16183..f1cd0fede442dc05b49269d2568cf2c1d3b0d1ef 100644 (file)
@@ -50,9 +50,8 @@ struct mlt_frame_s
        uint8_t * ( *get_alpha_mask )( mlt_frame this );
        
        // Private properties
-       mlt_deque stack_get_image;
-       mlt_deque stack_frame;
-       mlt_deque stack_service;
+       mlt_deque stack_image;
+       mlt_deque stack_audio;
 };
 
 extern mlt_frame mlt_frame_init( );
@@ -74,6 +73,10 @@ extern int mlt_frame_push_frame( mlt_frame this, mlt_frame that );
 extern mlt_frame mlt_frame_pop_frame( mlt_frame this );
 extern int mlt_frame_push_service( mlt_frame this, void *that );
 extern void *mlt_frame_pop_service( mlt_frame this );
+
+extern int mlt_frame_push_audio( mlt_frame this, void *that );
+extern void *mlt_frame_pop_audio( mlt_frame this );
+
 extern void mlt_frame_close( mlt_frame this );
 
 /* convenience functions */
index 91192af147172796f1186934959d7bb5ae69127b..48f2d8aa64c902ba1b04f8d8cbd9fd3c118803bf 100644 (file)
@@ -1017,8 +1017,8 @@ static mlt_frame composite_process( mlt_transition this, mlt_frame a_frame, mlt_
        // 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 ) ) );
        mlt_frame_push_service( a_frame, this );
-       mlt_frame_push_get_image( a_frame, transition_get_image );
        mlt_frame_push_frame( a_frame, b_frame );
+       mlt_frame_push_get_image( a_frame, transition_get_image );
        return a_frame;
 }
 
index 9386b0b9c09f73644a35b2c2d058d1407896bf4b..6c7b6e828a9b561da4062b86be314a48aff3f936 100644 (file)
@@ -334,6 +334,9 @@ static void luma_read_rgb24( uint8_t *image, uint16_t **map, int width, int heig
 
 static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
 {
+       // Get the b frame from the stack
+       mlt_frame b_frame = mlt_frame_pop_frame( a_frame );
+
        // Get the transition object
        mlt_transition transition = mlt_frame_pop_service( a_frame );
 
@@ -343,9 +346,6 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
        // Get the properties of the a frame
        mlt_properties a_props = mlt_frame_properties( a_frame );
 
-       // Get the b frame from the stack
-       mlt_frame b_frame = mlt_frame_pop_frame( a_frame );
-
        // Get the properties of the b frame
        mlt_properties b_props = mlt_frame_properties( b_frame );
 
@@ -489,12 +489,12 @@ static mlt_frame transition_process( mlt_transition transition, mlt_frame a_fram
        // Push the transition on to the frame
        mlt_frame_push_service( a_frame, transition );
 
-       // Push the transition method
-       mlt_frame_push_get_image( a_frame, transition_get_image );
-       
        // Push the b_frame on to the stack
        mlt_frame_push_frame( a_frame, b_frame );
 
+       // Push the transition method
+       mlt_frame_push_get_image( a_frame, transition_get_image );
+       
        return a_frame;
 }
 
index e9763875d2ffc44bc563ccbedee9a7753b172628..d6f8b2a70bf44ec998c12e450eaad383cc6370c5 100644 (file)
@@ -34,7 +34,7 @@ static int transition_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_fo
        mlt_properties a_props = mlt_frame_properties( frame );
 
        // Get the b frame from the stack
-       mlt_frame b_frame = mlt_frame_pop_frame( frame );
+       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 );
@@ -56,9 +56,6 @@ static int transition_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_fo
 
        mlt_frame_mix_audio( frame, b_frame, mix_start, mix_end, buffer, format, frequency, channels, samples );
 
-       // Push the b_frame back on for get_image
-       mlt_frame_push_frame( frame, b_frame );
-
        return 0;
 }
 
@@ -116,7 +113,7 @@ static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt
        // Override the get_audio method
        a_frame->get_audio = transition_get_audio;
        
-       mlt_frame_push_frame( a_frame, b_frame );
+       mlt_frame_push_audio( a_frame, b_frame );
        
        return a_frame;
 }
index 4e2eb11e390499fbfee5d311a4fa0855f4c7d9f2..41fce2fd087a9951d38df4ed287763f290e11289 100644 (file)
@@ -118,12 +118,12 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
        // Error we will return
        int error = 0;
 
-       // Get the watermark transition object
-       mlt_transition this = mlt_frame_pop_service( frame );
-
        // We will get the 'b frame' from the frame stack
        mlt_frame b_frame = mlt_frame_pop_frame( frame );
 
+       // Get the watermark transition object
+       mlt_transition this = mlt_frame_pop_service( frame );
+
        // Get the properties of the transition
        mlt_properties properties = mlt_transition_properties( this );
 
@@ -322,12 +322,12 @@ static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt
        // Push the transition on to the frame
        mlt_frame_push_service( a_frame, this );
 
-       // Push the transition method
-       mlt_frame_push_get_image( a_frame, transition_get_image );
-
        // Push the b_frame on to the stack
        mlt_frame_push_frame( a_frame, b_frame );
 
+       // Push the transition method
+       mlt_frame_push_get_image( a_frame, transition_get_image );
+
        // Return the frame
        return a_frame;
 }