From 9306c201f814ccb5675a72f50c0fb24870328559 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 18 Sep 2012 21:42:24 +1000 Subject: [PATCH] [579/906] download: fix YV12 format same as I420 but plane 1+2 swapped --- gst-libs/gst/gl/gstgldownload.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstgldownload.c b/gst-libs/gst/gl/gstgldownload.c index c485984..d193d0a 100644 --- a/gst-libs/gst/gl/gstgldownload.c +++ b/gst-libs/gst/gl/gstgldownload.c @@ -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, -- 2.7.4