+ rtpjpegdepay->media_width = 0;
+ rtpjpegdepay->media_height = 0;
+ rtpjpegdepay->frate_num = 0;
+ rtpjpegdepay->frate_denom = 1;
+
+ /* check for optional SDP attributes */
+ if ((media_attr = gst_structure_get_string (structure, "x-dimensions"))) {
+ gint w, h;
+
+ if (sscanf (media_attr, "%d,%d", &w, &h) == 2) {
+ rtpjpegdepay->media_width = w;
+ rtpjpegdepay->media_height = h;
+ }
+ }
+
+ /* try to get a framerate */
+ media_attr = gst_structure_get_string (structure, "a-framerate");
+ if (!media_attr)
+ media_attr = gst_structure_get_string (structure, "x-framerate");
+
+ if (media_attr) {
+ GValue src = { 0 };
+ GValue dest = { 0 };
+
+ /* convert the float to a fraction */
+ g_value_init (&src, G_TYPE_DOUBLE);
+ g_value_set_double (&src, atof (media_attr));
+ g_value_init (&dest, GST_TYPE_FRACTION);
+ g_value_transform (&src, &dest);
+
+ rtpjpegdepay->frate_num = gst_value_get_fraction_numerator (&dest);
+ rtpjpegdepay->frate_denom = gst_value_get_fraction_denominator (&dest);
+ }