summaryrefslogtreecommitdiff
path: root/sys/v4l2/gstv4l2object.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/v4l2/gstv4l2object.c')
-rw-r--r--sys/v4l2/gstv4l2object.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 53fcd0073..f704edc65 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -1221,14 +1221,18 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
b_mask = 0xff0000;
break;
case V4L2_PIX_FMT_RGB32:
- bpp = depth = 32;
+ /* GST_VIDEO_FORMAT_RGBx */
+ bpp = 32;
+ depth = 24;
endianness = G_BIG_ENDIAN;
r_mask = 0xff000000;
g_mask = 0x00ff0000;
b_mask = 0x0000ff00;
break;
case V4L2_PIX_FMT_BGR32:
- bpp = depth = 32;
+ /* GST_VIDEO_FORMAT_BGRx */
+ bpp = 32;
+ depth = 24;
endianness = G_BIG_ENDIAN;
r_mask = 0x0000ff00;
g_mask = 0x00ff0000;
@@ -1493,8 +1497,9 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
#endif
}
} else if (!strcmp (mimetype, "video/x-raw-rgb")) {
- gint depth, endianness, r_mask;
+ gint bpp, depth, endianness, r_mask;
+ gst_structure_get_int (structure, "bpp", &bpp);
gst_structure_get_int (structure, "depth", &depth);
gst_structure_get_int (structure, "endianness", &endianness);
gst_structure_get_int (structure, "red_mask", &r_mask);
@@ -1512,10 +1517,10 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
V4L2_PIX_FMT_RGB565 : V4L2_PIX_FMT_RGB565X;
break;
case 24:
- fourcc = (r_mask == 0xFF) ? V4L2_PIX_FMT_BGR24 : V4L2_PIX_FMT_RGB24;
- break;
- case 32:
- fourcc = (r_mask == 0xFF00) ? V4L2_PIX_FMT_BGR32 : V4L2_PIX_FMT_RGB32;
+ if (bpp == 24)
+ fourcc = (r_mask == 0xFF) ? V4L2_PIX_FMT_BGR24 : V4L2_PIX_FMT_RGB24;
+ else
+ fourcc = (r_mask == 0xFF00) ? V4L2_PIX_FMT_BGR32 : V4L2_PIX_FMT_RGB32;
break;
}
} else if (strcmp (mimetype, "video/x-dv") == 0) {