[Bug 700749] gstrtph264pay/depay: Add framerate and optional framesize SDP attribute to payloaded caps

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue May 21 01:08:14 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=700749
  GStreamer | gst-plugins-good | git

--- Comment #10 from Sebastian Rasmussen <sebras at hotmail.com> 2013-05-21 08:08:11 UTC ---
> gst_caps_set_simple()

I was looking for something like this last night, but had a hard time finding
it. Hence the over-complicated if-statements. I fix.

> +    /* canonicalise floating point string so we can handle framerate strings
> +     * in the form "24.930" or "24,930" irrespective of the current locale */
> The RFC allows both?!

No, the RFC allows only a decimal point. However the following commit fron
-good explains why the code looks this way.

commit fafd0b7bc35f60d077fc3bc1287454778619d7ca
Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date:   Wed Dec 29 14:40:05 2010 +0000

    rtpjpegdepay: fix framerate parsing for locales that use a comma as
floating point

    atof() converts strings according to the current locale, but the
    framerate string will likely always use a dot as floating point
    separator, so use g_ascii_strtod() instead (but also canonicalise
    the string before, so we can handle both formats as input).

> @@ +651,3 @@
> +    g_value_set_double (&src, g_ascii_strtod (s, NULL));
> +    g_value_init (&dest, GST_TYPE_FRACTION);
> +    g_value_transform (&src, &dest);
> 
> There's also gst_util_double_to_fraction(), no need for this GValue dance :)

I blame all of this on __tim as motivated above. ;)
But I'll fix it of course!

> ::: gst/rtp/gstrtph264pay.c
> @@ +567,3 @@
> +    gdouble framerate;
> +    gst_util_fraction_to_double (num, denom, &framerate);
> +    rate = g_strdup_printf("%f", framerate);
> 
> This is always in the format 1.234 with a . as delimiter, right?

Probably not no, due to the locale-issues mentioned by __tim in his commit
message. Maybe I ought to separate the integer part and the fractional part
manually and stick a period in between. That way I could actually remove
__tim's commit completely. How does that sound..?

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list