History

[media] videodev2.h/v4l2-dv-timings.h: add V4L2_DV_FL_IS_CE_VIDEO flag

In the past the V4L2_DV_BT_STD_CEA861 standard bit was used to determine whether the format is a CE (Consumer Electronics) format or not. However, the 640x480p59.94 format is part of the CEA-861 standard, but it is *not* a CE video format. Add a new flag to make this explicit. This information is needed in order to determine the default R'G'B' encoding for the format: for CE video this is limited range (16-235) instead of full range (0-255). The header with all the timings has been updated with this new flag.

Hans Verkuil committed 11 years ago

Commit 5ce65d11 parent acd2b672 files · +45 −25Browse files

Showing the changes to include/uapi (2 of 2 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/v4l2-dv-timings.h +39 −25
  2. include/uapi/linux/videodev2.h +6 −0
include/uapi/linux/v4l2-dv-timings.h+39−25
@@ -48,14 +48,15 @@ · 47 unmodified lines
4848 .type = V4L2_DV_BT_656_1120, \
4949 V4L2_INIT_BT_TIMINGS(720, 480, 1, 0, \
5050 13500000, 19, 62, 57, 4, 3, 15, 4, 3, 16, \
51− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_HALF_LINE) \
51+ V4L2_DV_BT_STD_CEA861, \
52+ V4L2_DV_FL_HALF_LINE | V4L2_DV_FL_IS_CE_VIDEO) \
5253 }
5354
5455 #define V4L2_DV_BT_CEA_720X480P59_94 { \
5556 .type = V4L2_DV_BT_656_1120, \
5657 V4L2_INIT_BT_TIMINGS(720, 480, 0, 0, \
5758 27000000, 16, 62, 60, 9, 6, 30, 0, 0, 0, \
58− V4L2_DV_BT_STD_CEA861, 0) \
59+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
5960 }
6061
6162 /* Note: these are the nominal timings, for HDMI links this format is typically
@@ -64,14 +65,15 @@ · 2 unmodified lines
6465 .type = V4L2_DV_BT_656_1120, \
6566 V4L2_INIT_BT_TIMINGS(720, 576, 1, 0, \
6667 13500000, 12, 63, 69, 2, 3, 19, 2, 3, 20, \
67− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_HALF_LINE) \
68+ V4L2_DV_BT_STD_CEA861, \
69+ V4L2_DV_FL_HALF_LINE | V4L2_DV_FL_IS_CE_VIDEO) \
6870 }
6971
7072 #define V4L2_DV_BT_CEA_720X576P50 { \
7173 .type = V4L2_DV_BT_656_1120, \
7274 V4L2_INIT_BT_TIMINGS(720, 576, 0, 0, \
7375 27000000, 12, 64, 68, 5, 5, 39, 0, 0, 0, \
74− V4L2_DV_BT_STD_CEA861, 0) \
76+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
7577 }
7678
7779 #define V4L2_DV_BT_CEA_1280X720P24 { \
@@ -88,7 +90,7 @@ · 10 unmodified lines
8890 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
8991 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
9092 74250000, 2420, 40, 220, 5, 5, 20, 0, 0, 0, \
91− V4L2_DV_BT_STD_CEA861, 0) \
93+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
9294 }
9395
9496 #define V4L2_DV_BT_CEA_1280X720P30 { \
@@ -96,7 +98,8 @@ · 1 unmodified line
9698 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
9799 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
98100 74250000, 1760, 40, 220, 5, 5, 20, 0, 0, 0, \
99− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
101+ V4L2_DV_BT_STD_CEA861, \
102+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
100103 }
101104
102105 #define V4L2_DV_BT_CEA_1280X720P50 { \
@@ -104,7 +107,7 @@ · 1 unmodified line
104107 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
105108 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
106109 74250000, 440, 40, 220, 5, 5, 20, 0, 0, 0, \
107− V4L2_DV_BT_STD_CEA861, 0) \
110+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
108111 }
109112
110113 #define V4L2_DV_BT_CEA_1280X720P60 { \
@@ -112,7 +115,8 @@ · 1 unmodified line
112115 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
113116 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
114117 74250000, 110, 40, 220, 5, 5, 20, 0, 0, 0, \
115− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
118+ V4L2_DV_BT_STD_CEA861, \
119+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
116120 }
117121
118122 #define V4L2_DV_BT_CEA_1920X1080P24 { \
@@ -120,7 +124,8 @@ · 1 unmodified line
120124 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
121125 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
122126 74250000, 638, 44, 148, 4, 5, 36, 0, 0, 0, \
123− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
127+ V4L2_DV_BT_STD_CEA861, \
128+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
124129 }
125130
126131 #define V4L2_DV_BT_CEA_1920X1080P25 { \
@@ -128,7 +133,7 @@ · 1 unmodified line
128133 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
129134 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
130135 74250000, 528, 44, 148, 4, 5, 36, 0, 0, 0, \
131− V4L2_DV_BT_STD_CEA861, 0) \
136+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
132137 }
133138
134139 #define V4L2_DV_BT_CEA_1920X1080P30 { \
@@ -136,7 +141,8 @@ · 1 unmodified line
136141 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
137142 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
138143 74250000, 88, 44, 148, 4, 5, 36, 0, 0, 0, \
139− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
144+ V4L2_DV_BT_STD_CEA861, \
145+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
140146 }
141147
142148 #define V4L2_DV_BT_CEA_1920X1080I50 { \
@@ -144,7 +150,8 @@ · 1 unmodified line
144150 V4L2_INIT_BT_TIMINGS(1920, 1080, 1, \
145151 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
146152 74250000, 528, 44, 148, 2, 5, 15, 2, 5, 16, \
147− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_HALF_LINE) \
153+ V4L2_DV_BT_STD_CEA861, \
154+ V4L2_DV_FL_HALF_LINE | V4L2_DV_FL_IS_CE_VIDEO) \
148155 }
149156
150157 #define V4L2_DV_BT_CEA_1920X1080P50 { \
@@ -152,7 +159,7 @@ · 1 unmodified line
152159 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
153160 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
154161 148500000, 528, 44, 148, 4, 5, 36, 0, 0, 0, \
155− V4L2_DV_BT_STD_CEA861, 0) \
162+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
156163 }
157164
158165 #define V4L2_DV_BT_CEA_1920X1080I60 { \
@@ -161,7 +168,8 @@ · 2 unmodified lines
161168 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
162169 74250000, 88, 44, 148, 2, 5, 15, 2, 5, 16, \
163170 V4L2_DV_BT_STD_CEA861, \
164− V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_HALF_LINE) \
171+ V4L2_DV_FL_CAN_REDUCE_FPS | \
172+ V4L2_DV_FL_HALF_LINE | V4L2_DV_FL_IS_CE_VIDEO) \
165173 }
166174
167175 #define V4L2_DV_BT_CEA_1920X1080P60 { \
@@ -170,77 +178,83 @@ · 2 unmodified lines
170178 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
171179 148500000, 88, 44, 148, 4, 5, 36, 0, 0, 0, \
172180 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CEA861, \
173− V4L2_DV_FL_CAN_REDUCE_FPS) \
181+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
174182 }
175183
176184 #define V4L2_DV_BT_CEA_3840X2160P24 { \
177185 .type = V4L2_DV_BT_656_1120, \
178186 V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
179187 297000000, 1276, 88, 296, 8, 10, 72, 0, 0, 0, \
180− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
188+ V4L2_DV_BT_STD_CEA861, \
189+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
181190 }
182191
183192 #define V4L2_DV_BT_CEA_3840X2160P25 { \
184193 .type = V4L2_DV_BT_656_1120, \
185194 V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
186195 297000000, 1056, 88, 296, 8, 10, 72, 0, 0, 0, \
187− V4L2_DV_BT_STD_CEA861, 0) \
196+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
188197 }
189198
190199 #define V4L2_DV_BT_CEA_3840X2160P30 { \
191200 .type = V4L2_DV_BT_656_1120, \
192201 V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
193202 297000000, 176, 88, 296, 8, 10, 72, 0, 0, 0, \
194− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
203+ V4L2_DV_BT_STD_CEA861, \
204+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
195205 }
196206
197207 #define V4L2_DV_BT_CEA_3840X2160P50 { \
198208 .type = V4L2_DV_BT_656_1120, \
199209 V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
200210 594000000, 1056, 88, 296, 8, 10, 72, 0, 0, 0, \
201− V4L2_DV_BT_STD_CEA861, 0) \
211+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
202212 }
203213
204214 #define V4L2_DV_BT_CEA_3840X2160P60 { \
205215 .type = V4L2_DV_BT_656_1120, \
206216 V4L2_INIT_BT_TIMINGS(3840, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
207217 594000000, 176, 88, 296, 8, 10, 72, 0, 0, 0, \
208− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
218+ V4L2_DV_BT_STD_CEA861, \
219+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
209220 }
210221
211222 #define V4L2_DV_BT_CEA_4096X2160P24 { \
212223 .type = V4L2_DV_BT_656_1120, \
213224 V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
214225 297000000, 1020, 88, 296, 8, 10, 72, 0, 0, 0, \
215− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
226+ V4L2_DV_BT_STD_CEA861, \
227+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
216228 }
217229
218230 #define V4L2_DV_BT_CEA_4096X2160P25 { \
219231 .type = V4L2_DV_BT_656_1120, \
220232 V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
221233 297000000, 968, 88, 128, 8, 10, 72, 0, 0, 0, \
222− V4L2_DV_BT_STD_CEA861, 0) \
234+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
223235 }
224236
225237 #define V4L2_DV_BT_CEA_4096X2160P30 { \
226238 .type = V4L2_DV_BT_656_1120, \
227239 V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
228240 297000000, 88, 88, 128, 8, 10, 72, 0, 0, 0, \
229− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
241+ V4L2_DV_BT_STD_CEA861, \
242+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
230243 }
231244
232245 #define V4L2_DV_BT_CEA_4096X2160P50 { \
233246 .type = V4L2_DV_BT_656_1120, \
234247 V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
235248 594000000, 968, 88, 128, 8, 10, 72, 0, 0, 0, \
236− V4L2_DV_BT_STD_CEA861, 0) \
249+ V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_IS_CE_VIDEO) \
237250 }
238251
239252 #define V4L2_DV_BT_CEA_4096X2160P60 { \
240253 .type = V4L2_DV_BT_656_1120, \
241254 V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, \
242255 594000000, 88, 88, 128, 8, 10, 72, 0, 0, 0, \
243− V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
256+ V4L2_DV_BT_STD_CEA861, \
257+ V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_IS_CE_VIDEO) \
244258 }
245259
246260
include/uapi/linux/videodev2.h+6−0
@@ -1188,6 +1188,12 @@ struct v4l2_bt_timings { · 1187 unmodified lines
11881188 exactly the same number of half-lines. Whether half-lines can be detected
11891189 or used depends on the hardware. */
11901190 #define V4L2_DV_FL_HALF_LINE (1 << 3)
1191+/* If set, then this is a Consumer Electronics (CE) video format. Such formats
1192+ * differ from other formats (commonly called IT formats) in that if RGB
1193+ * encoding is used then by default the RGB values use limited range (i.e.
1194+ * use the range 16-235) as opposed to 0-255. All formats defined in CEA-861
1195+ * except for the 640x480 format are CE formats. */
1196+#define V4L2_DV_FL_IS_CE_VIDEO (1 << 4)
11911197
11921198 /* A few useful defines to calculate the total blanking and frame sizes */
11931199 #define V4L2_DV_BT_BLANKING_WIDTH(bt) \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t