diff --git a/cta.c b/cta.c index 223442f..5d07ccc 100644 --- a/cta.c +++ b/cta.c @@ -1553,7 +1553,7 @@ parse_speaker_location_block(struct di_edid_cta *cta, static bool parse_did_type_vii_timing(struct di_edid_cta *cta, - struct di_displayid_type_i_ii_vii_timing *t, + struct di_cta_type_vii_timing_priv *t, const uint8_t *data, size_t size) { uint8_t revision; @@ -1590,11 +1590,12 @@ parse_did_type_vii_timing(struct di_edid_cta *cta, data += 1; size -= 1; - if (!_di_displayid_parse_type_1_7_timing(t, cta->logger, + if (!_di_displayid_parse_type_1_7_timing(&t->timing, cta->logger, "DisplayID Type VII Video Timing Data Block", data, true)) return false; + t->base.timing = &t->timing; return true; } @@ -2112,13 +2113,13 @@ di_cta_data_block_get_speaker_locations(const struct di_cta_data_block *block) return &block->speaker_location.base; } -const struct di_displayid_type_i_ii_vii_timing * +const struct di_cta_type_vii_timing_block * di_cta_data_block_get_did_type_vii_timing(const struct di_cta_data_block *block) { if (block->tag != DI_CTA_DATA_BLOCK_DISPLAYID_VIDEO_TIMING_VII) { return NULL; } - return &block->did_vii_timing; + return &block->did_vii_timing.base; } const struct di_edid_detailed_timing_def *const * diff --git a/di-edid-decode/cta.c b/di-edid-decode/cta.c index e52b8f2..7104a50 100644 --- a/di-edid-decode/cta.c +++ b/di-edid-decode/cta.c @@ -906,7 +906,7 @@ print_cta(const struct di_edid_cta *cta) const struct di_cta_infoframe_block *infoframe; const struct di_cta_video_format_pref_block *video_format_pref; const struct di_edid_detailed_timing_def *const *detailed_timing_defs; - const struct di_displayid_type_i_ii_vii_timing *type_vii_timing; + const struct di_cta_type_vii_timing_block *type_vii_timing; const struct di_cta_hdmi_audio_block *hdmi_audio; size_t i; int vtdb_index = 0; @@ -1024,7 +1024,7 @@ print_cta(const struct di_edid_cta *cta) break; case DI_CTA_DATA_BLOCK_DISPLAYID_VIDEO_TIMING_VII: type_vii_timing = di_cta_data_block_get_did_type_vii_timing(data_block); - print_did_type_vii_timing(type_vii_timing, vtdb_index); + print_did_type_vii_timing(type_vii_timing->timing, vtdb_index); vtdb_index++; break; case DI_CTA_DATA_BLOCK_HDMI_AUDIO: diff --git a/include/cta.h b/include/cta.h index 9350cc3..312f3f4 100644 --- a/include/cta.h +++ b/include/cta.h @@ -185,6 +185,11 @@ struct di_cta_video_format_pref_priv { size_t svrs_len; }; +struct di_cta_type_vii_timing_priv { + struct di_cta_type_vii_timing_block base; + struct di_displayid_type_i_ii_vii_timing timing; +}; + struct di_cta_data_block { enum di_cta_data_block_tag tag; @@ -221,7 +226,7 @@ struct di_cta_data_block { /* Used for DI_CTA_DATA_BLOCK_VIDEO_FORMAT_PREF */ struct di_cta_video_format_pref_priv video_format_pref; /* Used for DI_CTA_DATA_BLOCK_DISPLAYID_VIDEO_TIMING_VII */ - struct di_displayid_type_i_ii_vii_timing did_vii_timing; + struct di_cta_type_vii_timing_priv did_vii_timing; }; extern const struct di_cta_video_format _di_cta_video_formats[]; diff --git a/include/libdisplay-info/cta.h b/include/libdisplay-info/cta.h index 0466541..bae9328 100644 --- a/include/libdisplay-info/cta.h +++ b/include/libdisplay-info/cta.h @@ -1128,13 +1128,23 @@ struct di_cta_speaker_location_block { const struct di_cta_speaker_location_block * di_cta_data_block_get_speaker_locations(const struct di_cta_data_block *block); +/* See */ +struct di_displayid_type_i_ii_vii_timing; + +/** + * Type VII Video Timing Data Block, defined in section 7.5.17.1 + */ +struct di_cta_type_vii_timing_block { + const struct di_displayid_type_i_ii_vii_timing *timing; +}; + /** * Get the DisplayID Type VII Video Timing from a CTA data block. * * Returns NULL if the data block tag is not * DI_CTA_DATA_BLOCK_DISPLAYID_VIDEO_TIMING_VII. */ -const struct di_displayid_type_i_ii_vii_timing * +const struct di_cta_type_vii_timing_block * di_cta_data_block_get_did_type_vii_timing(const struct di_cta_data_block *block); enum di_cta_svr_type {