mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
[800/906] glimagesink: avoid to draw texture while releasing stored buffer
Spoted by generic/cube example with ClientDrawCallback set to returning TRUE (it means drawing as fast as possible)
This commit is contained in:
parent
940151bcd6
commit
2d876dfb70
1 changed files with 9 additions and 1 deletions
|
@ -487,10 +487,17 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
{
|
{
|
||||||
|
/* mark the redisplay_texture as unavailable (=0)
|
||||||
|
* to avoid drawing
|
||||||
|
*/
|
||||||
|
GST_GLIMAGE_SINK_LOCK (glimage_sink);
|
||||||
|
glimage_sink->redisplay_texture = 0;
|
||||||
if (glimage_sink->stored_buffer) {
|
if (glimage_sink->stored_buffer) {
|
||||||
gst_buffer_unref (glimage_sink->stored_buffer);
|
gst_buffer_unref (glimage_sink->stored_buffer);
|
||||||
glimage_sink->stored_buffer = NULL;
|
glimage_sink->stored_buffer = NULL;
|
||||||
}
|
}
|
||||||
|
GST_GLIMAGE_SINK_UNLOCK (glimage_sink);
|
||||||
|
|
||||||
if (glimage_sink->upload) {
|
if (glimage_sink->upload) {
|
||||||
gst_object_unref (glimage_sink->upload);
|
gst_object_unref (glimage_sink->upload);
|
||||||
glimage_sink->upload = NULL;
|
glimage_sink->upload = NULL;
|
||||||
|
@ -1008,7 +1015,8 @@ gst_glimage_sink_on_draw (const GstGLImageSink * gl_sink)
|
||||||
gl_sink->client_data);
|
gl_sink->client_data);
|
||||||
|
|
||||||
if (doRedisplay) {
|
if (doRedisplay) {
|
||||||
GstGLContext *context = gst_gl_display_get_context (gl_sink->display);
|
GstGLContext *context =
|
||||||
|
gst_gl_display_get_context_unlocked (gl_sink->display);
|
||||||
GstGLWindow *window = gst_gl_context_get_window (context);
|
GstGLWindow *window = gst_gl_context_get_window (context);
|
||||||
|
|
||||||
gst_gl_window_draw_unlocked (window,
|
gst_gl_window_draw_unlocked (window,
|
||||||
|
|
Loading…
Reference in a new issue