if (key) {
mp->set_key (*key);
}
- auto picture_writer = mp->start_write (path / dcp::String::compose("video%1.mxf", suffix), false);
+ auto picture_writer = mp->start_write(path / dcp::String::compose("video%1.mxf", suffix), dcp::PictureAsset::Behaviour::MAKE_NEW);
dcp::Size const size (1998, 1080);
auto image = make_shared<dcp::OpenJPEGImage>(size);
shared_ptr<dcp::SoundAsset>
-simple_sound (boost::filesystem::path path, string suffix, dcp::MXFMetadata mxf_meta, string language, int frames, int sample_rate, optional<dcp::Key> key)
+simple_sound(boost::filesystem::path path, string suffix, dcp::MXFMetadata mxf_meta, string language, int frames, int sample_rate, optional<dcp::Key> key, int channels)
{
- int const channels = 6;
-
/* Set a valid language, then overwrite it, so that the language parameter can be badly formed */
auto ms = make_shared<dcp::SoundAsset>(dcp::Fraction(24, 1), sample_rate, channels, dcp::LanguageTag("en-US"), dcp::Standard::SMPTE);
if (key) {
}
ms->_language = language;
ms->set_metadata (mxf_meta);
- shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write (path / dcp::String::compose("audio%1.mxf", suffix));
+ auto sound_writer = ms->start_write(path / dcp::String::compose("audio%1.mxf", suffix), {}, dcp::SoundAsset::AtmosSync::DISABLED, dcp::SoundAsset::MCASubDescriptors::ENABLED);
int const samples_per_frame = sample_rate / 24;
}
for (auto i = 0; i < frames; ++i) {
- sound_writer->write (silence, samples_per_frame);
+ sound_writer->write(silence, channels, samples_per_frame);
}
sound_writer->finalize ();
shared_ptr<dcp::Subtitle>
simple_subtitle ()
{
- return make_shared<dcp::SubtitleString>(
+ return std::make_shared<dcp::SubtitleString>(
optional<string>(),
false,
false,
dcp::HAlign::CENTER,
0.8,
dcp::VAlign::TOP,
+ 0,
dcp::Direction::LTR,
"Hello world",
dcp::Effect::NONE,
auto asset = make_shared<dcp::MonoPictureAsset>(dcp::Fraction(24, 1), dcp::Standard::SMPTE);
asset->set_metadata (dcp::MXFMetadata("libdcp", "libdcp", "1.6.4devel"));
boost::filesystem::create_directories (dir);
- auto writer = asset->start_write (dir / "pic.mxf", true);
+ auto writer = asset->start_write(dir / "pic.mxf", dcp::PictureAsset::Behaviour::MAKE_NEW);
for (int i = 0; i < frames; ++i) {
writer->write (frame.data(), frame.size());
}