History

[media] videodev2.h: add VICs and picture aspect ratio

Add picture aspect ratio information, the CEA-861 VIC (Video Identification Code) and the HDMI VIC to struct v4l2_bt_timings. The picture aspect was chosen rather than the pixel aspect since 1) the CEA-861 standard uses picture aspect, and 2) pixel aspect ratio can become tricky when dealing with pixel repeat timings. While we don't support those yet at the moment, this might become necessary. And in that case using picture aspect ratio makes more sense. And converting picture aspect ratio to pixel aspect ratio is easy enough.

Hans Verkuil committed 10 years ago

Commit 4f100ff1 parent 8fbe91e1 file · +25 −2Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/videodev2.h+25−2
@@ -1254,6 +1254,9 @@ struct v4l2_standard { · 1253 unmodified lines
1254 * (aka field 2) of interlaced field formats1254 * (aka field 2) of interlaced field formats
1255 * @standards: Standards the timing belongs to1255 * @standards: Standards the timing belongs to
1256 * @flags: Flags1256 * @flags: Flags
1257 * @picture_aspect: The picture aspect ratio (hor/vert).
1258 * @cea861_vic: VIC code as per the CEA-861 standard.
1259 * @hdmi_vic: VIC code as per the HDMI standard.
1257 * @reserved: Reserved fields, must be zeroed.1260 * @reserved: Reserved fields, must be zeroed.
1258 *1261 *
1259 * A note regarding vertical interlaced timings: height refers to the total1262 * A note regarding vertical interlaced timings: height refers to the total
@@ -1283,7 +1286,10 @@ struct v4l2_bt_timings { · 23 unmodified lines
1283 __u32 il_vbackporch;1286 __u32 il_vbackporch;
1284 __u32 standards;1287 __u32 standards;
1285 __u32 flags;1288 __u32 flags;
1286 __u32 reserved[14];1289 struct v4l2_fract picture_aspect;
1290 __u8 cea861_vic;
1291 __u8 hdmi_vic;
1292 __u8 reserved[46];
1287} __attribute__ ((packed));1293} __attribute__ ((packed));
1288 1294
1289/* Interlaced or progressive format */1295/* Interlaced or progressive format */
@@ -1345,7 +1351,24 @@ struct v4l2_bt_timings { · 55 unmodified lines
1345 * total height. For these formats, if this flag is set, the first1351 * total height. For these formats, if this flag is set, the first
1346 * field has the extra line. If not, it is the second field.1352 * field has the extra line. If not, it is the second field.
1347 */1353 */
1348#define V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE (1 << 5)1354#define V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE (1 << 5)
1355/*
1356 * If set, then the picture_aspect field is valid. Otherwise assume that the
1357 * pixels are square, so the picture aspect ratio is the same as the width to
1358 * height ratio.
1359 */
1360#define V4L2_DV_FL_HAS_PICTURE_ASPECT (1 << 6)
1361/*
1362 * If set, then the cea861_vic field is valid and contains the Video
1363 * Identification Code as per the CEA-861 standard.
1364 */
1365#define V4L2_DV_FL_HAS_CEA861_VIC (1 << 7)
1366/*
1367 * If set, then the hdmi_vic field is valid and contains the Video
1368 * Identification Code as per the HDMI standard (HDMI Vendor Specific
1369 * InfoFrame).
1370 */
1371#define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8)
1349 1372
1350/* A few useful defines to calculate the total blanking and frame sizes */1373/* A few useful defines to calculate the total blanking and frame sizes */
1351#define V4L2_DV_BT_BLANKING_WIDTH(bt) \1374#define V4L2_DV_BT_BLANKING_WIDTH(bt) \