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
12541254 * (aka field 2) of interlaced field formats
12551255 * @standards: Standards the timing belongs to
12561256 * @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.
12571260 * @reserved: Reserved fields, must be zeroed.
12581261 *
12591262 * A note regarding vertical interlaced timings: height refers to the total
@@ -1283,7 +1286,10 @@ struct v4l2_bt_timings { · 23 unmodified lines
12831286 __u32 il_vbackporch;
12841287 __u32 standards;
12851288 __u32 flags;
1286− __u32 reserved[14];
1289+ struct v4l2_fract picture_aspect;
1290+ __u8 cea861_vic;
1291+ __u8 hdmi_vic;
1292+ __u8 reserved[46];
12871293 } __attribute__ ((packed));
12881294
12891295 /* Interlaced or progressive format */
@@ -1345,7 +1351,24 @@ struct v4l2_bt_timings { · 55 unmodified lines
13451351 * total height. For these formats, if this flag is set, the first
13461352 * field has the extra line. If not, it is the second field.
13471353 */
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)
13491372
13501373 /* A few useful defines to calculate the total blanking and frame sizes */
13511374 #define V4L2_DV_BT_BLANKING_WIDTH(bt) \