]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_frame.c
Fix underlinking python binding (3082761).
[mlt] / src / framework / mlt_frame.c
index 2053cc847c7bc6675ae8cb41caaf1bdaa22b1253..76afc2208c806fab12a65cf05014a65c46d333ba 100644 (file)
@@ -351,9 +351,6 @@ const char * mlt_image_format_name( mlt_image_format format )
                case mlt_image_yuv422:  return "yuv422";
                case mlt_image_yuv420p: return "yuv420p";
                case mlt_image_opengl:  return "opengl";
-               case mlt_image_rgb24_full:  return "rgb24_full";
-               case mlt_image_rgb24a_full: return "rgb24a_full";
-               case mlt_image_yuv422_709:  return "yuv422_709";
        }
        return "invalid";
 }
@@ -458,7 +455,6 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
                                *buffer = NULL;
                                break;
                        case mlt_image_rgb24:
-                       case mlt_image_rgb24_full:
                                size *= 3;
                                size += *width * 3;
                                *buffer = mlt_pool_alloc( size );
@@ -466,7 +462,6 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
                                        memset( *buffer, 255, size );
                                break;
                        case mlt_image_rgb24a:
-                       case mlt_image_rgb24a_full:
                        case mlt_image_opengl:
                                size *= 4;
                                size += *width * 4;
@@ -835,3 +830,25 @@ int64_t mlt_sample_calculator_to_now( float fps, int frequency, int64_t position
 
        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 );
+       }
+}