diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-21 23:07:07 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-21 23:33:44 +0200 |
| commit | 561eed2dc9978e890a020b6435ceb0333bb69a61 (patch) | |
| tree | 8c74e05f438598fc49a78898e42fee0693d481ea /src/lib | |
| parent | 142f7dee139074294d35c630ecee67b85e8a98fc (diff) | |
Add DCPContent::resolution().
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_content.cc | 21 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 2 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 94d5c010b..6c2db91d3 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -606,13 +606,8 @@ DCPContent::can_reference_video (shared_ptr<const Film> film, string& why_not) c return false; } - Resolution video_res = RESOLUTION_2K; - if (video->size().width > 2048 || video->size().height > 1080) { - video_res = RESOLUTION_4K; - } - - if (film->resolution() != video_res) { - if (video_res == RESOLUTION_4K) { + if (film->resolution() != resolution()) { + if (resolution() == RESOLUTION_4K) { /// TRANSLATORS: this string will follow "Cannot reference this DCP: " why_not = _("it is 4K and the film is 2K."); } else { @@ -738,3 +733,15 @@ DCPContent::kdm_timing_window_valid () const dcp::LocalTime now; return _kdm->not_valid_before() < now && now < _kdm->not_valid_after(); } + + +Resolution +DCPContent::resolution () const +{ + if (video->size().width > 2048 || video->size().height > 1080) { + return RESOLUTION_4K; + } + + return RESOLUTION_2K; +} + diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index b9c4d9ee5..8658ac5ed 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -156,6 +156,8 @@ public: bool kdm_timing_window_valid () const; + Resolution resolution () const; + private: friend class reels_test5; |
