rtpopus: Put MULTIOPUS in all caps
authorOlivier Crête <olivier.crete@collabora.com>
Tue, 3 Jan 2023 22:44:37 +0000 (17:44 -0500)
committerOlivier Crête <olivier.crete@ocrete.ca>
Thu, 12 Jan 2023 23:48:35 +0000 (18:48 -0500)
The RTP payload encoding-name are always in caps in GStreamer.
In SDP, they are not case-sensitive, but since caps are, we need to pick
a caps, and we picked upper-case along time ago.

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

subprojects/gst-plugins-good/docs/gst_plugins_cache.json
subprojects/gst-plugins-good/gst/rtp/gstrtpopusdepay.c
subprojects/gst-plugins-good/gst/rtp/gstrtpopuspay.c

index 3a91863..9baf233 100644 (file)
                 "long-name": "RTP Opus packet depayloader",
                 "pad-templates": {
                     "sink": {
-                        "caps": "application/x-rtp:\n          media: audio\n        payload: [ 96, 127 ]\n     clock-rate: 48000\n  encoding-name: { (string)OPUS, (string)X-GST-OPUS-DRAFT-SPITTKA-00, (string)multiopus }\n",
+                        "caps": "application/x-rtp:\n          media: audio\n        payload: [ 96, 127 ]\n     clock-rate: 48000\n  encoding-name: { (string)OPUS, (string)X-GST-OPUS-DRAFT-SPITTKA-00, (string)MULTIOPUS }\n",
                         "direction": "sink",
                         "presence": "always"
                     },
                         "presence": "always"
                     },
                     "src": {
-                        "caps": "application/x-rtp:\n          media: audio\n        payload: [ 96, 127 ]\n     clock-rate: 48000\n  encoding-name: { (string)OPUS, (string)X-GST-OPUS-DRAFT-SPITTKA-00, (string)multiopus }\n",
+                        "caps": "application/x-rtp:\n          media: audio\n        payload: [ 96, 127 ]\n     clock-rate: 48000\n  encoding-name: { (string)OPUS, (string)X-GST-OPUS-DRAFT-SPITTKA-00, (string)MULTIOPUS }\n",
                         "direction": "src",
                         "presence": "always"
                     }
index 3dc4fba..d20dd7d 100644 (file)
@@ -42,7 +42,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
         "media = (string) \"audio\", "
         "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ","
         "clock-rate = (int) 48000, "
-        "encoding-name = (string) { \"OPUS\", \"X-GST-OPUS-DRAFT-SPITTKA-00\", \"multiopus\" }")
+        "encoding-name = (string) { \"OPUS\", \"X-GST-OPUS-DRAFT-SPITTKA-00\", \"MULTIOPUS\" }")
     );
 
 static GstStaticPadTemplate gst_rtp_opus_depay_src_template =
@@ -105,7 +105,7 @@ gst_rtp_opus_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
 
   s = gst_caps_get_structure (caps, 0);
 
-  if (g_str_equal (gst_structure_get_string (s, "encoding-name"), "multiopus")) {
+  if (g_str_equal (gst_structure_get_string (s, "encoding-name"), "MULTIOPUS")) {
     gint channels;
     gint stream_count;
     gint coupled_count;
@@ -119,7 +119,7 @@ gst_rtp_opus_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
         !gst_structure_has_field_typed (s, "num_streams", G_TYPE_STRING) ||
         !gst_structure_has_field_typed (s, "coupled_streams", G_TYPE_STRING) ||
         !gst_structure_has_field_typed (s, "channel_mapping", G_TYPE_STRING)) {
-      GST_WARNING_OBJECT (depayload, "Encoding name 'multiopus' requires "
+      GST_WARNING_OBJECT (depayload, "Encoding name 'MULTIOPUS' requires "
           "encoding-params, num_streams, coupled_streams and channel_mapping "
           "as string fields in caps.");
       goto reject_caps;
index f08b0f5..e3b0d94 100644 (file)
@@ -28,7 +28,7 @@
  *
  * In addition to the RFC, which assumes only mono and stereo payload,
  * the element supports multichannel Opus audio streams using a non-standardized
- * SDP config and "multiopus" codec developed by Google for libwebrtc. When the
+ * SDP config and "MULTIOPUS" codec developed by Google for libwebrtc. When the
  * input data have more than 2 channels, rtpopuspay will add extra fields to
  * output caps that can be used to generate SDP in the syntax understood by
  * libwebrtc. For example in the case of 5.1 audio:
@@ -83,7 +83,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
         "media = (string) \"audio\", "
         "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", "
         "clock-rate = (int) 48000, "
-        "encoding-name = (string) { \"OPUS\", \"X-GST-OPUS-DRAFT-SPITTKA-00\", \"multiopus\" }")
+        "encoding-name = (string) { \"OPUS\", \"X-GST-OPUS-DRAFT-SPITTKA-00\", \"MULTIOPUS\" }")
     );
 
 static gboolean gst_rtp_opus_pay_setcaps (GstRTPBasePayload * payload,
@@ -255,7 +255,7 @@ gst_rtp_opus_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
 
       /* libwebrtc only supports "multiopus" when channels > 2. Mono and stereo
        * sound must always be payloaded according to RFC 7587. */
-      encoding_name = "multiopus";
+      encoding_name = "MULTIOPUS";
 
       if (gst_structure_get_int (s, "stream-count", &stream_count)) {
         char *num_streams = g_strdup_printf ("%d", stream_count);