X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Foptions.h;h=29b3b71cd4a91e01bc8d76494608d076d6c4452c;hb=2231b171b4b624f4b747031727f61bd93f80957f;hp=b283e330de93af35db292aa0f0f8703e6820c6ce;hpb=bb767c7e338414beee132af3e96829c1448e214b;p=dcpomatic.git diff --git a/src/lib/options.h b/src/lib/options.h index b283e330d..29b3b71cd 100644 --- a/src/lib/options.h +++ b/src/lib/options.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "util.h" /** @class Options @@ -39,10 +40,9 @@ public: Options (std::string f, std::string e, std::string m) : padding (0) , apply_crop (true) - , num_frames (0) - , decode_video (true) - , decode_video_frequency (0) + , decode_video_skip (0) , decode_audio (true) + , decode_subtitles (false) , _frame_out_path (f) , _frame_out_extension (e) , _multichannel_audio_out_path (m) @@ -53,15 +53,19 @@ public: return _frame_out_path; } - /** @param f Frame index. + /** @param f Source frame index. * @param t true to return a temporary file path, otherwise a permanent one. * @return The path to write this video frame to. */ - std::string frame_out_path (int f, bool t) const { + std::string frame_out_path (SourceFrame f, bool t, std::string e = "") const { + if (e.empty ()) { + e = _frame_out_extension; + } + std::stringstream s; s << _frame_out_path << "/"; s.width (8); - s << std::setfill('0') << f << _frame_out_extension; + s << std::setfill('0') << f << e; if (t) { s << ".tmp"; @@ -93,11 +97,18 @@ public: float ratio; ///< ratio of the wanted output image (not considering padding) int padding; ///< number of pixels of padding (in terms of the output size) each side of the image bool apply_crop; ///< true to apply cropping - int num_frames; ///< number of video frames to run for, or 0 for all - int black_after; ///< first frame for which to output a black frame, rather than the actual video content, or 0 for none - bool decode_video; ///< true to decode video, otherwise false - int decode_video_frequency; ///< skip frames so that this many are decoded in all (or 0) (for generating thumbnails) + + /** Range of video frames to decode */ + boost::optional > video_decode_range; + /** Range of audio frames to decode */ + boost::optional > audio_decode_range; + + /** Skip frames such that we don't decode any frame where (index % decode_video_skip) != 0; e.g. + * 1 for every frame, 2 for every other frame, etc. + */ + SourceFrame decode_video_skip; bool decode_audio; ///< true to decode audio, otherwise false + bool decode_subtitles; private: /** Path of the directory to write video frames to */