rtponviftimestamp: add extension data to all packets ..
authorMathieu Duponchelle <mathieu@centricular.com>
Tue, 26 Apr 2022 22:27:06 +0000 (00:27 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 27 Apr 2022 06:39:24 +0000 (06:39 +0000)
regardless of whether they are input as individual buffers or
buffer lists.

The ONVIF specification requires all packets to hold the extension,
it makes no sense to behave differently when handling buffer lists.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2303>

subprojects/gst-plugins-bad/gst/onvif/gstrtponviftimestamp.c

index f0d5533..5070666 100644 (file)
@@ -732,15 +732,18 @@ gst_rtp_onvif_timestamp_chain (GstPad * pad, GstObject * parent,
   return result;
 }
 
+static gboolean
+do_handle_buffer (GstBuffer ** buffer, guint idx, GstRtpOnvifTimestamp * self)
+{
+  return handle_buffer (self, *buffer);
+}
+
 /* @buf: (transfer full) */
 static GstFlowReturn
 handle_and_push_buffer_list (GstRtpOnvifTimestamp * self, GstBufferList * list)
 {
-  GstBuffer *buf;
-
-  /* Set the extension on the *first* buffer */
-  buf = gst_buffer_list_get (list, 0);
-  if (!handle_buffer (self, buf)) {
+  if (!gst_buffer_list_foreach (list, (GstBufferListFunc) do_handle_buffer,
+          self)) {
     gst_buffer_list_unref (list);
     return GST_FLOW_ERROR;
   }