mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 08:11:16 +00:00
kmssink: Save last metadata at the same time as the last buffer
The render width/height and the vinfo was only saved upon renegotiation. This fixes the problem by saving this metadata at the same time the buffer is saved. The saved copy of this is needed for expose() and drain() virtual functions. This fixes various assertion that happens on drain query.
This commit is contained in:
parent
1fb57155ff
commit
63940feaaf
1 changed files with 6 additions and 5 deletions
|
@ -1123,10 +1123,6 @@ gst_kms_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
|
|||
|
||||
if (!gst_video_info_from_caps (&vinfo, caps))
|
||||
goto invalid_format;
|
||||
|
||||
self->last_width = GST_VIDEO_SINK_WIDTH (self);
|
||||
self->last_height = GST_VIDEO_SINK_HEIGHT (self);
|
||||
self->last_vinfo = self->vinfo;
|
||||
self->vinfo = vinfo;
|
||||
|
||||
if (!gst_kms_sink_calculate_display_ratio (self, &vinfo,
|
||||
|
@ -1676,8 +1672,13 @@ sync_frame:
|
|||
goto bail;
|
||||
}
|
||||
|
||||
if (buffer != self->last_buffer)
|
||||
/* Save the rendered buffer and its metadata in case a redraw is needed */
|
||||
if (buffer != self->last_buffer) {
|
||||
gst_buffer_replace (&self->last_buffer, buffer);
|
||||
self->last_width = GST_VIDEO_SINK_WIDTH (self);
|
||||
self->last_height = GST_VIDEO_SINK_HEIGHT (self);
|
||||
self->last_vinfo = self->vinfo;
|
||||
}
|
||||
g_clear_pointer (&self->tmp_kmsmem, gst_memory_unref);
|
||||
|
||||
GST_OBJECT_UNLOCK (self);
|
||||
|
|
Loading…
Reference in a new issue