X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Foptions.h;h=4457969f3399254b89f77be38b3d308ee1c54ce9;hb=1f2bc4d8f3601ad1e12b94f37b3889fcd003509b;hp=86db35210a377cad8f3a0caa08059214f467751d;hpb=009a58293bf2e9727d544d1a2648422cc395d81e;p=dcpomatic.git diff --git a/src/lib/options.h b/src/lib/options.h index 86db35210..4457969f3 100644 --- a/src/lib/options.h +++ b/src/lib/options.h @@ -24,25 +24,22 @@ #include #include #include +#include #include "util.h" -/** @class Options - * @brief Options for a transcoding operation. +/** @class EncodeOptions + * @brief EncodeOptions for an encoding operation. * * These are settings which may be different, in different circumstances, for - * the same film; ie they are options for a particular transcode operation. + * the same film; ie they are options for a particular operation. */ -class Options +class EncodeOptions { public: - Options (std::string f, std::string e, std::string m) + EncodeOptions (std::string f, std::string e, std::string m) : padding (0) - , apply_crop (true) - , black_after (0) - , decode_video_frequency (0) - , decode_audio (true) - , decode_subtitles (false) + , video_skip (0) , _frame_out_path (f) , _frame_out_extension (e) , _multichannel_audio_out_path (m) @@ -53,11 +50,11 @@ 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, std::string e = "") const { + std::string frame_out_path (SourceFrame f, bool t, std::string e = "") const { if (e.empty ()) { e = _frame_out_extension; } @@ -94,13 +91,17 @@ public: } Size out_size; ///< size of output images - 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 black_after; ///< first frame for which to output a black frame, rather than the actual video content, or 0 for none - int decode_video_frequency; ///< skip frames so that this many are decoded in all (or 0) (for generating thumbnails) - bool decode_audio; ///< true to decode audio, otherwise false - bool decode_subtitles; + + /** Range of video frames to decode */ + boost::optional > video_range; + /** Range of audio frames to decode */ + boost::optional > audio_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 video_skip; private: /** Path of the directory to write video frames to */ @@ -110,3 +111,18 @@ private: /** Path of the directory to write audio files to */ std::string _multichannel_audio_out_path; }; + + +class DecodeOptions +{ +public: + DecodeOptions () + : decode_audio (true) + , decode_subtitles (false) + , video_sync (true) + {} + + bool decode_audio; + bool decode_subtitles; + bool video_sync; +};