mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
glviewconvert: wait and set the gl sync meta on buffers
This may be a cause of out-of-place frames when transforming multiview buffers.
This commit is contained in:
parent
4d534ad8e8
commit
2c44c5fb40
1 changed files with 25 additions and 7 deletions
|
@ -37,14 +37,8 @@
|
||||||
|
|
||||||
#include <gst/video/gstvideoaffinetransformationmeta.h>
|
#include <gst/video/gstvideoaffinetransformationmeta.h>
|
||||||
|
|
||||||
#include "gstglcontext.h"
|
#include "gl.h"
|
||||||
#include "gstglframebuffer.h"
|
|
||||||
#include "gstglmemory.h"
|
|
||||||
#include "gstglshader.h"
|
|
||||||
#include "gstglshaderstrings.h"
|
|
||||||
#include "gstglsl.h"
|
|
||||||
#include "gstglsl_private.h"
|
#include "gstglsl_private.h"
|
||||||
#include "gstglslstage.h"
|
|
||||||
#include "gstglutils_private.h"
|
#include "gstglutils_private.h"
|
||||||
|
|
||||||
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
|
@ -2017,6 +2011,7 @@ _do_view_convert (GstGLContext * context, GstGLViewConvert * viewconvert)
|
||||||
gint in_views, out_views;
|
gint in_views, out_views;
|
||||||
GstVideoMultiviewMode in_mode;
|
GstVideoMultiviewMode in_mode;
|
||||||
GstVideoMultiviewMode out_mode;
|
GstVideoMultiviewMode out_mode;
|
||||||
|
GstGLSyncMeta *sync_meta;
|
||||||
|
|
||||||
out_width = GST_VIDEO_INFO_WIDTH (&viewconvert->out_info);
|
out_width = GST_VIDEO_INFO_WIDTH (&viewconvert->out_info);
|
||||||
out_height = GST_VIDEO_INFO_HEIGHT (&viewconvert->out_info);
|
out_height = GST_VIDEO_INFO_HEIGHT (&viewconvert->out_info);
|
||||||
|
@ -2149,6 +2144,18 @@ _do_view_convert (GstGLContext * context, GstGLViewConvert * viewconvert)
|
||||||
}
|
}
|
||||||
priv->n_out_tex = out_views;
|
priv->n_out_tex = out_views;
|
||||||
|
|
||||||
|
if (priv->primary_in) {
|
||||||
|
if ((sync_meta = gst_buffer_get_gl_sync_meta (priv->primary_in))) {
|
||||||
|
gst_gl_sync_meta_wait (sync_meta, context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->auxilliary_in) {
|
||||||
|
if ((sync_meta = gst_buffer_get_gl_sync_meta (priv->auxilliary_in))) {
|
||||||
|
gst_gl_sync_meta_wait (sync_meta, context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (viewconvert, "multiview splitting to textures:%p,%p,%p,%p "
|
GST_LOG_OBJECT (viewconvert, "multiview splitting to textures:%p,%p,%p,%p "
|
||||||
"dimensions:%ux%u, from textures:%p,%p,%p,%p dimensions:%ux%u",
|
"dimensions:%ux%u, from textures:%p,%p,%p,%p dimensions:%ux%u",
|
||||||
priv->out_tex[0], priv->out_tex[1],
|
priv->out_tex[0], priv->out_tex[1],
|
||||||
|
@ -2200,6 +2207,17 @@ out:
|
||||||
gst_buffer_replace (&priv->auxilliary_out, NULL);
|
gst_buffer_replace (&priv->auxilliary_out, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (priv->primary_out) {
|
||||||
|
if ((sync_meta = gst_buffer_add_gl_sync_meta (context, priv->primary_out)))
|
||||||
|
gst_gl_sync_meta_set_sync_point (sync_meta, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->auxilliary_out) {
|
||||||
|
if ((sync_meta =
|
||||||
|
gst_buffer_add_gl_sync_meta (context, priv->auxilliary_out)))
|
||||||
|
gst_gl_sync_meta_set_sync_point (sync_meta, context);
|
||||||
|
}
|
||||||
|
|
||||||
priv->result = res;
|
priv->result = res;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue