eglglessink: Move VBO setup to setcaps

This commit is contained in:
Reynaldo H. Verdejo Pinochet 2012-09-20 22:41:10 -03:00 committed by Sebastian Dröge
parent d56d126031
commit 1c008e95b3

View file

@ -1560,22 +1560,7 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
if (got_gl_error ("glTexImage2D"))
goto HANDLE_ERROR;
/* XXX: VBO stuff this actually makes more sense on the setcaps stub?
* The way it is right now makes this happen only for the first buffer
* though so I guess it should work */
if (gst_eglglessink_setup_vbo (eglglessink, FALSE)) {
/* This makes the rendered fram to fill the whole
* surface area.
glViewport (0, 0, eglglessink->surface_width,
eglglessink->surface_height);
*/
glViewport (0, 0, w, h);
} else {
GST_ERROR_OBJECT (eglglessink, "VBO setup failed");
goto HANDLE_ERROR;
}
glViewport (0, 0, w, h);
/* Don't really need to clear surface color
* glClearColor (0.0, 0.0, 0.0, 0.0);
* glClear (GL_COLOR_BUFFER_BIT);
@ -1731,6 +1716,13 @@ gst_eglglessink_setcaps (GstBaseSink * bsink, GstCaps * caps)
}
}
if (!eglglessink->have_vbo) {
if (!gst_eglglessink_setup_vbo (eglglessink, FALSE)) {
GST_ERROR_OBJECT (eglglessink, "VBO setup failed");
goto HANDLE_ERROR;
}
}
SUCCEED:
GST_INFO_OBJECT (eglglessink, "Setcaps succeed");
return TRUE;