#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;
}