video: Use host endianness when generating caps for 16-bit rgb formats
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Tue, 10 Jan 2012 19:02:48 +0000 (21:02 +0200)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 30 Jan 2012 15:56:44 +0000 (15:56 +0000)
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

gst-libs/gst/video/video.c

index f22ff4c..f68de1c 100644 (file)
@@ -673,7 +673,7 @@ gst_video_format_new_caps_raw (GstVideoFormat format)
 
     if (bpp != 8) {
       gst_caps_set_simple (caps,
-          "endianness", G_TYPE_INT, G_BIG_ENDIAN,
+          "endianness", G_TYPE_INT, bpp == 16 ? G_BYTE_ORDER : G_BIG_ENDIAN,
           "red_mask", G_TYPE_INT, red_mask,
           "green_mask", G_TYPE_INT, green_mask,
           "blue_mask", G_TYPE_INT, blue_mask, NULL);