GNOME Bugzilla – Bug 667681
gst_video_format_new_caps should generate caps with host endianness for 16-bit rgb formats
Last modified: 2012-01-30 16:04:56 UTC
Created attachment 205011 [details] [review] Patch that fixes the bug Unlike all the other formats in the GstVideoFormat enum, the 16-bit rgb formats (RGB16, BGR16, RGB15, BGR15) use the host's endianness in the GST_VIDEO_CAPS_RGB_16 and related macros and also gst_video_format_parse_caps expects these caps to have the host's endianness on them. However, the gst_video_format_new_caps method generates caps with endianness = G_BIG_ENDIAN always, which gives a mismatch and the generated caps neither match the static caps in video.h nor are parsed by gst_video_format_parse_caps. Here is a patch that fixes this problem, together with additions in the libs/video unit test to ensure that this is correct.
Created attachment 205012 [details] [review] unit test additions
Seems to make sense, thanks. commit 6f6f079dd93e113ad8f2e41ef56d462acbf3fea1 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Tue Jan 10 21:17:58 2012 +0200 tests: test 16-bit rgb formats in test_parse_caps_rgb https://bugzilla.gnome.org/show_bug.cgi?id=667681 commit 1251fb3fc0bd60eb4a38f47403e06c293c51fb16 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Tue Jan 10 21:02:48 2012 +0200 video: Use host endianness when generating caps for 16-bit rgb formats This is necessary in order to match what the caps strings in video.h contain for 16-bit rgb formats and also to match how gst_video_format_parse_caps expects them. https://bugzilla.gnome.org/show_bug.cgi?id=667681