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 );
mlt_frame_get_image( get_frame( ), &image, &format, &w, &h, writable );
+ set( "format", format );
+ set( "writable", writable );
+ return image;
+}
+
+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 );
+ mlt_frame_get_image( get_frame( ), &image, &f, &w, &h, writable );
+ set( "format", f );
+ set( "writable", writable );
return image;
}
virtual mlt_frame get_frame( );
mlt_properties get_properties( );
uint8_t *get_image( mlt_image_format &format, int &w, int &h, int writable = 0 );
+ unsigned char *fetch_image( mlt_image_format format, int w, int h, int writable = 0 );
int16_t *get_audio( mlt_audio_format &format, int &frequency, int &channels, int &samples );
};
}
return mlt_producer_service( get_producer( ) );
}
-int Producer::seek( mlt_position position )
+int Producer::seek( int position )
{
return mlt_producer_seek( get_producer( ), position );
}
-mlt_position Producer::position( )
+int Producer::position( )
{
return mlt_producer_position( get_producer( ) );
}
-mlt_position Producer::frame( )
+int Producer::frame( )
{
return mlt_producer_frame( get_producer( ) );
}
return mlt_producer_get_fps( get_producer( ) );
}
-int Producer::set_in_and_out( mlt_position in, mlt_position out )
+int Producer::set_in_and_out( int in, int out )
{
return mlt_producer_set_in_and_out( get_producer( ), in, out );
}
-mlt_position Producer::get_in( )
+int Producer::get_in( )
{
return mlt_producer_get_in( get_producer( ) );
}
-mlt_position Producer::get_out( )
+int Producer::get_out( )
{
return mlt_producer_get_out( get_producer( ) );
}
-mlt_position Producer::get_length( )
+int Producer::get_length( )
{
return mlt_producer_get_length( get_producer( ) );
}
-mlt_position Producer::get_playtime( )
+int Producer::get_playtime( )
{
return mlt_producer_get_playtime( get_producer( ) );
}
virtual ~Producer( );
virtual mlt_producer get_producer( );
mlt_service get_service( );
- int seek( mlt_position position );
- mlt_position position( );
- mlt_position frame( );
+ int seek( int position );
+ int position( );
+ int frame( );
int set_speed( double speed );
double get_speed( );
double get_fps( );
- int set_in_and_out( mlt_position in, mlt_position out );
- mlt_position get_in( );
- mlt_position get_out( );
- mlt_position get_length( );
- mlt_position get_playtime( );
+ int set_in_and_out( int in, int out );
+ int get_in( );
+ int get_out( );
+ int get_length( );
+ int get_playtime( );
};
}
Frame *Service::get_frame( int index )
{
mlt_frame frame = NULL;
- mlt_service_get_frame( get_service( ), &frame, index );
+ mlt_service_get_frame( get_connection( ), &frame, index );
return new Frame( frame );
}
*/
%module mltpp
+%include "carrays.i"
+%array_class(unsigned char, unsignedCharArray);
%{
#include <mlt++/Mlt.h>
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
# Import required modules
require 'mltpp'