[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.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Hans Verkuil 2016-07-14 07:58:35 -03:00 committed by Mauro Carvalho Chehab
parent 8fbe91e791
commit 4f100ff659

View File

@ -1254,6 +1254,9 @@ struct v4l2_standard {
* (aka field 2) of interlaced field formats
* @standards: Standards the timing belongs to
* @flags: Flags
* @picture_aspect: The picture aspect ratio (hor/vert).
* @cea861_vic: VIC code as per the CEA-861 standard.
* @hdmi_vic: VIC code as per the HDMI standard.
* @reserved: Reserved fields, must be zeroed.
*
* A note regarding vertical interlaced timings: height refers to the total
@ -1283,7 +1286,10 @@ struct v4l2_bt_timings {
__u32 il_vbackporch;
__u32 standards;
__u32 flags;
__u32 reserved[14];
struct v4l2_fract picture_aspect;
__u8 cea861_vic;
__u8 hdmi_vic;
__u8 reserved[46];
} __attribute__ ((packed));
/* Interlaced or progressive format */
@ -1346,6 +1352,23 @@ struct v4l2_bt_timings {
* field has the extra line. If not, it is the second field.
*/
#define V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE (1 << 5)
/*
* If set, then the picture_aspect field is valid. Otherwise assume that the
* pixels are square, so the picture aspect ratio is the same as the width to
* height ratio.
*/
#define V4L2_DV_FL_HAS_PICTURE_ASPECT (1 << 6)
/*
* If set, then the cea861_vic field is valid and contains the Video
* Identification Code as per the CEA-861 standard.
*/
#define V4L2_DV_FL_HAS_CEA861_VIC (1 << 7)
/*
* If set, then the hdmi_vic field is valid and contains the Video
* Identification Code as per the HDMI standard (HDMI Vendor Specific
* InfoFrame).
*/
#define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8)
/* A few useful defines to calculate the total blanking and frame sizes */
#define V4L2_DV_BT_BLANKING_WIDTH(bt) \