summaryrefslogtreecommitdiff
path: root/lib/igt_infoframe.h
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-07-19 17:11:09 +0300
committerSimon Ser <simon.ser@intel.com>2019-08-15 15:00:08 +0300
commitf34d6dd8a0243c66198a111866e9107dc8ed5e43 (patch)
tree1363f1a1a3643871e2d789067bdf5e7ee8924567 /lib/igt_infoframe.h
parent87209d8421ea3ec3ca2207100f4897c4168011b8 (diff)
lib/igt_infoframe: add support for AVI InfoFrames
This commit adds partial support for AVI InfoFrames. Only bytes 1 and 2 of the InfoFrame payload are parsed. These bytes contain (among other things) information about the aspect ratio of the frames. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib/igt_infoframe.h')
-rw-r--r--lib/igt_infoframe.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/igt_infoframe.h b/lib/igt_infoframe.h
index 35daa3ea..eae251ea 100644
--- a/lib/igt_infoframe.h
+++ b/lib/igt_infoframe.h
@@ -32,6 +32,52 @@
#include <stddef.h>
#include <stdint.h>
+enum infoframe_avi_rgb_ycbcr {
+ INFOFRAME_AVI_RGB = 0,
+ INFOFRAME_AVI_YCBCR422 = 1,
+ INFOFRAME_AVI_YCBCR444 = 2,
+ INFOFRAME_AVI_YCBCR420 = 3,
+ INFOFRAME_AVI_IDO_DEFINED = 7,
+};
+
+enum infoframe_avi_scan {
+ INFOFRAME_AVI_SCAN_UNSPECIFIED = 0,
+ INFOFRAME_AVI_OVERSCAN = 1,
+ INFOFRAME_AVI_UNDERSCAN = 2,
+};
+
+enum infoframe_avi_colorimetry {
+ INFOFRAME_AVI_COLORIMETRY_UNSPECIFIED = 0,
+ INFOFRAME_AVI_SMPTE_170M = 1,
+ INFOFRAME_AVI_ITUR_BT709 = 2,
+ INFOFRAME_AVI_COLORIMETRY_EXTENDED = 3,
+};
+
+enum infoframe_avi_picture_aspect_ratio {
+ INFOFRAME_AVI_PIC_AR_UNSPECIFIED = 0,
+ INFOFRAME_AVI_PIC_AR_4_3 = 1,
+ INFOFRAME_AVI_PIC_AR_16_9 = 2,
+};
+
+enum infoframe_avi_active_aspect_ratio {
+ INFOFRAME_AVI_ACT_AR_PIC = 8, /* same as picture aspect ratio */
+ INFOFRAME_AVI_ACT_AR_4_3 = 9,
+ INFOFRAME_AVI_ACT_AR_16_9 = 10,
+ INFOFRAME_AVI_ACT_AR_14_9 = 11,
+};
+
+#define INFOFRAME_AVI_VIC_UNSPECIFIED 0
+
+struct infoframe_avi {
+ enum infoframe_avi_rgb_ycbcr rgb_ycbcr;
+ enum infoframe_avi_scan scan;
+ enum infoframe_avi_colorimetry colorimetry;
+ enum infoframe_avi_picture_aspect_ratio picture_aspect_ratio;
+ enum infoframe_avi_active_aspect_ratio active_aspect_ratio;
+ uint8_t vic; /* Video Identification Code */
+ /* TODO: remaining fields */
+};
+
enum infoframe_audio_coding_type {
INFOFRAME_AUDIO_CT_UNSPECIFIED = 0, /* refer to stream header */
INFOFRAME_AUDIO_CT_PCM = 1, /* IEC 60958 PCM */
@@ -58,6 +104,8 @@ struct infoframe_audio {
/* TODO: speaker allocation */
};
+bool infoframe_avi_parse(struct infoframe_avi *infoframe, int version,
+ const uint8_t *buf, size_t buf_size);
bool infoframe_audio_parse(struct infoframe_audio *infoframe, int version,
const uint8_t *buf, size_t buf_size);