X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fimage_examiner.cc;h=8e15a9d4836b8aee38c2eb0c3893587c8eb1be02;hb=c423bc90054e13eea2fc16bae9b6d30afdd361be;hp=cea5dfea7d1ea5addb5540a9cf0999ec735ccea0;hpb=1c4ab94645350d264a8cee1c131c9df1b1ffb958;p=dcpomatic.git diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc index cea5dfea7..8e15a9d48 100644 --- a/src/lib/image_examiner.cc +++ b/src/lib/image_examiner.cc @@ -24,8 +24,10 @@ #include "exceptions.h" #include "config.h" #include "cross.h" +#include "compose.hpp" #include #include +#include #include #include @@ -41,7 +43,7 @@ ImageExaminer::ImageExaminer (shared_ptr film, shared_ptrpath(0).string (); @@ -68,7 +70,7 @@ ImageExaminer::ImageExaminer (shared_ptr film, shared_ptrstill ()) { - _video_length = Config::instance()->default_still_length() * video_frame_rate().get_value_or (24); + _video_length = Config::instance()->default_still_length() * video_frame_rate().get_value_or (film->video_frame_rate ()); } else { _video_length = _image_content->number_of_paths (); } @@ -80,9 +82,24 @@ ImageExaminer::video_size () const return _video_size.get (); } -optional +optional ImageExaminer::video_frame_rate () const { + if (_image_content->video->has_own_frame_rate()) { + /* The content already knows what frame rate it should be */ + return _image_content->video->frame_rate(); + } + /* Don't know */ - return optional (); + return optional (); +} + +bool +ImageExaminer::yuv () const +{ + /* We never convert ImageSource from YUV to RGB (though maybe sometimes we should) + so it makes sense to just say they are never YUV so the option of a conversion + to RGB is not offered. + */ + return false; }