summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-21 23:07:07 +0200
committerCarl Hetherington <cth@carlh.net>2020-04-21 23:33:44 +0200
commit561eed2dc9978e890a020b6435ceb0333bb69a61 (patch)
tree8c74e05f438598fc49a78898e42fee0693d481ea /src/lib
parent142f7dee139074294d35c630ecee67b85e8a98fc (diff)
Add DCPContent::resolution().
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dcp_content.cc21
-rw-r--r--src/lib/dcp_content.h2
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;