mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
[579/906] download: fix YV12 format
same as I420 but plane 1+2 swapped
This commit is contained in:
parent
75734e663c
commit
9306c201f8
1 changed files with 22 additions and 1 deletions
|
@ -1257,7 +1257,6 @@ _do_download_draw_yuv (GstGLDisplay * display, GstGLDownload * download)
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case GST_VIDEO_FORMAT_I420:
|
case GST_VIDEO_FORMAT_I420:
|
||||||
case GST_VIDEO_FORMAT_YV12:
|
|
||||||
{
|
{
|
||||||
glReadPixels (0, 0, width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
glReadPixels (0, 0, width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
||||||
download->data[0]);
|
download->data[0]);
|
||||||
|
@ -1279,6 +1278,28 @@ _do_download_draw_yuv (GstGLDisplay * display, GstGLDownload * download)
|
||||||
download->data[2]);
|
download->data[2]);
|
||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
gst_gl_display_set_error (display,
|
gst_gl_display_set_error (display,
|
||||||
|
|
Loading…
Reference in a new issue