X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_frame.c;h=1f2f3d216bc4b83a9d48b89c75f0eb96c49b2ab6;hb=23571c330fd1644833dcb73661ac987eda177200;hp=544bea3ee5888405d33a9fd1ab6f06ad5b95e01f;hpb=6820dfa615e2f55eb4ef17327c2cd293605c3389;p=melted diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 544bea3..1f2f3d2 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -53,6 +53,7 @@ mlt_frame mlt_frame_init( ) mlt_properties_set_int( properties, "height", 576 ); mlt_properties_set_int( properties, "normalised_width", 720 ); mlt_properties_set_int( properties, "normalised_height", 576 ); + mlt_properties_set_double( properties, "aspect_ratio", 72.0/79.0 ); } else { @@ -60,16 +61,15 @@ mlt_frame mlt_frame_init( ) mlt_properties_set_int( properties, "height", 480 ); mlt_properties_set_int( properties, "normalised_width", 720 ); mlt_properties_set_int( properties, "normalised_height", 480 ); + mlt_properties_set_double( properties, "aspect_ratio", 128.0/117.0 ); } - mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); mlt_properties_set_data( properties, "audio", NULL, 0, NULL, NULL ); 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; @@ -136,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. @@ -144,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. @@ -152,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. @@ -160,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. @@ -168,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. @@ -176,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 ) @@ -204,7 +220,6 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for { mlt_properties test_properties = mlt_frame_properties( test_frame ); mlt_properties_set_double( test_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) ); - mlt_properties_set_double( test_properties, "consumer_scale", mlt_properties_get_double( properties, "consumer_scale" ) ); mlt_properties_set( test_properties, "rescale.interp", "nearest" ); mlt_frame_get_image( test_frame, buffer, format, width, height, writable ); mlt_properties_set_data( properties, "test_card_frame", test_frame, 0, ( mlt_destructor )mlt_frame_close, NULL ); @@ -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 ); } @@ -746,4 +760,3 @@ int mlt_sample_calculator( float fps, int frequency, int64_t position ) return samples; } -