X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2Fsrc%2FMltFrame.cpp;h=5d974ce0f32341c5b22198844dfc9e091cedcec5;hb=47fb1506a99bae1c9cb90f313176f9dab58d5854;hp=59af2574990dd72ec6d02c7e11fc283e622a734f;hpb=8283ca2eb4e3b523e04a46578a19a985d3b2af3c;p=melted diff --git a/mlt++/src/MltFrame.cpp b/mlt++/src/MltFrame.cpp index 59af257..5d974ce 100644 --- a/mlt++/src/MltFrame.cpp +++ b/mlt++/src/MltFrame.cpp @@ -19,11 +19,13 @@ */ #include "MltFrame.h" +#include "MltProducer.h" using namespace Mlt; Frame::Frame( mlt_frame frame ) : instance( frame ) { + inc_ref( ); } Frame::Frame( Frame &frame ) : @@ -50,8 +52,8 @@ mlt_properties Frame::get_properties( ) uint8_t *Frame::get_image( mlt_image_format &format, int &w, int &h, int writable ) { uint8_t *image = NULL; - if ( mlt_properties_get_int( get_properties( ), "consumer_aspect_ratio" ) == 0 ) - mlt_properties_set_int( get_properties( ), "consumer_aspect_ratio", 1 ); + if ( get_double( "consumer_aspect_ratio" ) == 0.0 ) + set( "consumer_aspect_ratio", 1.0 ); mlt_frame_get_image( get_frame( ), &image, &format, &w, &h, writable ); set( "format", format ); set( "writable", writable ); @@ -61,8 +63,8 @@ uint8_t *Frame::get_image( mlt_image_format &format, int &w, int &h, int writabl unsigned char *Frame::fetch_image( mlt_image_format f, int w, int h, int writable ) { uint8_t *image = NULL; - if ( mlt_properties_get_int( get_properties( ), "consumer_aspect_ratio" ) == 0 ) - mlt_properties_set_int( get_properties( ), "consumer_aspect_ratio", 1 ); + if ( get_double( "consumer_aspect_ratio" ) == 0.0 ) + set( "consumer_aspect_ratio", 1.0 ); mlt_frame_get_image( get_frame( ), &image, &f, &w, &h, writable ); set( "format", f ); set( "writable", writable ); @@ -76,4 +78,12 @@ int16_t *Frame::get_audio( mlt_audio_format &format, int &frequency, int &channe return audio; } +unsigned char *Frame::get_waveform( int w, int h ) +{ + return mlt_frame_get_waveform( get_frame( ), w, h ); +} +Producer *Frame::get_original_producer( ) +{ + return new Producer( mlt_frame_get_original_producer( get_frame( ) ) ); +}