From 4e1ff0164f5cf31086826cdd8ed72f372ba9decc Mon Sep 17 00:00:00 2001 From: Olivier Crete Date: Fri, 11 Jan 2008 17:21:30 +0000 Subject: [PATCH] gst/rtp/: Fix the clock rate to 90000 as required by the RFC. Original commit message from CVS: Patch by: Olivier Crete * gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_setcaps): * gst/rtp/gstrtptheorapay.c: Fix the clock rate to 90000 as required by the RFC. Fixes #508644. --- ChangeLog | 9 +++++++++ gst/rtp/gstrtptheoradepay.c | 18 ++++-------------- gst/rtp/gstrtptheorapay.c | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac95463..a86e666 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-01-11 Wim Taymans + + Patch by: Olivier Crete + + * gst/rtp/gstrtptheoradepay.c: (gst_rtp_theora_depay_setcaps): + * gst/rtp/gstrtptheorapay.c: + Fix the clock rate to 90000 as required by the RFC. + Fixes #508644. + 2008-01-11 Tim-Philipp Müller * tests/check/elements/icydemux.c: (GST_START_TEST), (icydemux_suite): diff --git a/gst/rtp/gstrtptheoradepay.c b/gst/rtp/gstrtptheoradepay.c index ab364b9..d3989dc 100644 --- a/gst/rtp/gstrtptheoradepay.c +++ b/gst/rtp/gstrtptheoradepay.c @@ -44,7 +44,7 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS ("application/x-rtp, " "media = (string) \"video\", " "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", " - "clock-rate = (int) [1, MAX ], " "encoding-name = (string) \"THEORA\"" + "clock-rate = (int) 90000, " "encoding-name = (string) \"THEORA\"" /* All required parameters * * "sampling = (string) { "YCbCr-4:2:0", "YCbCr-4:2:2", "YCbCr-4:4:4" } " @@ -329,16 +329,11 @@ gst_rtp_theora_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) GstCaps *srccaps; const gchar *delivery_method; const gchar *configuration; - gint clock_rate; rtptheoradepay = GST_RTP_THEORA_DEPAY (depayload); structure = gst_caps_get_structure (caps, 0); - /* get clockrate */ - if (!gst_structure_get_int (structure, "clock-rate", &clock_rate)) - goto no_rate; - /* see how the configuration parameters will be transmitted */ delivery_method = gst_structure_get_string (structure, "delivery-method"); if (delivery_method == NULL) @@ -362,14 +357,14 @@ gst_rtp_theora_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) if (!gst_rtp_theora_depay_parse_configuration (rtptheoradepay, configuration)) goto invalid_configuration; - /* caps seem good, configure element */ - depayload->clock_rate = clock_rate; - /* set caps on pad and on header */ srccaps = gst_caps_new_simple ("video/x-theora", NULL); gst_pad_set_caps (depayload->srcpad, srccaps); gst_caps_unref (srccaps); + /* Clock rate is always 90000 according to draft-barbato-avt-rtp-theora-01 */ + depayload->clock_rate = 90000; + return TRUE; /* ERRORS */ @@ -394,11 +389,6 @@ invalid_configuration: GST_ERROR_OBJECT (rtptheoradepay, "invalid configuration specified"); return FALSE; } -no_rate: - { - GST_ERROR_OBJECT (rtptheoradepay, "no clock-rate specified"); - return FALSE; - } } static gboolean diff --git a/gst/rtp/gstrtptheorapay.c b/gst/rtp/gstrtptheorapay.c index 9de2d16..a6c22d9 100644 --- a/gst/rtp/gstrtptheorapay.c +++ b/gst/rtp/gstrtptheorapay.c @@ -51,7 +51,7 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_CAPS ("application/x-rtp, " "media = (string) \"video\", " "payload = (int) " GST_RTP_PAYLOAD_DYNAMIC_STRING ", " - "clock-rate = (int) [1, MAX ], " "encoding-name = (string) \"THEORA\"" + "clock-rate = (int) 90000, " "encoding-name = (string) \"THEORA\"" /* All required parameters * * "sampling = (string) { "YCbCr-4:2:0", "YCbCr-4:2:2", "YCbCr-4:4:4" } " -- 2.7.4