management of ASDCP::DefaultSMPTEDict().
static string const smpte_395_ns = "http://www.smpte-ra.org/reg/395/2014/13/1/aaf";
static string const smpte_335_ns = "http://www.smpte-ra.org/reg/335/2012";
+
CPL::CPL (string annotation_text, ContentKind content_kind)
/* default _content_title_text to annotation_text */
: _issuer ("libdcp" LIBDCP_VERSION)
shared_ptr<SoundAssetReader> reader = asset->start_read ();
ASDCP::MXF::SoundfieldGroupLabelSubDescriptor* soundfield;
ASDCP::Result_t r = reader->reader()->OP1aHeader().GetMDObjectByType(
- ASDCP::DefaultSMPTEDict().ul(ASDCP::MDD_SoundfieldGroupLabelSubDescriptor),
+ asdcp_smpte_dict->ul(ASDCP::MDD_SoundfieldGroupLabelSubDescriptor),
reinterpret_cast<ASDCP::MXF::InterchangeObject**>(&soundfield)
);
if (KM_SUCCESS(r)) {
list<ASDCP::MXF::InterchangeObject*> channels;
ASDCP::Result_t r = reader->reader()->OP1aHeader().GetMDObjectsByType(
- ASDCP::DefaultSMPTEDict().ul(ASDCP::MDD_AudioChannelLabelSubDescriptor),
+ asdcp_smpte_dict->ul(ASDCP::MDD_AudioChannelLabelSubDescriptor),
channels
);
using boost::dynamic_pointer_cast;
using namespace dcp;
+
SoundAsset::SoundAsset (boost::filesystem::path file)
: Asset (file)
/* XXX: this is a fallback language, which will be used if we can't find the RFC5646SpokenLanguage
ASDCP::MXF::SoundfieldGroupLabelSubDescriptor* soundfield;
ASDCP::Result_t rr = reader.OP1aHeader().GetMDObjectByType(
- ASDCP::DefaultSMPTEDict().ul(ASDCP::MDD_SoundfieldGroupLabelSubDescriptor),
+ asdcp_smpte_dict->ul(ASDCP::MDD_SoundfieldGroupLabelSubDescriptor),
reinterpret_cast<ASDCP::MXF::InterchangeObject**>(&soundfield)
);
using namespace dcp;
-/* Some ASDCP objects store this as a *&, for reasons which are not
- * at all clear, so we have to keep this around forever.
- */
-static ASDCP::Dictionary const* smpte_dict = &ASDCP::DefaultSMPTEDict();
-
-
struct SoundAssetWriter::ASDCPState
{
ASDCP::PCM::MXFWriter mxf_writer;
ASDCP::MXF::WaveAudioDescriptor* essence_descriptor = 0;
_state->mxf_writer.OP1aHeader().GetMDObjectByType(
- smpte_dict->ul(ASDCP::MDD_WaveAudioDescriptor), reinterpret_cast<ASDCP::MXF::InterchangeObject**>(&essence_descriptor)
+ asdcp_smpte_dict->ul(ASDCP::MDD_WaveAudioDescriptor), reinterpret_cast<ASDCP::MXF::InterchangeObject**>(&essence_descriptor)
);
DCP_ASSERT (essence_descriptor);
- essence_descriptor->ChannelAssignment = smpte_dict->ul(ASDCP::MDD_DCAudioChannelCfg_MCA);
+ essence_descriptor->ChannelAssignment = asdcp_smpte_dict->ul(ASDCP::MDD_DCAudioChannelCfg_MCA);
- ASDCP::MXF::SoundfieldGroupLabelSubDescriptor* soundfield = new ASDCP::MXF::SoundfieldGroupLabelSubDescriptor(smpte_dict);
+ ASDCP::MXF::SoundfieldGroupLabelSubDescriptor* soundfield = new ASDCP::MXF::SoundfieldGroupLabelSubDescriptor(asdcp_smpte_dict);
GenRandomValue (soundfield->MCALinkID);
soundfield->RFC5646SpokenLanguage = _asset->language().to_string();
if (field == SEVEN_POINT_ONE) {
soundfield->MCATagSymbol = "sg71";
soundfield->MCATagName = "7.1DS";
- soundfield->MCALabelDictionaryID = smpte_dict->ul(ASDCP::MDD_DCAudioSoundfield_71);
+ soundfield->MCALabelDictionaryID = asdcp_smpte_dict->ul(ASDCP::MDD_DCAudioSoundfield_71);
} else {
soundfield->MCATagSymbol = "sg51";
soundfield->MCATagName = "5.1";
- soundfield->MCALabelDictionaryID = smpte_dict->ul(ASDCP::MDD_DCAudioSoundfield_51);
+ soundfield->MCALabelDictionaryID = asdcp_smpte_dict->ul(ASDCP::MDD_DCAudioSoundfield_51);
}
_state->mxf_writer.OP1aHeader().AddChildObject(soundfield);
essence_descriptor->SubDescriptors.push_back(soundfield->InstanceUID);
BOOST_FOREACH (Channel i, _active_channels) {
- ASDCP::MXF::AudioChannelLabelSubDescriptor* channel = new ASDCP::MXF::AudioChannelLabelSubDescriptor(smpte_dict);
+ ASDCP::MXF::AudioChannelLabelSubDescriptor* channel = new ASDCP::MXF::AudioChannelLabelSubDescriptor(asdcp_smpte_dict);
GenRandomValue (channel->MCALinkID);
channel->SoundfieldGroupLinkID = soundfield->MCALinkID;
channel->MCAChannelID = static_cast<int>(i) + 1;
channel->MCATagSymbol = "ch" + channel_to_mca_id(i, field);
channel->MCATagName = channel_to_mca_name(i, field);
channel->RFC5646SpokenLanguage = _asset->language().to_string();
- channel->MCALabelDictionaryID = channel_to_mca_universal_label(i, field, smpte_dict);
+ channel->MCALabelDictionaryID = channel_to_mca_universal_label(i, field, asdcp_smpte_dict);
_state->mxf_writer.OP1aHeader().AddChildObject(channel);
essence_descriptor->SubDescriptors.push_back(channel->InstanceUID);
}
using boost::algorithm::trim;
using namespace dcp;
+
+/* Some ASDCP objects store this as a *&, for reasons which are not
+ * at all clear, so we have to keep this around forever.
+ */
+ASDCP::Dictionary const* dcp::asdcp_smpte_dict = 0;
+
+
/** Create a UUID.
* @return UUID.
*/
return true;
}
-/** Set up various bits that the library needs. Should be called one
+/** Set up various bits that the library needs. Should be called once
* by client applications.
*/
void
}
OpenSSL_add_all_algorithms();
+
+ asdcp_smpte_dict = &ASDCP::DefaultSMPTEDict();
}
/** Decode a base64 string. The base64 decode routine in KM_util.cpp
extern bool day_less_than_or_equal (LocalTime a, LocalTime b);
extern bool day_greater_than_or_equal (LocalTime a, LocalTime b);
extern std::string unique_string (std::list<std::string> existing, std::string base);
+extern ASDCP::Dictionary const* asdcp_smpte_dict;
class ASDCPErrorSuspender
int
main (int argc, char* argv[])
{
+ dcp::init ();
+
optional<boost::filesystem::path> output_file;
optional<boost::filesystem::path> kdm_file;
optional<boost::filesystem::path> private_key_file;
int
main (int argc, char* argv[])
{
+ dcp::init ();
+
EqualityOptions options;
options.max_mean_pixel_error = 5;
options.max_std_dev_pixel_error = 5;
int
main (int argc, char* argv[])
{
+ dcp::init ();
+
bool extract_fonts = true;
optional<boost::filesystem::path> kdm_file;
optional<boost::filesystem::path> private_key_file;
int
main (int argc, char* argv[])
{
+ dcp::init ();
+
bool subtitles = false;
bool picture = false;
bool decompress = false;
main (int argc, char* argv[])
try
{
+ dcp::init ();
+
optional<boost::filesystem::path> private_key_file;
int option_index = 0;
int
main (int argc, char* argv[])
{
+ dcp::init ();
+
int option_index = 0;
optional<boost::filesystem::path> output;
while (true) {
int
main (int argc, char* argv[])
{
+ dcp::init ();
+
int option_index = 0;
while (true) {
struct option long_options[] = {
int
main (int argc, char* argv[])
{
+ dcp::init ();
+
bool ignore_missing_assets = false;
bool quiet = false;