summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc6
-rw-r--r--src/lib/config.h10
-rw-r--r--src/lib/film.cc17
-rw-r--r--src/lib/film.h7
-rw-r--r--src/lib/reel_writer.cc3
-rw-r--r--src/lib/writer.cc2
6 files changed, 43 insertions, 2 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 2db50d687..908a438e9 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -198,6 +198,7 @@ Config::set_defaults ()
_default_kdm_duration = RoughDuration(1, RoughDuration::Unit::WEEKS);
_auto_crop_threshold = 0.1;
_last_release_notes_version = boost::none;
+ _allow_smpte_bv20 = false;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
@@ -629,6 +630,8 @@ try
}
}
+ _allow_smpte_bv20 = f.optional_bool_child("AllowSMPTEBv20").get_value_or(false);
+
_export.read(f.optional_node_child("Export"));
}
catch (...) {
@@ -1110,6 +1113,9 @@ Config::write_config () const
_default_add_file_location == DefaultAddFileLocation::SAME_AS_LAST_TIME ? "last" : "project"
);
+ /* [XML] AllowSMPTEBv20 1 to allow the user to choose SMPTE (Bv2.0 only) as a standard, otherwise 0 */
+ root->add_child("AllowSMPTEBv20")->add_child_text(_allow_smpte_bv20 ? "1" : "0");
+
_export.write(root->add_child("Export"));
auto target = config_write_file();
diff --git a/src/lib/config.h b/src/lib/config.h
index a816cd89b..91d779b7a 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -93,6 +93,7 @@ public:
SHOW_EXPERIMENTAL_AUDIO_PROCESSORS,
AUDIO_MAPPING,
AUTO_CROP_THRESHOLD,
+ ALLOW_SMPTE_BV20,
OTHER
};
@@ -612,6 +613,10 @@ public:
return _default_add_file_location;
}
+ bool allow_smpte_bv20() const {
+ return _allow_smpte_bv20;
+ }
+
/* SET (mostly) */
void set_master_encoding_threads (int n) {
@@ -1185,6 +1190,10 @@ public:
maybe_set(_default_add_file_location, location);
}
+ void set_allow_smpte_bv20(bool allow) {
+ maybe_set(_allow_smpte_bv20, allow, ALLOW_SMPTE_BV20);
+ }
+
void changed (Property p = OTHER);
boost::signals2::signal<void (Property)> Changed;
/** Emitted if read() failed on an existing Config file. There is nothing
@@ -1422,6 +1431,7 @@ private:
boost::optional<int> _main_divider_sash_position;
boost::optional<int> _main_content_divider_sash_position;
DefaultAddFileLocation _default_add_file_location;
+ bool _allow_smpte_bv20;
ExportConfig _export;
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 69d55c7c4..25a135488 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -166,6 +166,7 @@ Film::Film (optional<boost::filesystem::path> dir)
, _three_d (false)
, _sequence (true)
, _interop (Config::instance()->default_interop ())
+ , _limit_to_smpte_bv20(false)
, _audio_processor (0)
, _reel_type (ReelType::SINGLE)
, _reel_length (2000000000)
@@ -269,6 +270,11 @@ Film::video_identifier () const
s += "_I";
} else {
s += "_S";
+ if (_limit_to_smpte_bv20) {
+ s += "_L20";
+ } else {
+ s += "_L21";
+ }
}
if (_three_d) {
@@ -416,6 +422,7 @@ Film::metadata (bool with_content_paths) const
root->add_child("ThreeD")->add_child_text (_three_d ? "1" : "0");
root->add_child("Sequence")->add_child_text (_sequence ? "1" : "0");
root->add_child("Interop")->add_child_text (_interop ? "1" : "0");
+ root->add_child("LimitToSMPTEBv20")->add_child_text(_limit_to_smpte_bv20 ? "1" : "0");
root->add_child("Encrypted")->add_child_text (_encrypted ? "1" : "0");
root->add_child("Key")->add_child_text (_key.hex ());
root->add_child("ContextID")->add_child_text (_context_id);
@@ -586,6 +593,7 @@ Film::read_metadata (optional<boost::filesystem::path> path)
_three_d = f.bool_child ("ThreeD");
_interop = f.bool_child ("Interop");
+ _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 ());
@@ -1179,6 +1187,15 @@ Film::set_interop (bool i)
_interop = i;
}
+
+void
+Film::set_limit_to_smpte_bv20(bool limit)
+{
+ FilmChangeSignaller ch(this, Property::LIMIT_TO_SMPTE_BV20);
+ _limit_to_smpte_bv20 = limit;
+}
+
+
void
Film::set_audio_processor (AudioProcessor const * processor)
{
diff --git a/src/lib/film.h b/src/lib/film.h
index 7ae22052a..b7a9f94ac 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -228,6 +228,7 @@ public:
THREE_D,
SEQUENCE,
INTEROP,
+ LIMIT_TO_SMPTE_BV20,
AUDIO_PROCESSOR,
REEL_TYPE,
REEL_LENGTH,
@@ -312,6 +313,10 @@ public:
return _interop;
}
+ bool limit_to_smpte_bv20() const {
+ return _limit_to_smpte_bv20;
+ }
+
AudioProcessor const * audio_processor () const {
return _audio_processor;
}
@@ -433,6 +438,7 @@ public:
void set_isdcf_date_today ();
void set_sequence (bool);
void set_interop (bool);
+ void set_limit_to_smpte_bv20(bool);
void set_audio_processor (AudioProcessor const * processor);
void set_reel_type (ReelType);
void set_reel_length (int64_t);
@@ -544,6 +550,7 @@ private:
bool _three_d;
bool _sequence;
bool _interop;
+ bool _limit_to_smpte_bv20;
AudioProcessor const * _audio_processor;
ReelType _reel_type;
/** Desired reel length in bytes, if _reel_type == REELTYPE_BY_LENGTH */
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index 47df4feb1..31860e881 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -195,7 +195,8 @@ ReelWriter::ReelWriter (
*/
_sound_asset_writer = _sound_asset->start_write (
film()->directory().get() / audio_asset_filename (_sound_asset, _reel_index, _reel_count, _content_summary),
- film()->contains_atmos_content()
+ film()->contains_atmos_content(),
+ !film()->limit_to_smpte_bv20()
);
}
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index a36944723..1c8f1a0cd 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -691,7 +691,7 @@ Writer::finish (boost::filesystem::path output_dcp)
dcp.set_creator(creator);
dcp.set_annotation_text(film()->dcp_name());
- dcp.write_xml (signer, Config::instance()->dcp_metadata_filename_format());
+ dcp.write_xml(signer, !film()->limit_to_smpte_bv20(), Config::instance()->dcp_metadata_filename_format());
LOG_GENERAL (
N_("Wrote %1 FULL, %2 FAKE, %3 REPEAT, %4 pushed to disk"), _full_written, _fake_written, _repeat_written, _pushed_to_disk