+
+ /* take first possibility */
+ caps = gst_caps_make_writable (caps);
+ gst_caps_truncate (caps);
+ structure = gst_caps_get_structure (caps, 0);
+
+ /* and fixate */
+ gst_structure_fixate_field_nearest_fraction (structure, "framerate",
+ rate_numerator, rate_denominator);
+ gst_structure_get_fraction (structure, "framerate",
+ &rate_numerator, &rate_denominator);
+
+ videorate->to_rate_numerator = rate_numerator;
+ videorate->to_rate_denominator = rate_denominator;
+
+ if (gst_structure_has_field (structure, "interlaced"))
+ gst_structure_fixate_field_boolean (structure, "interlaced", FALSE);
+ if (gst_structure_has_field (structure, "color-matrix"))
+ gst_structure_fixate_field_string (structure, "color-matrix", "sdtv");
+ if (gst_structure_has_field (structure, "chroma-site"))
+ gst_structure_fixate_field_string (structure, "chroma-site", "mpeg2");
+ if (gst_structure_has_field (structure, "pixel-aspect-ratio"))
+ gst_structure_fixate_field_nearest_fraction (structure,
+ "pixel-aspect-ratio", 1, 1);
+
+ ret = gst_video_rate_set_src_caps (videorate, caps);
+ gst_caps_unref (caps);