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 871d532a1bfa5f53a12b7487c36ce109c2af0513..3f7fb25d056ab79bf6e6b9b4819c1e0c3ea5d403 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 be2a67eed5457ecc22ccc1003df04c93ee3b25dd..dcd6d8ef81878b055a8ffe9fb56c783dcf926918 100644 (file)
@@ -176,6 +176,7 @@ struct _GstRTPHeaderExtension
  *
  * Since: 1.20
  */
+
 struct _GstRTPHeaderExtensionClass
 {
   GstElementClass parent_class;