summaryrefslogtreecommitdiff
blob: f2d85ef888f7bb2a803f5869124b5bc1b48a53cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 194aa8513c02fbfcabf04b45ff4c81bf8a94527f Mon Sep 17 00:00:00 2001
From: Rob Clark <rob@ti.com>
Date: Tue, 14 Sep 2010 07:42:50 -0500
Subject: [PATCH 01/11] v4l2: fix handling of RGB32/BGR32 formats

bpp is 32, but depth is only 24..
---
 sys/v4l2/gstv4l2object.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 7e15489..f5672b5 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -1132,14 +1132,16 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
           b_mask = 0xff0000;
           break;
         case V4L2_PIX_FMT_RGB32:
-          bpp = depth = 32;
+          depth = 24;
+          bpp = 32;
           endianness = G_BIG_ENDIAN;
           r_mask = 0xff000000;
           g_mask = 0x00ff0000;
           b_mask = 0x0000ff00;
           break;
         case V4L2_PIX_FMT_BGR32:
-          bpp = depth = 32;
+          depth = 24;
+          bpp = 32;
           endianness = G_BIG_ENDIAN;
           r_mask = 0x000000ff;
           g_mask = 0x0000ff00;
@@ -1404,13 +1406,13 @@ 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, endianness, r_mask;
 
-    gst_structure_get_int (structure, "depth", &depth);
+    gst_structure_get_int (structure, "bpp", &bpp);
     gst_structure_get_int (structure, "endianness", &endianness);
     gst_structure_get_int (structure, "red_mask", &r_mask);
 
-    switch (depth) {
+    switch (bpp) {
       case 8:
         fourcc = V4L2_PIX_FMT_RGB332;
         break;
-- 
1.7.1