X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_frame.c;h=c0d75d666de754491645dd47a829bf68fc6ca1c8;hb=0ef075de03b447797a8530585815c8c86aae5178;hp=6c367e9335e79778f38386855afc4524f90b3b22;hpb=efe08354d45db7bf5478ffa17c35330a3e0d415c;p=melted diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 6c367e9..c0d75d6 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -68,6 +68,7 @@ mlt_frame mlt_frame_init( ) // 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( ); } return this; @@ -161,6 +162,22 @@ mlt_frame mlt_frame_pop_frame( mlt_frame this ) return mlt_deque_pop_back( this->stack_frame ); } +/** Push a service. +*/ + +int mlt_frame_push_service( mlt_frame this, void *that ) +{ + return mlt_deque_push_back( this->stack_service, that ); +} + +/** Pop a service. +*/ + +void *mlt_frame_pop_service( mlt_frame this ) +{ + return mlt_deque_pop_back( this->stack_service ); +} + int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable ) { mlt_properties properties = mlt_frame_properties( this ); @@ -293,10 +310,14 @@ int mlt_frame_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *for void mlt_frame_close( mlt_frame this ) { - mlt_deque_close( this->stack_get_image ); - mlt_deque_close( this->stack_frame ); - mlt_properties_close( &this->parent ); - free( this ); + if ( this != NULL ) + { + mlt_deque_close( this->stack_get_image ); + mlt_deque_close( this->stack_frame ); + mlt_deque_close( this->stack_service ); + mlt_properties_close( &this->parent ); + free( this ); + } } /***** convenience functions *****/