projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow specification of the CPL ID to use in a DCP with _create (#2302).
[dcpomatic.git]
/
src
/
tools
/
dcpomatic_create.cc
diff --git
a/src/tools/dcpomatic_create.cc
b/src/tools/dcpomatic_create.cc
index e6c948d2d509895986db5efdae1a08262d526416..62428b1a24484990e287d8f147f59e3e5d84b829 100644
(file)
--- a/
src/tools/dcpomatic_create.cc
+++ b/
src/tools/dcpomatic_create.cc
@@
-45,6
+45,7
@@
#include <stdexcept>
#include <string>
#include <stdexcept>
#include <string>
+
using std::cerr;
using std::cout;
using std::dynamic_pointer_cast;
using std::cerr;
using std::cout;
using std::dynamic_pointer_cast;
@@
-53,15
+54,17
@@
using std::list;
using std::make_shared;
using std::shared_ptr;
using std::string;
using std::make_shared;
using std::shared_ptr;
using std::string;
+using std::vector;
using boost::optional;
using boost::optional;
+
class SimpleSignalManager : public SignalManager
{
public:
/* Do nothing in this method so that UI events happen in our thread
when we call SignalManager::ui_idle().
*/
class SimpleSignalManager : public SignalManager
{
public:
/* Do nothing in this method so that UI events happen in our thread
when we call SignalManager::ui_idle().
*/
- void wake_ui () {}
+ void wake_ui ()
override
{}
};
int
};
int
@@
-105,6
+108,9
@@
main (int argc, char* argv[])
film->set_use_isdcf_name (!cc.no_use_isdcf_name);
film->set_encrypted (cc.encrypt);
film->set_three_d (cc.threed);
film->set_use_isdcf_name (!cc.no_use_isdcf_name);
film->set_encrypted (cc.encrypt);
film->set_three_d (cc.threed);
+ if (cc.twok) {
+ film->set_resolution (Resolution::TWO_K);
+ }
if (cc.fourk) {
film->set_resolution (Resolution::FOUR_K);
}
if (cc.fourk) {
film->set_resolution (Resolution::FOUR_K);
}
@@
-112,19
+118,26
@@
main (int argc, char* argv[])
film->set_j2k_bandwidth (*cc.j2k_bandwidth);
}
film->set_j2k_bandwidth (*cc.j2k_bandwidth);
}
- for (auto
i
: cc.content) {
-
boost::filesystem::path const can = boost::filesystem::canonical (i
.path);
-
list<shared_ptr<Content> > conten
t;
+ for (auto
cli_content
: cc.content) {
+
auto const can = boost::filesystem::canonical (cli_content
.path);
+
vector<shared_ptr<Content>> film_content_lis
t;
if (boost::filesystem::exists (can / "ASSETMAP") || (boost::filesystem::exists (can / "ASSETMAP.xml"))) {
if (boost::filesystem::exists (can / "ASSETMAP") || (boost::filesystem::exists (can / "ASSETMAP.xml"))) {
- content.push_back (make_shared<DCPContent>(can));
+ auto dcp = make_shared<DCPContent>(can);
+ film_content_list.push_back (dcp);
+ if (cli_content.kdm) {
+ dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(*cli_content.kdm)));
+ }
+ if (cli_content.cpl) {
+ dcp->set_cpl(*cli_content.cpl);
+ }
} else {
/* I guess it's not a DCP */
} else {
/* I guess it's not a DCP */
-
conten
t = content_factory (can);
+
film_content_lis
t = content_factory (can);
}
}
- for (auto
j: conten
t) {
- film->examine_and_add_content (
j
);
+ for (auto
film_content: film_content_lis
t) {
+ film->examine_and_add_content (
film_content
);
}
while (jm->work_to_do ()) {
}
while (jm->work_to_do ()) {
@@
-133,21
+146,21
@@
main (int argc, char* argv[])
while (signal_manager->ui_idle() > 0) {}
while (signal_manager->ui_idle() > 0) {}
- for (auto
j: conten
t) {
- if (
j
->video) {
-
j->video->set_frame_type (i
.frame_type);
+ for (auto
film_content: film_content_lis
t) {
+ if (
film_content
->video) {
+
film_content->video->set_frame_type (cli_content
.frame_type);
}
}
- if (
j->audio && i
.channel) {
- for (auto stream:
j
->audio->streams()) {
+ if (
film_content->audio && cli_content
.channel) {
+ for (auto stream:
film_content
->audio->streams()) {
AudioMapping mapping(stream->channels(), film->audio_channels());
for (int channel = 0; channel < stream->channels(); ++channel) {
AudioMapping mapping(stream->channels(), film->audio_channels());
for (int channel = 0; channel < stream->channels(); ++channel) {
- mapping.set(channel, *
i
.channel, 1.0f);
+ mapping.set(channel, *
cli_content
.channel, 1.0f);
}
stream->set_mapping (mapping);
}
}
}
stream->set_mapping (mapping);
}
}
- if (
j->audio && i
.gain) {
-
j->audio->set_gain (*i
.gain);
+ if (
film_content->audio && cli_content
.gain) {
+
film_content->audio->set_gain (*cli_content
.gain);
}
}
}
}
}
}
@@
-166,8
+179,10
@@
main (int argc, char* argv[])
if (jm->errors ()) {
for (auto i: jm->get()) {
if (i->finished_in_error()) {
if (jm->errors ()) {
for (auto i: jm->get()) {
if (i->finished_in_error()) {
- cerr << i->error_summary() << "\n"
- << i->error_details() << "\n";
+ cerr << i->error_summary() << "\n";
+ if (!i->error_details().empty()) {
+ cout << i->error_details() << "\n";
+ }
}
}
exit (EXIT_FAILURE);
}
}
exit (EXIT_FAILURE);