rtpbasepayload: always store input buffer meta before negotiation
authorMathieu Duponchelle <mathieu@centricular.com>
Wed, 27 Apr 2022 00:08:00 +0000 (02:08 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 27 Apr 2022 08:43:30 +0000 (08:43 +0000)
commita03db32bbe45059df5dbb130a2b52cc5514e09ed
tree79f067e4115ce06f9d2d22a78463f4d4d3285a54
parent4cd3830bc83b635c46146fb26cf71cde66408fa3
rtpbasepayload: always store input buffer meta before negotiation

The decision to store the input buffer depends on whether extensions
are to be added to the output buffer, I assume as an optimization.

This creates an issue for subclasses that call negotiate(), where
header_exts is actually populated, from their handle_buffer()
implementation: at chain time, no header extension has been negotiated
yet, which means that we don't add extensions to the first batch of
buffers that comes out.

Keep track of whether negotiate has been called (this is different
from the negotiated field) and always store the input buffer until
then. This fixes the issue while largely preserving the optimization.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2304>
subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtpbasepayload.c