X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2Fsrc%2FMltFrame.cpp;fp=mlt%2B%2B%2Fsrc%2FMltFrame.cpp;h=c12adf871a4d36433a0b53bd1727ebd89ff199dc;hb=01116637238e74419971afc26311c7a65b7b43aa;hp=af0302b3d226edb20bcab9f22d8e2db4df05f416;hpb=4bf33d8de1c1887c6386f8d151c479ae0631a9aa;p=melted diff --git a/mlt++/src/MltFrame.cpp b/mlt++/src/MltFrame.cpp index af0302b..c12adf8 100644 --- a/mlt++/src/MltFrame.cpp +++ b/mlt++/src/MltFrame.cpp @@ -21,46 +21,46 @@ #include "MltFrame.h" using namespace Mlt; -mlt_properties Frame::get_properties( ) +Frame::Frame( mlt_frame frame ) : + destroy( true ), + instance( frame ) { - return mlt_frame_properties( get_frame( ) ); } -uint8_t *Frame::get_image( mlt_image_format &format, int &w, int &h, int writable ) +Frame::Frame( Frame &frame ) : + destroy( false ), + instance( frame.get_frame( ) ) { - uint8_t *image = NULL; - mlt_frame_get_image( get_frame( ), &image, &format, &w, &h, writable ); - return image; } -int16_t *Frame::get_audio( mlt_audio_format &format, int &frequency, int &channels, int &samples ) +Frame::~Frame( ) { - int16_t *audio = NULL; - mlt_frame_get_audio( get_frame( ), &audio, &format, &frequency, &channels, &samples ); - return audio; + if ( destroy ) + mlt_frame_close( instance ); } -mlt_frame FrameInstance::get_frame( ) +mlt_frame Frame::get_frame( ) { return instance; } -FrameInstance::FrameInstance( mlt_frame frame ) : - destroy( true ), - instance( frame ) +mlt_properties Frame::get_properties( ) { + return mlt_frame_properties( get_frame( ) ); } -FrameInstance::FrameInstance( Frame &frame ) : - destroy( false ), - instance( frame.get_frame( ) ) +uint8_t *Frame::get_image( mlt_image_format &format, int &w, int &h, int writable ) { + uint8_t *image = NULL; + mlt_frame_get_image( get_frame( ), &image, &format, &w, &h, writable ); + return image; } -FrameInstance::~FrameInstance( ) +int16_t *Frame::get_audio( mlt_audio_format &format, int &frequency, int &channels, int &samples ) { - if ( destroy ) - mlt_frame_close( instance ); + int16_t *audio = NULL; + mlt_frame_get_audio( get_frame( ), &audio, &format, &frequency, &channels, &samples ); + return audio; }