[579/906] download: fix YV12 format

same as I420 but plane 1+2 swapped
This commit is contained in:
Matthew Waters 2012-09-18 21:42:24 +10:00
parent 5aa048e53b
commit cfafeea297

View file

@ -1257,7 +1257,6 @@ _do_download_draw_yuv (GstGLDisplay * display, GstGLDownload * download)
#endif
break;
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
{
glReadPixels (0, 0, width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE,
download->data[0]);
@ -1279,6 +1278,28 @@ _do_download_draw_yuv (GstGLDisplay * display, GstGLDownload * download)
download->data[2]);
}
break;
case GST_VIDEO_FORMAT_YV12:
{
glReadPixels (0, 0, width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE,
download->data[0]);
#ifndef OPENGL_ES2
glReadBuffer (GL_COLOR_ATTACHMENT1_EXT);
#endif
glReadPixels (0, 0, GST_ROUND_UP_2 (width) / 2,
GST_ROUND_UP_2 (height) / 2, GL_LUMINANCE, GL_UNSIGNED_BYTE,
download->data[2]);
#ifndef OPENGL_ES2
glReadBuffer (GL_COLOR_ATTACHMENT2_EXT);
#endif
glReadPixels (0, 0, GST_ROUND_UP_2 (width) / 2,
GST_ROUND_UP_2 (height) / 2, GL_LUMINANCE, GL_UNSIGNED_BYTE,
download->data[1]);
}
break;
default:
break;
gst_gl_display_set_error (display,