return samples;
}
+
+void mlt_frame_write_ppm( mlt_frame frame )
+{
+ int width;
+ int height;
+ mlt_image_format format = mlt_image_rgb24;
+ uint8_t *image;
+
+ if ( mlt_frame_get_image( frame, &image, &format, &width, &height, 0 ) == 0 )
+ {
+ FILE *file;
+ char filename[16];
+
+ sprintf( filename, "frame-%05d.ppm", mlt_frame_get_position( frame ) );
+ file = fopen( filename, "wb" );
+ if ( !file )
+ return;
+ fprintf( file, "P6\n%d %d\n255\n", width, height);
+ fwrite( image, width * height * 3, 1, file );
+ fclose( file );
+ }
+}
extern int64_t mlt_sample_calculator_to_now( float fps, int frequency, int64_t position );
extern const char * mlt_image_format_name( mlt_image_format format );
extern const char * mlt_audio_format_name( mlt_audio_format format );
+extern void mlt_frame_write_ppm( mlt_frame frame );
/** This macro scales RGB into the YUV gamut - y is scaled by 219/255 and uv by 224/255. */
#define RGB2YUV_601_SCALED(r, g, b, y, u, v)\