mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
eglglessink: Reorder vertex value order to make a bit more sense
This commit is contained in:
parent
8018681187
commit
cb034b2ecd
1 changed files with 16 additions and 16 deletions
|
@ -266,7 +266,7 @@ static void gst_eglglessink_init_interfaces (GType type);
|
||||||
static void gst_eglglessink_expose (GstXOverlay * overlay);
|
static void gst_eglglessink_expose (GstXOverlay * overlay);
|
||||||
static void gst_eglglessink_set_window_handle (GstXOverlay * overlay,
|
static void gst_eglglessink_set_window_handle (GstXOverlay * overlay,
|
||||||
guintptr id);
|
guintptr id);
|
||||||
static void gst_eglglessink_set_render_rectangle (GstXOverlay *overlay, gint x,
|
static void gst_eglglessink_set_render_rectangle (GstXOverlay * overlay, gint x,
|
||||||
gint y, gint width, gint height);
|
gint y, gint width, gint height);
|
||||||
|
|
||||||
/* Custom Buffer funcs */
|
/* Custom Buffer funcs */
|
||||||
|
@ -1135,25 +1135,25 @@ gst_eglglessink_setup_vbo (GstEglGlesSink * eglglessink, gboolean reset)
|
||||||
|
|
||||||
if (!eglglessink->have_vbo || reset) {
|
if (!eglglessink->have_vbo || reset) {
|
||||||
GST_DEBUG_OBJECT (eglglessink, "Performing VBO setup");
|
GST_DEBUG_OBJECT (eglglessink, "Performing VBO setup");
|
||||||
eglglessink->coordarray[0].x = -1;
|
eglglessink->coordarray[0].x = 1;
|
||||||
eglglessink->coordarray[0].y = 1;
|
eglglessink->coordarray[0].y = 1;
|
||||||
eglglessink->coordarray[0].z = 0;
|
eglglessink->coordarray[0].z = 0;
|
||||||
|
|
||||||
eglglessink->coordarray[1].x = 1;
|
eglglessink->coordarray[1].x = 1;
|
||||||
eglglessink->coordarray[1].y = 1;
|
eglglessink->coordarray[1].y = -1;
|
||||||
eglglessink->coordarray[1].z = 0;
|
eglglessink->coordarray[1].z = 0;
|
||||||
|
|
||||||
eglglessink->coordarray[2].x = 1;
|
eglglessink->coordarray[2].x = -1;
|
||||||
eglglessink->coordarray[2].y = -1;
|
eglglessink->coordarray[2].y = 1;
|
||||||
eglglessink->coordarray[2].z = 0;
|
eglglessink->coordarray[2].z = 0;
|
||||||
|
|
||||||
eglglessink->coordarray[3].x = -1;
|
eglglessink->coordarray[3].x = -1;
|
||||||
eglglessink->coordarray[3].y = -1;
|
eglglessink->coordarray[3].y = -1;
|
||||||
eglglessink->coordarray[3].z = 0;
|
eglglessink->coordarray[3].z = 0;
|
||||||
|
|
||||||
eglglessink->indexarray[0] = 1;
|
eglglessink->indexarray[0] = 0;
|
||||||
eglglessink->indexarray[1] = 2;
|
eglglessink->indexarray[1] = 1;
|
||||||
eglglessink->indexarray[2] = 0;
|
eglglessink->indexarray[2] = 2;
|
||||||
eglglessink->indexarray[3] = 3;
|
eglglessink->indexarray[3] = 3;
|
||||||
|
|
||||||
glGenBuffers (1, &eglglessink->vdata);
|
glGenBuffers (1, &eglglessink->vdata);
|
||||||
|
@ -1487,7 +1487,7 @@ HANDLE_ERROR:
|
||||||
|
|
||||||
/* Drafted */
|
/* Drafted */
|
||||||
static void
|
static void
|
||||||
gst_eglglessink_set_render_rectangle (GstXOverlay *overlay, gint x, gint y,
|
gst_eglglessink_set_render_rectangle (GstXOverlay * overlay, gint x, gint y,
|
||||||
gint width, gint height)
|
gint width, gint height)
|
||||||
{
|
{
|
||||||
GstEglGlesSink *eglglessink = GST_EGLGLESSINK (overlay);
|
GstEglGlesSink *eglglessink = GST_EGLGLESSINK (overlay);
|
||||||
|
@ -1497,9 +1497,9 @@ gst_eglglessink_set_render_rectangle (GstXOverlay *overlay, gint x, gint y,
|
||||||
g_mutex_lock (eglglessink->flow_lock);
|
g_mutex_lock (eglglessink->flow_lock);
|
||||||
|
|
||||||
if (width == -1 && height == -1) {
|
if (width == -1 && height == -1) {
|
||||||
/* This is the set_defaults condition according to
|
/* This is the set_defaults condition according to
|
||||||
* the xOverlay interface docs
|
* the xOverlay interface docs
|
||||||
*/
|
*/
|
||||||
eglglessink->display_region.w = 0;
|
eglglessink->display_region.w = 0;
|
||||||
eglglessink->display_region.h = 0;
|
eglglessink->display_region.h = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1600,8 +1600,7 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
|
||||||
* a sane default. According to the docs on the xOverlay
|
* a sane default. According to the docs on the xOverlay
|
||||||
* interface we are supposed to fill the overlay 100%
|
* interface we are supposed to fill the overlay 100%
|
||||||
*/
|
*/
|
||||||
if (!eglglessink->display_region.w || !eglglessink->display_region.h)
|
if (!eglglessink->display_region.w || !eglglessink->display_region.h) {
|
||||||
{
|
|
||||||
/* XXX: Do we really want to lock here? */
|
/* XXX: Do we really want to lock here? */
|
||||||
if (!eglglessink->keep_aspect_ratio) {
|
if (!eglglessink->keep_aspect_ratio) {
|
||||||
eglglessink->display_region.x = 0;
|
eglglessink->display_region.x = 0;
|
||||||
|
@ -1618,8 +1617,9 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
|
||||||
&eglglessink->display_region, TRUE);
|
&eglglessink->display_region, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
glViewport (eglglessink->display_region.x, eglglessink->display_region.y,
|
glViewport (eglglessink->display_region.x,
|
||||||
eglglessink->display_region.w, eglglessink->display_region.h);
|
eglglessink->display_region.y, eglglessink->display_region.w,
|
||||||
|
eglglessink->display_region.h);
|
||||||
}
|
}
|
||||||
|
|
||||||
glDrawElements (GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_SHORT, 0);
|
glDrawElements (GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_SHORT, 0);
|
||||||
|
|
Loading…
Reference in a new issue