summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2013-07-15 17:20:00 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-07-15 17:20:00 +0200
commit4d69d7369729d2986c0d45b2f7010930a615f03e (patch)
tree2ebdd6623c4f572b32d9afa364668498c2bb6e64
parent7652f823d4bd35032d2a02442e20638897747e9c (diff)
gldownload: Reset the viewport after download RGB via GLES2
-rw-r--r--gst-libs/gst/gl/gstgldownload.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gst-libs/gst/gl/gstgldownload.c b/gst-libs/gst/gl/gstgldownload.c
index 16dc420..513ac52 100644
--- a/gst-libs/gst/gl/gstgldownload.c
+++ b/gst-libs/gst/gl/gstgldownload.c
@@ -1129,6 +1129,8 @@ _do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download)
GstVideoFormat v_format;
guint out_width, out_height;
+ GLint viewport_dim[4];
+
const GLfloat vVertices[] = { 1.0f, -1.0f, 0.0f,
1.0f, 0.0f,
-1.0f, -1.0f, 0.0f,
@@ -1149,6 +1151,8 @@ _do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download)
gst_gl_display_check_framebuffer_status (display);
gl->BindFramebuffer (GL_FRAMEBUFFER, download->fbo);
+ gl->GetIntegerv (GL_VIEWPORT, viewport_dim);
+
gl->Viewport (0, 0, out_width, out_height);
gl->ClearColor (0.0, 0.0, 0.0, 0.0);
@@ -1172,6 +1176,9 @@ _do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download)
gst_gl_display_clear_shader (display);
+ gl->Viewport (viewport_dim[0], viewport_dim[1], viewport_dim[2],
+ viewport_dim[3]);
+
v_format = GST_VIDEO_INFO_FORMAT (&download->info);
switch (v_format) {
@@ -1199,7 +1206,6 @@ _do_download_draw_rgb_gles2 (GstGLDisplay * display, GstGLDownload * download)
}
gst_gl_display_check_framebuffer_status (display);
-
gl->BindFramebuffer (GL_FRAMEBUFFER, 0);
}
#endif
@@ -1434,6 +1440,7 @@ _do_download_draw_yuv_gles2 (GstGLDisplay * display, GstGLDownload * download)
GST_TRACE ("doing YUV download of texture:%u (%ux%u) using fbo:%u",
download->in_texture, out_width, out_height, download->fbo);
+ gst_gl_display_check_framebuffer_status (display);
gl->BindFramebuffer (GL_FRAMEBUFFER, download->fbo);
gl->GetIntegerv (GL_VIEWPORT, viewport_dim);
@@ -1498,10 +1505,6 @@ _do_download_draw_yuv_gles2 (GstGLDisplay * display, GstGLDownload * download)
gl->Viewport (viewport_dim[0], viewport_dim[1], viewport_dim[2],
viewport_dim[3]);
- gst_gl_display_check_framebuffer_status (display);
-
- gl->BindFramebuffer (GL_FRAMEBUFFER, download->fbo);
-
switch (v_format) {
case GST_VIDEO_FORMAT_AYUV:
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
@@ -1558,7 +1561,6 @@ _do_download_draw_yuv_gles2 (GstGLDisplay * display, GstGLDownload * download)
}
gst_gl_display_check_framebuffer_status (display);
-
gl->BindFramebuffer (GL_FRAMEBUFFER, 0);
}
#endif