]> git.sesse.net Git - mlt/commitdiff
Add mlt_image_glsl and _glsl_texture (opengl branch).
authorDan Dennedy <dan@dennedy.org>
Thu, 21 Feb 2013 04:21:23 +0000 (20:21 -0800)
committerDan Dennedy <dan@dennedy.org>
Thu, 21 Feb 2013 04:21:23 +0000 (20:21 -0800)
src/framework/mlt_frame.c
src/framework/mlt_types.h

index 5787aed8d29a5ebb9fe1d459263cbdaa87a91333..15243af1419665110b88aff0bb1441bf57c162d6 100644 (file)
@@ -403,6 +403,8 @@ 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_glsl:    return "glsl";
+               case mlt_image_glsl_texture: return "glsl_texture";
        }
        return "invalid";
 }
@@ -421,9 +423,6 @@ int mlt_image_format_size( mlt_image_format format, int width, int height, int *
        height += 1;
        switch ( format )
        {
-               case mlt_image_none:
-                       if ( bpp ) *bpp = 0;
-                       return 0;
                case mlt_image_rgb24:
                        if ( bpp ) *bpp = 3;
                        return width * height * 3;
@@ -437,6 +436,9 @@ int mlt_image_format_size( mlt_image_format format, int width, int height, int *
                case mlt_image_yuv420p:
                        if ( bpp ) *bpp = 3 / 2;
                        return width * height * 3 / 2;
+               default:
+                       if ( bpp ) *bpp = 0;
+                       return 0;
        }
        return 0;
 }
@@ -538,10 +540,6 @@ int mlt_frame_get_image( mlt_frame self, uint8_t **buffer, mlt_image_format *for
 
                switch( *format )
                {
-                       case mlt_image_none:
-                               size = 0;
-                               *buffer = NULL;
-                               break;
                        case mlt_image_rgb24:
                                size *= 3;
                                size += *width * 3;
@@ -575,6 +573,10 @@ int mlt_frame_get_image( mlt_frame self, uint8_t **buffer, mlt_image_format *for
                                if ( *buffer )
                                        memset( *buffer, 255, size );
                                break;
+                       default:
+                               size = 0;
+                               *buffer = NULL;
+                               break;
                }
 
                mlt_properties_set_data( properties, "image", *buffer, size, ( mlt_destructor )mlt_pool_release, NULL );
index 62442368ec55f7224e7b452702bda1c8587d9913..c1574d4471481d80ceca65fcb4223167d4886cf5 100644 (file)
@@ -44,7 +44,9 @@ typedef enum
        mlt_image_rgb24a,  /**< 8-bit RGB with alpha channel */
        mlt_image_yuv422,  /**< 8-bit YUV 4:2:2 packed */
        mlt_image_yuv420p, /**< 8-bit YUV 4:2:0 planar */
-       mlt_image_opengl  /**< (deprecated) suitable for OpenGL texture */
+       mlt_image_opengl,  /**< (deprecated) suitable for OpenGL texture */
+       mlt_image_glsl,    /**< for opengl module internal use only */
+       mlt_image_glsl_texture /**< an OpenGL texture name */
 }
 mlt_image_format;