diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-03-19 14:02:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-04-22 13:03:04 +0200 |
| commit | f72a79c93626e773214f1a0318adf2445ac2ee72 (patch) | |
| tree | 7b84a9c0c000618893a3fa3d609507c855735669 /src/lib/film.cc | |
| parent | 5b2e3126602d508498a99bce256f5f465f095d43 (diff) | |
Support encoding of MPEG2 DCPs.
Diffstat (limited to 'src/lib/film.cc')
| -rw-r--r-- | src/lib/film.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 3de536a6d..54c68d756 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -169,6 +169,7 @@ Film::Film (optional<boost::filesystem::path> dir) , _three_d (false) , _sequence (true) , _interop (Config::instance()->default_interop ()) + , _video_encoding(VideoEncoding::JPEG2000) , _limit_to_smpte_bv20(false) , _audio_processor (0) , _reel_type (ReelType::SINGLE) @@ -251,6 +252,9 @@ Film::video_identifier () const if (_interop) { s += "_I"; + if (_video_encoding == VideoEncoding::MPEG2) { + s += "_M"; + } } else { s += "_S"; if (_limit_to_smpte_bv20) { @@ -405,6 +409,7 @@ Film::metadata (bool with_content_paths) const cxml::add_text_child(root, "ThreeD", _three_d ? "1" : "0"); cxml::add_text_child(root, "Sequence", _sequence ? "1" : "0"); cxml::add_text_child(root, "Interop", _interop ? "1" : "0"); + cxml::add_text_child(root, "VideoEncoding", video_encoding_to_string(_video_encoding)); cxml::add_text_child(root, "LimitToSMPTEBv20", _limit_to_smpte_bv20 ? "1" : "0"); cxml::add_text_child(root, "Encrypted", _encrypted ? "1" : "0"); cxml::add_text_child(root, "Key", _key.hex ()); @@ -595,6 +600,9 @@ Film::read_metadata (optional<boost::filesystem::path> path) _three_d = f.bool_child ("ThreeD"); _interop = f.bool_child ("Interop"); + if (auto encoding = f.optional_string_child("VideoEncoding")) { + _video_encoding = video_encoding_from_string(*encoding); + } _limit_to_smpte_bv20 = f.optional_bool_child("LimitToSMPTEBv20").get_value_or(false); _key = dcp::Key (f.string_child ("Key")); _context_id = f.optional_string_child("ContextID").get_value_or (dcp::make_uuid ()); @@ -1220,6 +1228,14 @@ Film::set_interop (bool i) void +Film::set_video_encoding(VideoEncoding encoding) +{ + FilmChangeSignaller ch(this, FilmProperty::VIDEO_ENCODING); + _video_encoding = encoding; +} + + +void Film::set_limit_to_smpte_bv20(bool limit) { FilmChangeSignaller ch(this, FilmProperty::LIMIT_TO_SMPTE_BV20); |
