videotestsrc: Always set pixel-aspect-ratio and interlace-mode in the fixed caps

Otherwise our caps will not be compatible with elements that require a
1/1 pixel-aspect-ratio or progressive video.

https://bugzilla.gnome.org/show_bug.cgi?id=721103
This commit is contained in:
Sebastian Dröge 2013-12-30 19:48:29 +01:00
parent eff2119e6a
commit eff7866dd0

View file

@ -320,9 +320,14 @@ gst_video_test_src_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
gst_structure_fixate_field_nearest_int (structure, "width", 320);
gst_structure_fixate_field_nearest_int (structure, "height", 240);
gst_structure_fixate_field_nearest_fraction (structure, "framerate", 30, 1);
if (gst_structure_has_field (structure, "pixel-aspect-ratio"))
gst_structure_fixate_field_nearest_fraction (structure,
"pixel-aspect-ratio", 1, 1);
else
gst_structure_set (structure, "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
NULL);
if (gst_structure_has_field (structure, "colorimetry"))
gst_structure_fixate_field_string (structure, "colorimetry", "bt601");
if (gst_structure_has_field (structure, "chroma-site"))
@ -331,6 +336,9 @@ gst_video_test_src_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
if (gst_structure_has_field (structure, "interlace-mode"))
gst_structure_fixate_field_string (structure, "interlace-mode",
"progressive");
else
gst_structure_set (structure, "interlace-mode", G_TYPE_STRING,
"progressive", NULL);
caps = GST_BASE_SRC_CLASS (parent_class)->fixate (bsrc, caps);