summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-03 20:08:12 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-04 20:48:35 +0200
commit8336cba4e6a8c594680696d2337ddc800d84c267 (patch)
treeaf84a4d07479762cb89fb45798a42e3973e9b2e2 /src/lib
parent4b8b74ae8ae721f2fbf317f1d7ce5be6048ae1b0 (diff)
Move luminance to Interop/SMPTE metadata and remove the ISDCF metadata dialogue.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc14
-rw-r--r--src/lib/config.h11
-rw-r--r--src/lib/film.cc21
-rw-r--r--src/lib/film.h9
-rw-r--r--src/lib/isdcf_metadata.cc52
-rw-r--r--src/lib/isdcf_metadata.h46
-rw-r--r--src/lib/wscript1
7 files changed, 5 insertions, 149 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 0dcc84117..6ec3b0588 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -309,12 +309,6 @@ try
_dcp_product_version = f.optional_string_child("DCPProductVersion").get_value_or("");
_dcp_j2k_comment = f.optional_string_child("DCPJ2KComment").get_value_or("");
- if (version && version.get() >= 2) {
- _default_isdcf_metadata = ISDCFMetadata (f.node_child ("ISDCFMetadata"));
- } else {
- _default_isdcf_metadata = ISDCFMetadata (f.node_child ("DCIMetadata"));
- }
-
_default_still_length = f.optional_number_child<int>("DefaultStillLength").get_value_or (10);
_default_j2k_bandwidth = f.optional_number_child<int>("DefaultJ2KBandwidth").get_value_or (200000000);
_default_audio_delay = f.optional_number_child<int>("DefaultAudioDelay").get_value_or (0);
@@ -688,14 +682,6 @@ Config::write_config () const
/* [XML] UploadAfterMakeDCP 1 to upload to a TMS after making a DCP, 0 for no upload. */
root->add_child("UploadAfterMakeDCP")->add_child_text (_upload_after_make_dcp ? "1" : "0");
- /* [XML] ISDCFMetadata Default ISDCF metadata to use for new films; child tags are <code>&lt;ContentVersion&gt;</code>,
- <code>&lt;AudioLanguage&gt;</code>, <code>&lt;SubtitleLanguage&gt;</code>, <code>&lt;Territory&gt;</code>,
- <code>&lt;Rating&gt;</code>, <code>&lt;Studio&gt;</code>, <code>&lt;Facility&gt;</code>, <code>&lt;TempVersion&gt;</code>,
- <code>&lt;PreRelease&gt;</code>, <code>&lt;RedBand&gt;</code>, <code>&lt;Chain&gt;</code>, <code>&lt;TwoDVersionOFThreeD&gt;</code>,
- <code>&lt;MasteredLuminance&gt;</code>.
- */
- _default_isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata"));
-
/* [XML] DefaultStillLength Default length (in seconds) for still images in new films. */
root->add_child("DefaultStillLength")->add_child_text (raw_convert<string> (_default_still_length));
/* [XML] DefaultJ2KBandwidth Default bitrate (in bits per second) for JPEG2000 data in new films. */
diff --git a/src/lib/config.h b/src/lib/config.h
index 0a48a00e1..eb8f88da9 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -25,7 +25,6 @@
#ifndef DCPOMATIC_CONFIG_H
#define DCPOMATIC_CONFIG_H
-#include "isdcf_metadata.h"
#include "types.h"
#include "state.h"
#include "edid.h"
@@ -166,10 +165,6 @@ public:
return _show_experimental_audio_processors;
}
- ISDCFMetadata default_isdcf_metadata () const {
- return _default_isdcf_metadata;
- }
-
boost::optional<std::string> language () const {
return _language;
}
@@ -636,10 +631,6 @@ public:
maybe_set (_show_experimental_audio_processors, e, SHOW_EXPERIMENTAL_AUDIO_PROCESSORS);
}
- void set_default_isdcf_metadata (ISDCFMetadata d) {
- maybe_set (_default_isdcf_metadata, d);
- }
-
void set_language (std::string l) {
if (_language && _language.get() == l) {
return;
@@ -1174,8 +1165,6 @@ private:
bool _allow_any_container;
/** Offer the upmixers in the audio processor settings */
bool _show_experimental_audio_processors;
- /** Default ISDCF metadata for newly-created Films */
- ISDCFMetadata _default_isdcf_metadata;
boost::optional<std::string> _language;
/** Default length of still image content (seconds) */
int _default_still_length;
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 147470585..a9ac82b5a 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -155,7 +155,6 @@ Film::Film (optional<boost::filesystem::path> dir)
, _encrypted (false)
, _context_id (dcp::make_uuid ())
, _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ())
- , _isdcf_metadata (Config::instance()->default_isdcf_metadata ())
, _video_frame_rate (24)
, _audio_channels (Config::instance()->default_dcp_audio_channels ())
, _three_d (false)
@@ -446,7 +445,6 @@ Film::metadata (bool with_content_paths) const
root->add_child("Resolution")->add_child_text (resolution_to_string (_resolution));
root->add_child("J2KBandwidth")->add_child_text (raw_convert<string> (_j2k_bandwidth));
- _isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata"));
root->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_video_frame_rate));
root->add_child("ISDCFDate")->add_child_text (boost::gregorian::to_iso_string (_isdcf_date));
root->add_child("AudioChannels")->add_child_text (raw_convert<string> (_audio_channels));
@@ -572,11 +570,9 @@ Film::read_metadata (optional<boost::filesystem::path> path)
_name = f.string_child ("Name");
if (_state_version >= 9) {
_use_isdcf_name = f.bool_child ("UseISDCFName");
- _isdcf_metadata = ISDCFMetadata (f.node_child ("ISDCFMetadata"));
_isdcf_date = boost::gregorian::from_undelimited_string (f.string_child ("ISDCFDate"));
} else {
_use_isdcf_name = f.bool_child ("UseDCIName");
- _isdcf_metadata = ISDCFMetadata (f.node_child ("DCIMetadata"));
_isdcf_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate"));
}
@@ -872,8 +868,6 @@ Film::isdcf_name (bool if_created_now) const
d += "-" + version;
}
- auto const dm = isdcf_metadata ();
-
if (_temp_version) {
d += "-Temp";
}
@@ -898,8 +892,11 @@ Film::isdcf_name (bool if_created_now) const
d += "-2D";
}
- if (!dm.mastered_luminance.empty ()) {
- d += "-" + dm.mastered_luminance;
+ if (_luminance) {
+ auto fl = _luminance->value_in_foot_lamberts();
+ char buffer[64];
+ snprintf (buffer, sizeof(buffer), "%.1f", fl);
+ d += String::compose("-%1fl", buffer);
}
if (video_frame_rate() != 24) {
@@ -1129,13 +1126,6 @@ Film::set_j2k_bandwidth (int b)
_j2k_bandwidth = b;
}
-void
-Film::set_isdcf_metadata (ISDCFMetadata m)
-{
- FilmChangeSignaller ch (this, Property::ISDCF_METADATA);
- _isdcf_metadata = m;
-}
-
/** @param f New frame rate.
* @param user_explicit true if this comes from a direct user instruction, false if it is from
* DCP-o-matic being helpful.
@@ -1889,7 +1879,6 @@ Film::use_template (string name)
_audio_processor = _template_film->_audio_processor;
_reel_type = _template_film->_reel_type;
_reel_length = _template_film->_reel_length;
- _isdcf_metadata = _template_film->_isdcf_metadata;
}
pair<double, double>
diff --git a/src/lib/film.h b/src/lib/film.h
index e0c5cb2f7..5fc56acfb 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -29,7 +29,6 @@
#include "change_signaller.h"
#include "dcp_text_track.h"
#include "frame_rate_change.h"
-#include "isdcf_metadata.h"
#include "signaller.h"
#include "types.h"
#include "util.h"
@@ -217,7 +216,6 @@ public:
RESOLUTION,
ENCRYPTED,
J2K_BANDWIDTH,
- ISDCF_METADATA,
VIDEO_FRAME_RATE,
AUDIO_CHANNELS,
/** The setting of _three_d has changed */
@@ -286,10 +284,6 @@ public:
return _j2k_bandwidth;
}
- ISDCFMetadata isdcf_metadata () const {
- return _isdcf_metadata;
- }
-
/** @return The frame rate of the DCP */
int video_frame_rate () const {
return _video_frame_rate;
@@ -418,7 +412,6 @@ public:
void set_resolution (Resolution, bool user_explicit = true);
void set_encrypted (bool);
void set_j2k_bandwidth (int);
- void set_isdcf_metadata (ISDCFMetadata);
void set_video_frame_rate (int rate, bool user_explicit = false);
void set_audio_channels (int);
void set_three_d (bool);
@@ -518,8 +511,6 @@ private:
std::string _context_id;
/** bandwidth for J2K files in bits per second */
int _j2k_bandwidth;
- /** ISDCF naming stuff */
- ISDCFMetadata _isdcf_metadata;
/** Frames per second to run our DCP at */
int _video_frame_rate;
/** The date that we should use in a ISDCF name */
diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc
deleted file mode 100644
index 22e094b1b..000000000
--- a/src/lib/isdcf_metadata.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "isdcf_metadata.h"
-#include "warnings.h"
-#include <dcp/raw_convert.h>
-#include <libcxml/cxml.h>
-DCPOMATIC_DISABLE_WARNINGS
-#include <libxml++/libxml++.h>
-DCPOMATIC_ENABLE_WARNINGS
-#include <iostream>
-
-#include "i18n.h"
-
-using std::string;
-using std::shared_ptr;
-using dcp::raw_convert;
-
-ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node)
- : mastered_luminance (node->optional_string_child ("MasteredLuminance").get_value_or (""))
-{
-
-}
-
-void
-ISDCFMetadata::as_xml (xmlpp::Node* root) const
-{
- root->add_child("MasteredLuminance")->add_child_text (mastered_luminance);
-}
-
-bool
-operator== (ISDCFMetadata const & a, ISDCFMetadata const & b)
-{
- return a.mastered_luminance == b.mastered_luminance;
-}
diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h
deleted file mode 100644
index 4237b6a3e..000000000
--- a/src/lib/isdcf_metadata.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_ISDCF_METADATA_H
-#define DCPOMATIC_ISDCF_METADATA_H
-
-#include <libcxml/cxml.h>
-#include <string>
-
-namespace xmlpp {
- class Node;
-}
-
-class ISDCFMetadata
-{
-public:
- ISDCFMetadata () {}
- explicit ISDCFMetadata (cxml::ConstNodePtr);
-
- void as_xml (xmlpp::Node *) const;
- void read_old_metadata (std::string, std::string);
-
- /** mastered luminance if there are multiple versions distributed (e.g. 35, 4fl, 6fl etc.) */
- std::string mastered_luminance;
-};
-
-bool operator== (ISDCFMetadata const & a, ISDCFMetadata const & b);
-
-#endif
diff --git a/src/lib/wscript b/src/lib/wscript
index 1b45152a4..7cbd85a4c 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -121,7 +121,6 @@ sources = """
image_examiner.cc
image_filename_sorter.cc
image_proxy.cc
- isdcf_metadata.cc
j2k_image_proxy.cc
job.cc
job_manager.cc