From: Matthew Waters Date: Tue, 18 Sep 2012 11:42:24 +0000 (+1000) Subject: [579/906] download: fix YV12 format X-Git-Tag: 1.19.3~511^2~1989^2~1925 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9306c201f814ccb5675a72f50c0fb24870328559;p=platform%2Fupstream%2Fgstreamer.git [579/906] download: fix YV12 format same as I420 but plane 1+2 swapped --- 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,