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;
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.
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.
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.
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.
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.
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 )
{
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 );
}
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( );
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 */
// 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;
}
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 );
// 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 );
// 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;
}
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 );
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;
}
// 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;
}
// 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 );
// 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;
}