From c1d3458d57951710bb2b48694ec7c2f60f00749e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 17 Nov 2015 23:13:25 +0100 Subject: [PATCH] Add extra_lines information for 1080i. --- bmusb.cpp | 22 +++++++++++----------- bmusb.h | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bmusb.cpp b/bmusb.cpp index b1c8fdc..18ea353 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -1169,17 +1169,17 @@ bool decode_video_format(uint16_t video_format, int *width, int *height, int *ex // usually it doesn't mean anything. uint16_t normalized_video_format = video_format & ~0xe808; constexpr VideoFormatEntry entries[] = { - { 0x0143, 1280, 720, 25, 5, 50, 1, false }, // 720p50. - { 0x0103, 1280, 720, 25, 5, 60, 1, false }, // 720p60. - { 0x0121, 1280, 720, 25, 5, 60000, 1001, false }, // 720p59.94. - { 0x01c3, 1920, 1080, 0, 0, 30, 1, false }, // 1080p30. - { 0x0003, 1920, 1080, 0, 0, 30, 1, true }, // 1080i60. - { 0x01e1, 1920, 1080, 0, 0, 30000, 1001, false }, // 1080p29.97. - { 0x0021, 1920, 1080, 0, 0, 30000, 1001, true }, // 1080i59.94. - { 0x0063, 1920, 1080, 0, 0, 25, 1, false }, // 1080p25. - { 0x0043, 1920, 1080, 0, 0, 25, 1, true }, // 1080p50. - { 0x008e, 1920, 1080, 0, 0, 24, 1, false }, // 1080p24. - { 0x00a1, 1920, 1080, 0, 0, 24000, 1001, false }, // 1080p23.98. + { 0x0143, 1280, 720, 25, 5, 50, 1, false }, // 720p50. + { 0x0103, 1280, 720, 25, 5, 60, 1, false }, // 720p60. + { 0x0121, 1280, 720, 25, 5, 60000, 1001, false }, // 720p59.94. + { 0x01c3, 1920, 1080, 0, 0, 30, 1, false }, // 1080p30. + { 0x0003, 1920, 1080, 20, 25, 30, 1, true }, // 1080i60. + { 0x01e1, 1920, 1080, 0, 0, 30000, 1001, false }, // 1080p29.97. + { 0x0021, 1920, 1080, 20, 25, 30000, 1001, true }, // 1080i59.94. + { 0x0063, 1920, 1080, 0, 0, 25, 1, false }, // 1080p25. + { 0x0043, 1920, 1080, 0, 0, 25, 1, true }, // 1080p50. + { 0x008e, 1920, 1080, 0, 0, 24, 1, false }, // 1080p24. + { 0x00a1, 1920, 1080, 0, 0, 24000, 1001, false }, // 1080p23.98. }; for (const VideoFormatEntry &entry : entries) { if (normalized_video_format == entry.normalized_video_format) { diff --git a/bmusb.h b/bmusb.h index 58ad9e7..f643bd4 100644 --- a/bmusb.h +++ b/bmusb.h @@ -157,6 +157,7 @@ class BMUSBCapture { // Get details for the given video format; returns false if detection was incomplete. // Note: Frame rate is _frame_ rate, not field rate. So 1080i60 gets 30/1, _not_ 60/1. +// TODO: Add another extra_lines_ parameter for interlaced. bool decode_video_format(uint16_t video_format, int *width, int *height, int *extra_lines_top, int *extra_lines_bottom, int *frame_rate_nom, int *frame_rate_den, bool *interlaced); -- 2.39.2