summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-02-05 10:27:51 +0000
committerTim-Philipp Müller <tim@centricular.com>2016-02-17 14:58:01 +0000
commite427369840e30477e6791543795264f884569ad6 (patch)
treeffb5ed01f5a2244c66e4affbd07c3f87d9d38dd4
parent9e4511edf4b20736ecafc137a6eaa11ddb638826 (diff)
downloadgstreamer-plugins-good-e427369840e30477e6791543795264f884569ad6.tar.gz
rtpopuspay: negotiate the encoding name
Chrome uses a different encoding name that gstreamer. https://bugzilla.gnome.org/show_bug.cgi?id=737810
-rw-r--r--gst/rtp/gstrtpopuspay.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gst/rtp/gstrtpopuspay.c b/gst/rtp/gstrtpopuspay.c
index 8cfd79def..7cd90eff6 100644
--- a/gst/rtp/gstrtpopuspay.c
+++ b/gst/rtp/gstrtpopuspay.c
@@ -94,9 +94,26 @@ static gboolean
gst_rtp_opus_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
{
gboolean res;
+ GstCaps *src_caps;
+ GstStructure *s;
+ char *encoding_name;
+
+ src_caps = gst_pad_get_allowed_caps (GST_RTP_BASE_PAYLOAD_SRCPAD (payload));
+ if (src_caps) {
+ src_caps = gst_caps_truncate (src_caps);
+ src_caps = gst_caps_make_writable (src_caps);
+ s = gst_caps_get_structure (src_caps, 0);
+ gst_structure_fixate_field_string (s, "encoding-name",
+ "X-GST-OPUS-DRAFT-SPITTKA-00");
+ encoding_name = g_strdup (gst_structure_get_string (s, "encoding-name"));
+ gst_caps_unref (src_caps);
+ } else {
+ encoding_name = g_strdup ("X-GST-OPUS-DRAFT-SPITTKA-00");
+ }
gst_rtp_base_payload_set_options (payload, "audio", FALSE,
- "X-GST-OPUS-DRAFT-SPITTKA-00", 48000);
+ encoding_name, 48000);
+ g_free (encoding_name);
res = gst_rtp_base_payload_set_outcaps (payload, NULL);
return res;