[vlc-commits] Split internal format from format for opengl texture creation.
Laurent Aimar
git at videolan.org
Fri Jun 24 23:22:30 CEST 2011
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Jun 24 23:05:15 2011 +0200| [a4903675f0bc26a8b297693b2bb6671be558f8e8] | committer: Laurent Aimar
Split internal format from format for opengl texture creation.
No functionnal changes.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a4903675f0bc26a8b297693b2bb6671be558f8e8
---
modules/video_output/opengl.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 40e4fdc..dad4a5b 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -109,6 +109,7 @@ struct vout_display_opengl_t {
int tex_target;
int tex_format;
+ int tex_internal;
int tex_type;
int tex_width[PICTURE_PLANE_MAX];
@@ -205,6 +206,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
# endif
vgl->tex_target = GL_TEXTURE_2D;
vgl->tex_format = GL_RGB;
+ vgl->tex_internal = GL_RGB;
vgl->tex_type = GL_UNSIGNED_SHORT_5_6_5;
#elif defined(MACOS_OPENGL)
# if defined(WORDS_BIGENDIAN)
@@ -214,6 +216,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
# endif
vgl->tex_target = GL_TEXTURE_RECTANGLE_EXT;
vgl->tex_format = GL_YCBCR_422_APPLE;
+ vgl->tex_internal = GL_YCBCR_422_APPLE;
vgl->tex_type = GL_UNSIGNED_SHORT_8_8_APPLE;
#else
vgl->fmt.i_chroma = VLC_CODEC_RGB32;
@@ -228,6 +231,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
# endif
vgl->tex_target = GL_TEXTURE_2D;
vgl->tex_format = GL_RGBA;
+ vgl->tex_internal = GL_RGBA;
vgl->tex_type = GL_UNSIGNED_BYTE;
#endif
/* Use YUV if possible and needed */
@@ -242,6 +246,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
vgl->fmt = *fmt;
vgl->fmt.i_chroma = *list;
vgl->tex_format = GL_LUMINANCE;
+ vgl->tex_internal = GL_LUMINANCE;
vgl->tex_type = GL_UNSIGNED_BYTE;
break;
}
@@ -515,7 +520,7 @@ picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned
/* Call glTexImage2D only once, and use glTexSubImage2D later */
glTexImage2D(vgl->tex_target, 0,
- vgl->tex_format, vgl->tex_width[j], vgl->tex_height[j],
+ vgl->tex_internal, vgl->tex_width[j], vgl->tex_height[j],
0, vgl->tex_format, vgl->tex_type, NULL);
}
}
More information about the vlc-commits
mailing list