GNOME Bugzilla – Bug 758717
bayer: pixel aspect ratio not forwarded when transforming caps
Last modified: 2016-10-31 14:33:19 UTC
Negotiation errors may arise when bayer elements are present in the pipeline, because they do not forward the pixel aspect ratio when transforming the caps: # Failure due to the combination of `bayer2rgb` and `videoscale`: gst-launch-1.0 -v \ videotestsrc \ ! "video/x-bayer,format=rggb,width=1280,height=960,framerate=15/2" \ ! bayer2rgb \ ! videoscale \ ! "video/x-raw,framerate=15/2,width=640,pixel-aspect-ratio=1/1" \ ! ximagesink
Created attachment 316337 [details] [review] bayer: Forward pixel aspect ratio when transforming caps in bayer elements
Created attachment 337609 [details] [review] proper fix of _transform_caps method The previous patch was a quick and dirty solution to the issue. This one contains the proper implementation of the _transform_caps method.
Review of attachment 337609 [details] [review]: Except for the set_name() part, it looks correct to me. ::: gst/bayer/gstbayer2rgb.c @@ +299,3 @@ + structure = gst_caps_get_structure (res_caps, i); + if (direction == GST_PAD_SINK) { + gst_structure_set_name (structure, "video/x-raw"); That one is not needed, since your caps template will ensure that already. @@ +302,3 @@ + gst_structure_remove_field (structure, "format"); + } else { + gst_structure_set_name (structure, "video/x-bayer"); And same. @@ +304,3 @@ + gst_structure_set_name (structure, "video/x-bayer"); + gst_structure_remove_fields (structure, "format", "colorimetry", + "chroma-site", NULL); Curiosity (not a review comment), do we just ignore these and do we actually handle it in the conversion already ?
Review of attachment 337609 [details] [review]: Arg, and I'm confused again, sorry. Obviously you need to change from raw to bayer (and vis-versa). I only write those for raw to raw conversion in general, so that's why it felt unfamiliar.
So is it ready to merge as it is? Or there is something missing?
I'm on it, just ran out of time yesterday, just need to merge, build and re-test. So if nothing happens, should be in before 1.10 ;-P