gst-plugins-good: flvdemux: add width, height and framerate to caps when present on onMetaData

Sebastian Dröge sebastian.droege at collabora.co.uk
Tue Apr 12 02:41:07 PDT 2011


On Tue, 2011-04-12 at 02:08 -0700, Mark Nauwelaerts wrote:
> +
> +  if (G_LIKELY (demux->framerate)) {
> +    GValue fps_double = { 0, };
> +    GValue fps_fraction = { 0, };
> +    gint num = 0;
> +    gint den = 0;
> +
> +    g_value_init (&fps_double, G_TYPE_DOUBLE);
> +    g_value_init (&fps_fraction, GST_TYPE_FRACTION);
> +    g_value_set_double (&fps_double, demux->framerate);
> +    g_value_transform (&fps_double, &fps_fraction);
> +    num = gst_value_get_fraction_numerator (&fps_fraction);
> +    den = gst_value_get_fraction_denominator (&fps_fraction);

You could also use gst_util_double_to_fraction() instead of the verbose
transformations via GValue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110412/4b44fc0d/attachment.pgp>


More information about the gstreamer-devel mailing list