fix caps to avoid videoconvert bug in 1.8 which corrupts data

Previous way of creating caps left invalid colorimetry field 0:0:0:0,
which combined with a bug present in GStreamer 1.8 led to GRAY16_LE data
being corrupted when converted to GRAY16_BE (or vice versa). Current
method will properly initialize colorimetry field, avoiding this problem
in 1.8.
This commit is contained in:
Joshua M. Doe
2017-11-16 08:27:08 -05:00
parent f76390323f
commit e4a308a545
10 changed files with 55 additions and 51 deletions

View File

@@ -645,9 +645,7 @@ gst_saperasrc_start (GstBaseSrc * bsrc)
}
gst_video_info_init (&vinfo);
vinfo.width = src->sap_buffers->GetWidth ();
vinfo.height = src->sap_buffers->GetHeight ();
vinfo.finfo = gst_video_format_get_info (gst_format);
gst_video_info_set_format (&vinfo, gst_format, src->sap_buffers->GetWidth (), src->sap_buffers->GetHeight ());
src->caps = gst_video_info_to_caps (&vinfo);
src->width = vinfo.width;