summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-09-09 12:08:26 +0200
committerAdam Jackson <ajax@redhat.com>2017-09-18 10:16:48 -0400
commit3a4d2ceed7d34add126a44fec9879808ca9fab0a (patch)
treec37b24c53a39c7b55fee290379ba3fdbf7480250
parent331dc5beee3c1fc2a852f9ecc2173a43d4a99bbb (diff)
edid-decode: add HDR Dynamic Metadata Data Block
Support this CTA-861-G data block. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--edid-decode.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/edid-decode.c b/edid-decode.c
index b2b116f..0fe126c 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -1900,6 +1900,37 @@ cea_hdr_static_metadata_block(unsigned char *x)
}
static void
+cea_hdr_dyn_metadata_block(unsigned char *x)
+{
+ int length = x[0] & 0x1f;
+
+ if (!length)
+ return;
+ length--;
+ x += 2;
+ while (length >= 3) {
+ int type_len = x[0];
+ int type = x[1] | (x[2] << 8);
+
+ if (length < type_len + 1)
+ return;
+ printf(" HDR Dynamic Metadata Type %d\n", type);
+ switch (type) {
+ case 1:
+ case 2:
+ case 4:
+ if (type_len > 2)
+ printf(" Version: %d\n", x[3] & 0xf);
+ break;
+ default:
+ break;
+ }
+ length -= type_len + 1;
+ x += type_len + 1;
+ }
+}
+
+static void
cea_block(unsigned char *x)
{
static int last_block_was_hdmi_vsdb;
@@ -1965,6 +1996,10 @@ cea_block(unsigned char *x)
printf("HDR static metadata data block\n");
cea_hdr_static_metadata_block(x);
break;
+ case 0x07:
+ printf("HDR dynamic metadata data block\n");
+ cea_hdr_dyn_metadata_block(x);
+ break;
case 0x0d:
printf("Video format preference data block\n");
cea_vfpdb(x);