av1parse: Only place a marker on the last frame of a TU

Markers are meant to indicate the buffer that ends a frame, which imply
something can be displayed. The dependent decode only frames should not
have markers. This should also fix last subframe detection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6895>
This commit is contained in:
Nicolas Dufresne 2024-05-21 17:22:47 -04:00 committed by GStreamer Marge Bot
parent 5fe7803128
commit 5b1bc0f19f

View file

@ -1117,20 +1117,25 @@ gst_av1_parse_push_data (GstAV1Parse * self, GstBaseParseFrame * frame,
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
}
if (frame_finished) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_MARKER);
} else {
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_MARKER);
}
if (self->align == GST_AV1_PARSE_ALIGN_FRAME) {
if (self->align == GST_AV1_PARSE_ALIGN_FRAME
|| self->align == GST_AV1_PARSE_ALIGN_OBU) {
if (!self->show_frame) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DECODE_ONLY);
} else {
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DECODE_ONLY);
if (frame_finished) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_MARKER);
} else {
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_MARKER);
}
}
} else {
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DECODE_ONLY);
if (frame_finished) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_MARKER);
} else {
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_MARKER);
}
}
gst_buffer_replace (&frame->out_buffer, buf);