rtphdrext: Give "inherited" direction in set_attributes
authorOlivier CrĂȘte <olivier.crete@collabora.com>
Mon, 27 Sep 2021 20:11:33 +0000 (16:11 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 28 Sep 2021 20:04:55 +0000 (20:04 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/906>

subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.c
subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtphdrext.h

index 871d532..3f7fb25 100644 (file)
@@ -511,6 +511,13 @@ gst_rtp_header_extension_set_attributes_from_caps (GstRTPHeaderExtension * ext,
     goto done;
   }
 
+  /* If the caps don't include directions, use the ones that were
+   * previously set by the application.
+   */
+  if (direction == GST_RTP_HEADER_EXTENSION_DIRECTION_DEFAULT &&
+      priv->direction & GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED)
+    direction = priv->direction;
+
   if (klass->set_attributes)
     ret = klass->set_attributes (ext, direction, attributes);
   else
index be2a67e..dcd6d8e 100644 (file)
@@ -176,6 +176,7 @@ struct _GstRTPHeaderExtension
  *
  * Since: 1.20
  */
+
 struct _GstRTPHeaderExtensionClass
 {
   GstElementClass parent_class;