From 28111007e2e6fd62f5810be780706ae1618bd33f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 21 Jan 2021 02:44:11 +0100 Subject: [PATCH] Adapt for libdcp use of enum class. --- cscript | 4 +- src/lib/audio_mapping.cc | 33 +++++- src/lib/audio_mapping.h | 6 +- src/lib/colour_conversion.cc | 2 +- src/lib/config.cc | 16 +-- src/lib/copy_dcp_details_to_film.cc | 2 +- src/lib/create_cli.cc | 4 +- src/lib/dcp.cc | 2 +- src/lib/dcp_content.cc | 12 +- src/lib/dcp_content_type.cc | 24 ++-- src/lib/dcp_decoder.cc | 4 +- src/lib/dcp_examiner.cc | 8 +- src/lib/dkdm_recipient.cc | 2 +- src/lib/ffmpeg_encoder.cc | 26 ++-- src/lib/film.cc | 16 +-- src/lib/hints.cc | 2 +- src/lib/image.cc | 24 ++-- src/lib/j2k_image_proxy.cc | 2 +- src/lib/log.cc | 17 +-- src/lib/player.cc | 2 +- src/lib/player_video.cc | 2 +- src/lib/reel_writer.cc | 4 +- src/lib/render_text.cc | 20 ++-- src/lib/spl_entry.cc | 4 +- src/lib/text_content.cc | 20 ++-- src/lib/text_decoder.cc | 26 ++-- src/lib/types.cc | 2 +- src/lib/util.cc | 50 ++++---- src/lib/verify_dcp_job.cc | 2 +- src/lib/video_mxf_decoder.cc | 4 +- src/lib/writer.cc | 12 +- src/tools/dcpomatic.cc | 2 +- src/tools/dcpomatic_create.cc | 2 +- src/tools/dcpomatic_kdm_cli.cc | 10 +- src/wx/closed_captions_dialog.cc | 6 +- src/wx/colour_conversion_editor.cc | 2 +- src/wx/kdm_output_panel.cc | 10 +- src/wx/language_tag_dialog.cc | 49 ++++---- src/wx/smpte_metadata_dialog.cc | 22 ++-- src/wx/subtitle_appearance_dialog.cc | 12 +- src/wx/verify_dcp_dialog.cc | 170 +++++++++++++-------------- src/wx/video_waveform_plot.cc | 2 +- test/atmos_test.cc | 2 +- test/create_cli_test.cc | 7 +- test/dcp_decoder_test.cc | 2 +- test/ffmpeg_encoder_test.cc | 8 +- test/image_test.cc | 44 +++---- test/import_dcp_test.cc | 2 +- test/isdcf_name_test.cc | 36 +++--- test/kdm_naming_test.cc | 4 +- test/ratio_test.cc | 3 +- test/recover_test.cc | 2 +- test/remake_id_test.cc | 2 +- test/render_subtitles_test.cc | 8 +- test/stream_test.cc | 12 +- test/test.cc | 23 +++- test/test.h | 9 +- test/vf_kdm_test.cc | 4 +- test/video_content_scale_test.cc | 1 + 59 files changed, 435 insertions(+), 375 deletions(-) diff --git a/cscript b/cscript index c9359d0b0..52e3fe406 100644 --- a/cscript +++ b/cscript @@ -370,8 +370,8 @@ def dependencies(target, options): # Use distro-provided FFmpeg on Arch deps = [] - deps.append(('libdcp', '6c3db78')) - deps.append(('libsub', 'af2520e')) + deps.append(('libdcp', 'e5f89bf')) + deps.append(('libsub', '948df33')) deps.append(('leqm-nrt', '131f971')) deps.append(('rtaudio', 'f619b76')) # We get our OpenSSL libraries from the environment, but we diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc index 0f330dc2b..7734d168a 100644 --- a/src/lib/audio_mapping.cc +++ b/src/lib/audio_mapping.cc @@ -134,7 +134,7 @@ AudioMapping::make_default (AudioProcessor const * processor, optional(dcp::CENTRE), 1); + set (0, static_cast(dcp::Channel::CENTRE), 1); } } else { /* 1:1 mapping */ @@ -156,14 +156,14 @@ AudioMapping::AudioMapping (cxml::ConstNodePtr node, int state_version) if (state_version <= 5) { /* Old-style: on/off mapping */ for (auto i: node->node_children ("Map")) { - set (i->number_child("ContentIndex"), static_cast(i->number_child("DCP")), 1); + set (i->number_child("ContentIndex"), i->number_child("DCP"), 1); } } else { for (auto i: node->node_children("Gain")) { if (state_version < 32) { set ( i->number_attribute("Content"), - static_cast(i->number_attribute("DCP")), + i->number_attribute("DCP"), raw_convert(i->content()) ); } else { @@ -177,6 +177,21 @@ AudioMapping::AudioMapping (cxml::ConstNodePtr node, int state_version) } } + +void +AudioMapping::set (dcp::Channel input_channel, int output_channel, float g) +{ + set (static_cast(input_channel), output_channel, g); +} + + +void +AudioMapping::set (int input_channel, dcp::Channel output_channel, float g) +{ + set (input_channel, static_cast(output_channel), g); +} + + void AudioMapping::set (int input_channel, int output_channel, float g) { @@ -185,6 +200,14 @@ AudioMapping::set (int input_channel, int output_channel, float g) _gain[input_channel][output_channel] = g; } + +float +AudioMapping::get (int input_channel, dcp::Channel output_channel) const +{ + return get (input_channel, static_cast(output_channel)); +} + + float AudioMapping::get (int input_channel, int output_channel) const { @@ -236,8 +259,8 @@ AudioMapping::mapped_output_channels () const for (auto const& i: _gain) { for (auto j: dcp::used_audio_channels()) { - if (abs(i[j]) > minus_96_db) { - mapped.push_back (j); + if (abs(i[static_cast(j)]) > minus_96_db) { + mapped.push_back (static_cast(j)); } } } diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index 8add0ec83..6bac0a7d8 100644 --- a/src/lib/audio_mapping.h +++ b/src/lib/audio_mapping.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -25,6 +25,7 @@ #ifndef DCPOMATIC_AUDIO_MAPPING_H #define DCPOMATIC_AUDIO_MAPPING_H +#include #include #include @@ -51,8 +52,11 @@ public: void make_zero (); void make_default (AudioProcessor const * processor, boost::optional filename = boost::optional()); + void set (dcp::Channel input_channel, int output_channel, float); void set (int input_channel, int output_channel, float); + void set (int input_channel, dcp::Channel output_channel, float); float get (int input_channel, int output_channel) const; + float get (int input_channel, dcp::Channel output_channel) const; int input_channels () const { return _input_channels; diff --git a/src/lib/colour_conversion.cc b/src/lib/colour_conversion.cc index 57e73a5b5..6cf4ed646 100644 --- a/src/lib/colour_conversion.cc +++ b/src/lib/colour_conversion.cc @@ -95,7 +95,7 @@ ColourConversion::ColourConversion (cxml::NodePtr node, int version) } } - _yuv_to_rgb = static_cast (node->optional_number_child("YUVToRGB").get_value_or (dcp::YUV_TO_RGB_REC601)); + _yuv_to_rgb = static_cast(node->optional_number_child("YUVToRGB").get_value_or(static_cast(dcp::YUVToRGB::REC601))); auto m = node->node_children ("Matrix"); if (!m.empty ()) { diff --git a/src/lib/config.cc b/src/lib/config.cc index eae57cc06..7040c5127 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -1376,14 +1376,14 @@ Config::audio_mapping (int output_channels) Map so that Lt = L(-3dB) + Ls(-3dB) + C(-6dB) + Lfe(-10dB) Rt = R(-3dB) + Rs(-3dB) + C(-6dB) + Lfe(-10dB) */ - _audio_mapping->set (dcp::LEFT, 0, 1 / sqrt(2)); // L -> Lt - _audio_mapping->set (dcp::RIGHT, 1, 1 / sqrt(2)); // R -> Rt - _audio_mapping->set (dcp::CENTRE, 0, 1 / 2.0); // C -> Lt - _audio_mapping->set (dcp::CENTRE, 1, 1 / 2.0); // C -> Rt - _audio_mapping->set (dcp::LFE, 0, 1 / sqrt(10)); // Lfe -> Lt - _audio_mapping->set (dcp::LFE, 1, 1 / sqrt(10)); // Lfe -> Rt - _audio_mapping->set (dcp::LS, 0, 1 / sqrt(2)); // Ls -> Lt - _audio_mapping->set (dcp::RS, 1, 1 / sqrt(2)); // Rs -> Rt + _audio_mapping->set (dcp::Channel::LEFT, 0, 1 / sqrt(2)); // L -> Lt + _audio_mapping->set (dcp::Channel::RIGHT, 1, 1 / sqrt(2)); // R -> Rt + _audio_mapping->set (dcp::Channel::CENTRE, 0, 1 / 2.0); // C -> Lt + _audio_mapping->set (dcp::Channel::CENTRE, 1, 1 / 2.0); // C -> Rt + _audio_mapping->set (dcp::Channel::LFE, 0, 1 / sqrt(10)); // Lfe -> Lt + _audio_mapping->set (dcp::Channel::LFE, 1, 1 / sqrt(10)); // Lfe -> Rt + _audio_mapping->set (dcp::Channel::LS, 0, 1 / sqrt(2)); // Ls -> Lt + _audio_mapping->set (dcp::Channel::RS, 1, 1 / sqrt(2)); // Rs -> Rt } else { /* 1:1 mapping */ for (int i = 0; i < min (MAX_DCP_AUDIO_CHANNELS, output_channels); ++i) { diff --git a/src/lib/copy_dcp_details_to_film.cc b/src/lib/copy_dcp_details_to_film.cc index 9bd88a422..64a38c335 100644 --- a/src/lib/copy_dcp_details_to_film.cc +++ b/src/lib/copy_dcp_details_to_film.cc @@ -47,7 +47,7 @@ copy_dcp_details_to_film (shared_ptr dcp, shared_ptr fil } film->set_encrypted (dcp->encrypted()); film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); - film->set_interop (dcp->standard() == dcp::INTEROP); + film->set_interop (dcp->standard() == dcp::Standard::INTEROP); film->set_three_d (dcp->three_d()); if (dcp->video) { diff --git a/src/lib/create_cli.cc b/src/lib/create_cli.cc index 7acd5756f..de26a7412 100644 --- a/src/lib/create_cli.cc +++ b/src/lib/create_cli.cc @@ -79,7 +79,7 @@ CreateCLI::CreateCLI (int argc, char* argv[]) , dcp_content_type (0) , container_ratio (0) , still_length (10) - , standard (dcp::SMPTE) + , standard (dcp::Standard::SMPTE) , no_use_isdcf_name (false) , fourk (false) { @@ -192,7 +192,7 @@ CreateCLI::CreateCLI (int argc, char* argv[]) } if (standard_string == "interop") { - standard = dcp::INTEROP; + standard = dcp::Standard::INTEROP; } if (content.empty()) { diff --git a/src/lib/dcp.cc b/src/lib/dcp.cc index 05b71557e..06e3e15d5 100644 --- a/src/lib/dcp.cc +++ b/src/lib/dcp.cc @@ -54,7 +54,7 @@ DCP::cpls () const if (!_tolerant) { /** We accept and ignore EMPTY_ASSET_PATH and EXTERNAL_ASSET but everything else is bad */ for (auto j: notes) { - if (j.code() == dcp::VerificationNote::EMPTY_ASSET_PATH || j.code() == dcp::VerificationNote::EXTERNAL_ASSET) { + if (j.code() == dcp::VerificationNote::Code::EMPTY_ASSET_PATH || j.code() == dcp::VerificationNote::Code::EXTERNAL_ASSET) { LOG_WARNING("Empty path in ASSETMAP of %1", i.string()); } else { boost::throw_exception(dcp::ReadError(dcp::note_to_string(j))); diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index e43d88a34..022fd223c 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -136,9 +136,9 @@ DCPContent::DCPContent (cxml::ConstNodePtr node, int version) if (node->optional_string_child("Standard")) { string const s = node->optional_string_child("Standard").get(); if (s == "Interop") { - _standard = dcp::INTEROP; + _standard = dcp::Standard::INTEROP; } else if (s == "SMPTE") { - _standard = dcp::SMPTE; + _standard = dcp::Standard::SMPTE; } else { DCPOMATIC_ASSERT (false); } @@ -373,10 +373,10 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const node->add_child("ReferenceClosedCaption")->add_child_text(_reference_text[TEXT_CLOSED_CAPTION] ? "1" : "0"); if (_standard) { switch (_standard.get ()) { - case dcp::INTEROP: + case dcp::Standard::INTEROP: node->add_child("Standard")->add_child_text ("Interop"); break; - case dcp::SMPTE: + case dcp::Standard::SMPTE: node->add_child("Standard")->add_child_text ("SMPTE"); break; default: @@ -595,11 +595,11 @@ DCPContent::can_reference (shared_ptr film, functioninterop()) { + if (_standard.get() == dcp::Standard::INTEROP && !film->interop()) { /// TRANSLATORS: this string will follow "Cannot reference this DCP: " why_not = _("it is Interop and the film is set to SMPTE."); return false; - } else if (_standard.get() == dcp::SMPTE && film->interop()) { + } else if (_standard.get() == dcp::Standard::SMPTE && film->interop()) { /// TRANSLATORS: this string will follow "Cannot reference this DCP: " why_not = _("it is SMPTE and the film is set to Interop."); return false; diff --git a/src/lib/dcp_content_type.cc b/src/lib/dcp_content_type.cc index c31c507b0..e1b05852c 100644 --- a/src/lib/dcp_content_type.cc +++ b/src/lib/dcp_content_type.cc @@ -42,18 +42,18 @@ DCPContentType::DCPContentType (string p, dcp::ContentKind k, string d) void DCPContentType::setup_dcp_content_types () { - _dcp_content_types.push_back (new DCPContentType (_("Feature"), dcp::FEATURE, N_("FTR"))); - _dcp_content_types.push_back (new DCPContentType (_("Short"), dcp::SHORT, N_("SHR"))); - _dcp_content_types.push_back (new DCPContentType (_("Trailer"), dcp::TRAILER, N_("TLR"))); - _dcp_content_types.push_back (new DCPContentType (_("Test"), dcp::TEST, N_("TST"))); - _dcp_content_types.push_back (new DCPContentType (_("Transitional"), dcp::TRANSITIONAL, N_("XSN"))); - _dcp_content_types.push_back (new DCPContentType (_("Rating"), dcp::RATING, N_("RTG"))); - _dcp_content_types.push_back (new DCPContentType (_("Teaser"), dcp::TEASER, N_("TSR"))); - _dcp_content_types.push_back (new DCPContentType (_("Policy"), dcp::POLICY, N_("POL"))); - _dcp_content_types.push_back (new DCPContentType (_("Public Service Announcement"), dcp::PUBLIC_SERVICE_ANNOUNCEMENT, N_("PSA"))); - _dcp_content_types.push_back (new DCPContentType (_("Advertisement"), dcp::ADVERTISEMENT, N_("ADV"))); - _dcp_content_types.push_back (new DCPContentType (_("Episode"), dcp::EPISODE, N_("EPS"))); - _dcp_content_types.push_back (new DCPContentType (_("Promo"), dcp::PROMO, N_("PRO"))); + _dcp_content_types.push_back (new DCPContentType(_("Feature"), dcp::ContentKind::FEATURE, N_("FTR"))); + _dcp_content_types.push_back (new DCPContentType(_("Short"), dcp::ContentKind::SHORT, N_("SHR"))); + _dcp_content_types.push_back (new DCPContentType(_("Trailer"), dcp::ContentKind::TRAILER, N_("TLR"))); + _dcp_content_types.push_back (new DCPContentType(_("Test"), dcp::ContentKind::TEST, N_("TST"))); + _dcp_content_types.push_back (new DCPContentType(_("Transitional"), dcp::ContentKind::TRANSITIONAL, N_("XSN"))); + _dcp_content_types.push_back (new DCPContentType(_("Rating"), dcp::ContentKind::RATING, N_("RTG"))); + _dcp_content_types.push_back (new DCPContentType(_("Teaser"), dcp::ContentKind::TEASER, N_("TSR"))); + _dcp_content_types.push_back (new DCPContentType(_("Policy"), dcp::ContentKind::POLICY, N_("POL"))); + _dcp_content_types.push_back (new DCPContentType(_("Public Service Announcement"), dcp::ContentKind::PUBLIC_SERVICE_ANNOUNCEMENT, N_("PSA"))); + _dcp_content_types.push_back (new DCPContentType(_("Advertisement"), dcp::ContentKind::ADVERTISEMENT, N_("ADV"))); + _dcp_content_types.push_back (new DCPContentType(_("Episode"), dcp::ContentKind::EPISODE, N_("EPS"))); + _dcp_content_types.push_back (new DCPContentType(_("Promo"), dcp::ContentKind::PROMO, N_("PRO"))); } DCPContentType const * diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 4bc090bf4..0491f5af7 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -178,7 +178,7 @@ DCPDecoder::pass () new J2KImageProxy ( _stereo_reader->get_frame (entry_point + frame), picture_asset->size(), - dcp::EYE_LEFT, + dcp::Eye::LEFT, AV_PIX_FMT_XYZ12LE, _forced_reduction ) @@ -192,7 +192,7 @@ DCPDecoder::pass () new J2KImageProxy ( _stereo_reader->get_frame (entry_point + frame), picture_asset->size(), - dcp::EYE_RIGHT, + dcp::Eye::RIGHT, AV_PIX_FMT_XYZ12LE, _forced_reduction ) diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index d0c3d1021..5ea568359 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -225,14 +225,14 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) /* Check that we can read the first picture, sound and subtitle frames of each reel */ try { for (auto i: cpl->reels()) { - shared_ptr pic = i->main_picture()->asset (); - shared_ptr mono = dynamic_pointer_cast (pic); - shared_ptr stereo = dynamic_pointer_cast (pic); + auto pic = i->main_picture()->asset (); + auto mono = dynamic_pointer_cast (pic); + auto stereo = dynamic_pointer_cast (pic); if (mono) { mono->start_read()->get_frame(0)->xyz_image (); } else { - stereo->start_read()->get_frame(0)->xyz_image (dcp::EYE_LEFT); + stereo->start_read()->get_frame(0)->xyz_image(dcp::Eye::LEFT); } if (i->main_sound()) { diff --git a/src/lib/dkdm_recipient.cc b/src/lib/dkdm_recipient.cc index 22da53f3b..8704f627a 100644 --- a/src/lib/dkdm_recipient.cc +++ b/src/lib/dkdm_recipient.cc @@ -78,7 +78,7 @@ kdm_for_dkdm_recipient ( cpl, begin, end, - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0 ); diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc index cc4f18bb6..9504b51b8 100644 --- a/src/lib/ffmpeg_encoder.cc +++ b/src/lib/ffmpeg_encoder.cc @@ -78,21 +78,21 @@ FFmpegEncoder::FFmpegEncoder ( float const overall_gain = 2 / (4 + sqrt(2)); float const minus_3dB = 1 / sqrt(2); if (ch == 2) { - map.set (dcp::LEFT, 0, 1); - map.set (dcp::RIGHT, 1, 1); + map.set (dcp::Channel::LEFT, 0, 1); + map.set (dcp::Channel::RIGHT, 1, 1); } else if (ch == 4) { - map.set (dcp::LEFT, 0, overall_gain); - map.set (dcp::RIGHT, 1, overall_gain); - map.set (dcp::CENTRE, 0, overall_gain * minus_3dB); - map.set (dcp::CENTRE, 1, overall_gain * minus_3dB); - map.set (dcp::LS, 0, overall_gain); + map.set (dcp::Channel::LEFT, 0, overall_gain); + map.set (dcp::Channel::RIGHT, 1, overall_gain); + map.set (dcp::Channel::CENTRE, 0, overall_gain * minus_3dB); + map.set (dcp::Channel::CENTRE, 1, overall_gain * minus_3dB); + map.set (dcp::Channel::LS, 0, overall_gain); } else if (ch >= 6) { - map.set (dcp::LEFT, 0, overall_gain); - map.set (dcp::RIGHT, 1, overall_gain); - map.set (dcp::CENTRE, 0, overall_gain * minus_3dB); - map.set (dcp::CENTRE, 1, overall_gain * minus_3dB); - map.set (dcp::LS, 0, overall_gain); - map.set (dcp::RS, 1, overall_gain); + map.set (dcp::Channel::LEFT, 0, overall_gain); + map.set (dcp::Channel::RIGHT, 1, overall_gain); + map.set (dcp::Channel::CENTRE, 0, overall_gain * minus_3dB); + map.set (dcp::Channel::CENTRE, 1, overall_gain * minus_3dB); + map.set (dcp::Channel::LS, 0, overall_gain); + map.set (dcp::Channel::RS, 1, overall_gain); } /* XXX: maybe we should do something better for >6 channel DCPs */ } else { diff --git a/src/lib/film.cc b/src/lib/film.cc index a0f25d84b..aa5dfdea9 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -172,8 +172,8 @@ Film::Film (optional dir) , _audio_language (dcp::LanguageTag("en-US")) , _release_territory (dcp::LanguageTag::RegionSubtag("US")) , _version_number (1) - , _status (dcp::FINAL) - , _luminance (dcp::Luminance(4.5, dcp::Luminance::FOOT_LAMBERT)) + , _status (dcp::Status::FINAL) + , _luminance (dcp::Luminance(4.5, dcp::Luminance::Unit::FOOT_LAMBERT)) , _state_version (current_state_version) , _dirty (false) , _tolerant (false) @@ -770,10 +770,10 @@ Film::mapped_audio_channels () const mapped.push_back (i); } } else { - for (auto i: content ()) { + for (auto i: content()) { if (i->audio) { - auto c = i->audio->mapping().mapped_output_channels (); - copy (c.begin(), c.end(), back_inserter (mapped)); + auto c = i->audio->mapping().mapped_output_channels(); + copy (c.begin(), c.end(), back_inserter(mapped)); } } @@ -879,7 +879,7 @@ Film::isdcf_name (bool if_created_now) const /* XXX: this uses the first bit of content only */ /* Interior aspect ratio. The standard says we don't do this for trailers, for some strange reason */ - if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::TRAILER) { + if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::ContentKind::TRAILER) { Ratio const* content_ratio = nullptr; for (auto i: content ()) { if (i->video) { @@ -952,10 +952,10 @@ Film::isdcf_name (bool if_created_now) const d += String::compose("_%1%2", ch.first, ch.second); } - if (audio_channels() > static_cast(dcp::HI) && find(mapped.begin(), mapped.end(), dcp::HI) != mapped.end()) { + if (audio_channels() > static_cast(dcp::Channel::HI) && find(mapped.begin(), mapped.end(), static_cast(dcp::Channel::HI)) != mapped.end()) { d += "-HI"; } - if (audio_channels() > static_cast(dcp::VI) && find(mapped.begin(), mapped.end(), dcp::VI) != mapped.end()) { + if (audio_channels() > static_cast(dcp::Channel::VI) && find(mapped.begin(), mapped.end(), static_cast(dcp::Channel::VI)) != mapped.end()) { d += "-VI"; } diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 58d33204c..ebc42bc91 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -534,7 +534,7 @@ void Hints::check_ffec_and_ffmc_in_smpte_feature () { shared_ptr f = film(); - if (!f->interop() && f->dcp_content_type()->libdcp_kind() == dcp::FEATURE && (!f->marker(dcp::Marker::FFEC) || !f->marker(dcp::Marker::FFMC))) { + if (!f->interop() && f->dcp_content_type()->libdcp_kind() == dcp::ContentKind::FEATURE && (!f->marker(dcp::Marker::FFEC) || !f->marker(dcp::Marker::FFMC))) { hint (_("SMPTE DCPs with the type FTR (feature) should have markers for the first frame of end credits (FFEC) and the first frame of moving credits (FFMC). You should add these markers using the 'Markers' button in the DCP tab.")); } } diff --git a/src/lib/image.cc b/src/lib/image.cc index a31874e18..c0916df89 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -215,8 +215,8 @@ Image::crop_scale_window ( throw runtime_error (N_("Could not allocate SwsContext")); } - DCPOMATIC_ASSERT (yuv_to_rgb < dcp::YUV_TO_RGB_COUNT); - int const lut[dcp::YUV_TO_RGB_COUNT] = { + DCPOMATIC_ASSERT (yuv_to_rgb < dcp::YUVToRGB::COUNT); + int const lut[static_cast(dcp::YUVToRGB::COUNT)] = { SWS_CS_ITU601, SWS_CS_ITU709 }; @@ -234,8 +234,8 @@ Image::crop_scale_window ( */ sws_setColorspaceDetails ( scale_context, - sws_getCoefficients (lut[yuv_to_rgb]), video_range == VIDEO_RANGE_VIDEO ? 0 : 1, - sws_getCoefficients (lut[yuv_to_rgb]), out_video_range == VIDEO_RANGE_VIDEO ? 0 : 1, + sws_getCoefficients (lut[static_cast(yuv_to_rgb)]), video_range == VIDEO_RANGE_VIDEO ? 0 : 1, + sws_getCoefficients (lut[static_cast(yuv_to_rgb)]), out_video_range == VIDEO_RANGE_VIDEO ? 0 : 1, 0, 1 << 16, 1 << 16 ); @@ -312,8 +312,8 @@ Image::scale (dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_fo (fast ? SWS_FAST_BILINEAR : SWS_BICUBIC) | SWS_ACCURATE_RND, 0, 0, 0 ); - DCPOMATIC_ASSERT (yuv_to_rgb < dcp::YUV_TO_RGB_COUNT); - int const lut[dcp::YUV_TO_RGB_COUNT] = { + DCPOMATIC_ASSERT (yuv_to_rgb < dcp::YUVToRGB::COUNT); + int const lut[static_cast(dcp::YUVToRGB::COUNT)] = { SWS_CS_ITU601, SWS_CS_ITU709 }; @@ -331,8 +331,8 @@ Image::scale (dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_fo */ sws_setColorspaceDetails ( scale_context, - sws_getCoefficients (lut[yuv_to_rgb]), 0, - sws_getCoefficients (lut[yuv_to_rgb]), 0, + sws_getCoefficients (lut[static_cast(yuv_to_rgb)]), 0, + sws_getCoefficients (lut[static_cast(yuv_to_rgb)]), 0, 0, 1 << 16, 1 << 16 ); @@ -680,7 +680,7 @@ Image::alpha_blend (shared_ptr other, Position position) } case AV_PIX_FMT_YUV420P: { - shared_ptr yuv = other->convert_pixel_format (dcp::YUV_TO_RGB_REC709, _pixel_format, false, false); + shared_ptr yuv = other->convert_pixel_format (dcp::YUVToRGB::REC709, _pixel_format, false, false); dcp::Size const ts = size(); dcp::Size const os = yuv->size(); for (int ty = start_ty, oy = start_oy; ty < ts.height && oy < os.height; ++ty, ++oy) { @@ -715,7 +715,7 @@ Image::alpha_blend (shared_ptr other, Position position) } case AV_PIX_FMT_YUV420P10: { - shared_ptr yuv = other->convert_pixel_format (dcp::YUV_TO_RGB_REC709, _pixel_format, false, false); + shared_ptr yuv = other->convert_pixel_format (dcp::YUVToRGB::REC709, _pixel_format, false, false); dcp::Size const ts = size(); dcp::Size const os = yuv->size(); for (int ty = start_ty, oy = start_oy; ty < ts.height && oy < os.height; ++ty, ++oy) { @@ -750,7 +750,7 @@ Image::alpha_blend (shared_ptr other, Position position) } case AV_PIX_FMT_YUV422P10LE: { - shared_ptr yuv = other->convert_pixel_format (dcp::YUV_TO_RGB_REC709, _pixel_format, false, false); + shared_ptr yuv = other->convert_pixel_format (dcp::YUVToRGB::REC709, _pixel_format, false, false); dcp::Size const ts = size(); dcp::Size const os = yuv->size(); for (int ty = start_ty, oy = start_oy; ty < ts.height && oy < os.height; ++ty, ++oy) { @@ -1333,7 +1333,7 @@ Image::as_png () const DCPOMATIC_ASSERT (bytes_per_pixel(0) == 4); DCPOMATIC_ASSERT (planes() == 1); if (pixel_format() != AV_PIX_FMT_RGBA) { - return convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGBA, true, false)->as_png(); + return convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, true, false)->as_png(); } /* error handling? */ diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc index 13305b7f3..98b859529 100644 --- a/src/lib/j2k_image_proxy.cc +++ b/src/lib/j2k_image_proxy.cc @@ -85,7 +85,7 @@ J2KImageProxy::J2KImageProxy ( AVPixelFormat pixel_format, optional forced_reduction ) - : _data (eye ? frame->left() : frame->right()) + : _data (eye == dcp::Eye::LEFT ? frame->left() : frame->right()) , _size (size) , _eye (eye) , _pixel_format (pixel_format) diff --git a/src/lib/log.cc b/src/lib/log.cc index e1716f1c6..f84cfd3a5 100644 --- a/src/lib/log.cc +++ b/src/lib/log.cc @@ -31,9 +31,12 @@ #include "i18n.h" + using std::string; using std::cout; using std::shared_ptr; +using std::make_shared; + Log::Log () : _types (0) @@ -63,7 +66,7 @@ Log::log (string message, int type) return; } - shared_ptr e (new StringLogEntry (type, message)); + auto e = make_shared(type, message); do_log (e); } @@ -72,14 +75,14 @@ void Log::dcp_log (dcp::NoteType type, string m) { switch (type) { - case dcp::DCP_PROGRESS: - do_log (shared_ptr (new StringLogEntry (LogEntry::TYPE_GENERAL, m))); + case dcp::NoteType::PROGRESS: + do_log (make_shared(LogEntry::TYPE_GENERAL, m)); break; - case dcp::DCP_ERROR: - do_log (shared_ptr (new StringLogEntry (LogEntry::TYPE_ERROR, m))); + case dcp::NoteType::ERROR: + do_log (make_shared(LogEntry::TYPE_ERROR, m)); break; - case dcp::DCP_NOTE: - do_log (shared_ptr (new StringLogEntry (LogEntry::TYPE_WARNING, m))); + case dcp::NoteType::NOTE: + do_log (make_shared(LogEntry::TYPE_WARNING, m)); break; } } diff --git a/src/lib/player.cc b/src/lib/player.cc index 503452b59..5b449ccc1 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -1011,7 +1011,7 @@ Player::bitmap_text_start (weak_ptr wp, weak_ptr wc, C } dcp::Size scaled_size (width, height); - ps.bitmap.push_back (BitmapText(image->scale(scaled_size, dcp::YUV_TO_RGB_REC601, image->pixel_format(), true, _fast), subtitle.sub.rectangle)); + ps.bitmap.push_back (BitmapText(image->scale(scaled_size, dcp::YUVToRGB::REC601, image->pixel_format(), true, _fast), subtitle.sub.rectangle)); DCPTime from (content_time_to_dcp (piece, subtitle.from())); _active_texts[text->type()].add_from (wc, ps, from); diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index 683fc27fc..ce552f20f 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -166,7 +166,7 @@ PlayerVideo::make_image (function pixel_format, V total_crop.bottom /= r; } - dcp::YUVToRGB yuv_to_rgb = dcp::YUV_TO_RGB_REC601; + dcp::YUVToRGB yuv_to_rgb = dcp::YUVToRGB::REC601; if (_colour_conversion) { yuv_to_rgb = _colour_conversion.get().yuv_to_rgb(); } diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 8be31d09b..1d2ec557f 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -114,7 +114,7 @@ ReelWriter::ReelWriter ( output. We will hard-link it into the DCP later. */ - dcp::Standard const standard = film()->interop() ? dcp::INTEROP : dcp::SMPTE; + dcp::Standard const standard = film()->interop() ? dcp::Standard::INTEROP : dcp::Standard::SMPTE; boost::filesystem::path const asset = film()->internal_video_asset_dir() / film()->internal_video_asset_filename(_period); @@ -861,7 +861,7 @@ ReelWriter::write (PlayerText subs, TextType type, optional track, i.image->as_png(), dcp::Time(period.from.seconds() - _period.from.seconds(), film()->video_frame_rate()), dcp::Time(period.to.seconds() - _period.from.seconds(), film()->video_frame_rate()), - i.rectangle.x, dcp::HALIGN_LEFT, i.rectangle.y, dcp::VALIGN_TOP, + i.rectangle.x, dcp::HAlign::LEFT, i.rectangle.y, dcp::VAlign::TOP, dcp::Time(), dcp::Time() ) ) diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 3dc1e9ff0..2272d3506 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -224,15 +224,15 @@ x_position (StringText const& first, int target_width, int layout_width) { int x = 0; switch (first.h_align ()) { - case dcp::HALIGN_LEFT: + case dcp::HAlign::LEFT: /* h_position is distance between left of frame and left of subtitle */ x = first.h_position() * target_width; break; - case dcp::HALIGN_CENTER: + case dcp::HAlign::CENTER: /* h_position is distance between centre of frame and centre of subtitle */ x = (0.5 + first.h_position()) * target_width - layout_width / 2; break; - case dcp::HALIGN_RIGHT: + case dcp::HAlign::RIGHT: /* h_position is distance between right of frame and right of subtitle */ x = (1.0 - first.h_position()) * target_width - layout_width; break; @@ -248,20 +248,20 @@ y_position (StringText const& first, int target_height, int layout_height) { int y = 0; switch (first.v_align ()) { - case dcp::VALIGN_TOP: + case dcp::VAlign::TOP: /* SMPTE says that v_position is the distance between top of frame and top of subtitle, but this doesn't always seem to be the case in practice; Gunnar Ásgeirsson's Dolby server appears - to put VALIGN_TOP subs with v_position as the distance between top + to put VAlign::TOP subs with v_position as the distance between top of frame and bottom of subtitle. */ y = first.v_position() * target_height - layout_height; break; - case dcp::VALIGN_CENTER: + case dcp::VAlign::CENTER: /* v_position is distance between centre of frame and centre of subtitle */ y = (0.5 + first.v_position()) * target_height - layout_height / 2; break; - case dcp::VALIGN_BOTTOM: + case dcp::VAlign::BOTTOM: /* v_position is distance between bottom of frame and bottom of subtitle */ y = (1.0 - first.v_position()) * target_height - layout_height; break; @@ -333,7 +333,7 @@ render_line (list subtitles, list > fonts, dcp::Siz } } - float const border_width = first.effect() == dcp::BORDER ? (first.outline_width * target.width / 2048.0) : 0; + float const border_width = first.effect() == dcp::Effect::BORDER ? (first.outline_width * target.width / 2048.0) : 0; size.width += 2 * ceil (border_width); size.height += 2 * ceil (border_width); @@ -356,7 +356,7 @@ render_line (list subtitles, list > fonts, dcp::Siz context->scale (x_scale, y_scale); layout->update_from_cairo_context (context); - if (first.effect() == dcp::SHADOW) { + if (first.effect() == dcp::Effect::SHADOW) { /* Drop-shadow effect */ set_source_rgba (context, first.effect_colour(), fade_factor); context->move_to (x_offset + 4, y_offset + 4); @@ -364,7 +364,7 @@ render_line (list subtitles, list > fonts, dcp::Siz context->fill (); } - if (first.effect() == dcp::BORDER) { + if (first.effect() == dcp::Effect::BORDER) { /* Border effect */ set_source_rgba (context, first.effect_colour(), fade_factor); context->set_line_width (border_width); diff --git a/src/lib/spl_entry.cc b/src/lib/spl_entry.cc index 083ce0296..440f9861b 100644 --- a/src/lib/spl_entry.cc +++ b/src/lib/spl_entry.cc @@ -44,11 +44,11 @@ SPLEntry::construct (shared_ptr c) name = dcp->name (); DCPOMATIC_ASSERT (dcp->cpl()); id = *dcp->cpl(); - kind = dcp->content_kind().get_value_or(dcp::FEATURE); + kind = dcp->content_kind().get_value_or(dcp::ContentKind::FEATURE); encrypted = dcp->encrypted (); } else { name = content->path(0).filename().string(); - kind = dcp::FEATURE; + kind = dcp::ContentKind::FEATURE; } } diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index a9ed86083..86fd85b68 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -144,21 +144,21 @@ TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version) } if (node->optional_bool_child("Outline").get_value_or(false)) { - _effect = dcp::BORDER; + _effect = dcp::Effect::BORDER; } else if (node->optional_bool_child("Shadow").get_value_or(false)) { - _effect = dcp::SHADOW; + _effect = dcp::Effect::SHADOW; } else { - _effect = dcp::NONE; + _effect = dcp::Effect::NONE; } auto effect = node->optional_string_child("Effect"); if (effect) { if (*effect == "none") { - _effect = dcp::NONE; + _effect = dcp::Effect::NONE; } else if (*effect == "outline") { - _effect = dcp::BORDER; + _effect = dcp::Effect::BORDER; } else if (*effect == "shadow") { - _effect = dcp::SHADOW; + _effect = dcp::Effect::SHADOW; } } @@ -341,13 +341,13 @@ TextContent::as_xml (xmlpp::Node* root) const } if (_effect) { switch (*_effect) { - case dcp::NONE: + case dcp::Effect::NONE: text->add_child("Effect")->add_child_text("none"); break; - case dcp::BORDER: + case dcp::Effect::BORDER: text->add_child("Effect")->add_child_text("outline"); break; - case dcp::SHADOW: + case dcp::Effect::SHADOW: text->add_child("Effect")->add_child_text("shadow"); break; } @@ -389,7 +389,7 @@ TextContent::identifier () const + "_" + raw_convert (fade_out().get_value_or(ContentTime()).get()) + "_" + raw_convert (outline_width()) + "_" + raw_convert (colour().get_value_or(dcp::Colour(255, 255, 255)).to_argb_string()) - + "_" + raw_convert (dcp::effect_to_string(effect().get_value_or(dcp::NONE))) + + "_" + raw_convert (dcp::effect_to_string(effect().get_value_or(dcp::Effect::NONE))) + "_" + raw_convert (effect_colour().get_value_or(dcp::Colour(0, 0, 0)).to_argb_string()) + "_" + raw_convert (_parent->video_frame_rate().get_value_or(0)); diff --git a/src/lib/text_decoder.cc b/src/lib/text_decoder.cc index a2241c50b..099e3ee74 100644 --- a/src/lib/text_decoder.cc +++ b/src/lib/text_decoder.cc @@ -147,16 +147,16 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) v_position = 1.015 - (1 + bottom_line.get() - i.vertical_position.line.get()) * multiplier; - v_align = dcp::VALIGN_TOP; + v_align = dcp::VAlign::TOP; break; case sub::TOP_OF_SCREEN: /* This 0.1 is another fudge factor to bring the top line away from the top of the screen a little */ v_position = 0.12 + i.vertical_position.line.get() * multiplier; - v_align = dcp::VALIGN_TOP; + v_align = dcp::VAlign::TOP; break; case sub::VERTICAL_CENTRE_OF_SCREEN: v_position = i.vertical_position.line.get() * multiplier; - v_align = dcp::VALIGN_CENTER; + v_align = dcp::VAlign::CENTER; break; } } else { @@ -176,16 +176,16 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) switch (i.vertical_position.reference.get()) { case sub::TOP_OF_SCREEN: - v_align = dcp::VALIGN_TOP; + v_align = dcp::VAlign::TOP; break; case sub::VERTICAL_CENTRE_OF_SCREEN: - v_align = dcp::VALIGN_CENTER; + v_align = dcp::VAlign::CENTER; break; case sub::BOTTOM_OF_SCREEN: - v_align = dcp::VALIGN_BOTTOM; + v_align = dcp::VAlign::BOTTOM; break; default: - v_align = dcp::VALIGN_TOP; + v_align = dcp::VAlign::TOP; break; } } @@ -194,18 +194,18 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) float h_position = i.horizontal_position.proportional; switch (i.horizontal_position.reference) { case sub::LEFT_OF_SCREEN: - h_align = dcp::HALIGN_LEFT; + h_align = dcp::HAlign::LEFT; h_position = max(h_position, 0.05f); break; case sub::HORIZONTAL_CENTRE_OF_SCREEN: - h_align = dcp::HALIGN_CENTER; + h_align = dcp::HAlign::CENTER; break; case sub::RIGHT_OF_SCREEN: - h_align = dcp::HALIGN_RIGHT; + h_align = dcp::HAlign::RIGHT; h_position = max(h_position, 0.05f); break; default: - h_align = dcp::HALIGN_CENTER; + h_align = dcp::HAlign::CENTER; break; } @@ -230,9 +230,9 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) h_align, v_position, v_align, - dcp::DIRECTION_LTR, + dcp::Direction::LTR, j.text, - dcp::NONE, + dcp::Effect::NONE, j.effect_colour.get_value_or(sub::Colour(0, 0, 0)).dcp(), /* Hack: we should use subtitle.fade_up and subtitle.fade_down here but the times of these often don't have a frame rate associated diff --git a/src/lib/types.cc b/src/lib/types.cc index 9aba915e8..ac7920a2c 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -201,7 +201,7 @@ CPLSummary::CPLSummary (boost::filesystem::path p) vector notes; dcp.read (¬es); for (auto i: notes) { - if (i.code() != dcp::VerificationNote::EXTERNAL_ASSET) { + if (i.code() != dcp::VerificationNote::Code::EXTERNAL_ASSET) { /* It's not just a warning about this DCP being a VF */ throw dcp::ReadError(dcp::note_to_string(i)); } diff --git a/src/lib/util.cc b/src/lib/util.cc index 0aa7e7a28..78fac8b3a 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -395,7 +395,7 @@ DCPOMATIC_ENABLE_WARNINGS /* Render something to fontconfig to create its cache */ list subs; dcp::SubtitleString ss( - optional(), false, false, false, dcp::Colour(), 42, 1, dcp::Time(), dcp::Time(), 0, dcp::HALIGN_CENTER, 0, dcp::VALIGN_CENTER, dcp::DIRECTION_LTR, + optional(), false, false, false, dcp::Colour(), 42, 1, dcp::Time(), dcp::Time(), 0, dcp::HAlign::CENTER, 0, dcp::VAlign::CENTER, dcp::DIRECTION_LTR, "Hello dolly", dcp::NONE, dcp::Colour(), dcp::Time(), dcp::Time() ); subs.push_back (StringText(ss, 0)); @@ -818,24 +818,24 @@ audio_channel_types (list mapped, int channels) } switch (static_cast(i)) { - case dcp::LFE: + case dcp::Channel::LFE: ++lfe; break; - case dcp::LEFT: - case dcp::RIGHT: - case dcp::CENTRE: - case dcp::LS: - case dcp::RS: - case dcp::BSL: - case dcp::BSR: + case dcp::Channel::LEFT: + case dcp::Channel::RIGHT: + case dcp::Channel::CENTRE: + case dcp::Channel::LS: + case dcp::Channel::RS: + case dcp::Channel::BSL: + case dcp::Channel::BSR: ++non_lfe; break; - case dcp::HI: - case dcp::VI: - case dcp::MOTION_DATA: - case dcp::SYNC_SIGNAL: - case dcp::SIGN_LANGUAGE: - case dcp::CHANNEL_COUNT: + case dcp::Channel::HI: + case dcp::Channel::VI: + case dcp::Channel::MOTION_DATA: + case dcp::Channel::SYNC_SIGNAL: + case dcp::Channel::SIGN_LANGUAGE: + case dcp::Channel::CHANNEL_COUNT: break; } } @@ -853,12 +853,12 @@ remap (shared_ptr input, int output_channels, AudioMapping m for (int i = 0; i < to_do; ++i) { for (int j = 0; j < mapped->channels(); ++j) { - if (map.get (i, static_cast (j)) > 0) { - mapped->accumulate_channel ( + if (map.get(i, j) > 0) { + mapped->accumulate_channel( input.get(), i, - static_cast (j), - map.get (i, static_cast (j)) + j, + map.get(i, j) ); } } @@ -962,25 +962,25 @@ emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size /* add in position */ switch (sub.h_align()) { - case dcp::HALIGN_LEFT: + case dcp::HAlign::LEFT: rect.x += sub.h_position(); break; - case dcp::HALIGN_CENTER: + case dcp::HAlign::CENTER: rect.x += 0.5 + sub.h_position() - rect.width / 2; break; - case dcp::HALIGN_RIGHT: + case dcp::HAlign::RIGHT: rect.x += 1 - sub.h_position() - rect.width; break; } switch (sub.v_align()) { - case dcp::VALIGN_TOP: + case dcp::VAlign::TOP: rect.y += sub.v_position(); break; - case dcp::VALIGN_CENTER: + case dcp::VAlign::CENTER: rect.y += 0.5 + sub.v_position() - rect.height / 2; break; - case dcp::VALIGN_BOTTOM: + case dcp::VAlign::BOTTOM: rect.y += 1 - sub.v_position() - rect.height; break; } diff --git a/src/lib/verify_dcp_job.cc b/src/lib/verify_dcp_job.cc index bbcce7208..bd5634669 100644 --- a/src/lib/verify_dcp_job.cc +++ b/src/lib/verify_dcp_job.cc @@ -72,7 +72,7 @@ VerifyDCPJob::run () bool failed = false; for (auto i: _notes) { - if (i.type() == dcp::VerificationNote::VERIFY_ERROR) { + if (i.type() == dcp::VerificationNote::Type::ERROR) { failed = true; } } diff --git a/src/lib/video_mxf_decoder.cc b/src/lib/video_mxf_decoder.cc index d2b057972..6e194a6df 100644 --- a/src/lib/video_mxf_decoder.cc +++ b/src/lib/video_mxf_decoder.cc @@ -92,14 +92,14 @@ VideoMXFDecoder::pass () video->emit ( film(), shared_ptr ( - new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::EYE_LEFT, AV_PIX_FMT_XYZ12LE, optional()) + new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::Eye::LEFT, AV_PIX_FMT_XYZ12LE, optional()) ), frame ); video->emit ( film(), shared_ptr ( - new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::EYE_RIGHT, AV_PIX_FMT_XYZ12LE, optional()) + new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::Eye::RIGHT, AV_PIX_FMT_XYZ12LE, optional()) ), frame ); diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 8c5a82415..a67430d61 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -623,15 +623,15 @@ Writer::finish (boost::filesystem::path output_dcp) cpl->set_facility (film()->facility()); cpl->set_luminance (film()->luminance()); - list ac = film()->mapped_audio_channels(); + auto ac = film()->mapped_audio_channels(); dcp::MCASoundField field = ( - find(ac.begin(), ac.end(), static_cast(dcp::BSL)) != ac.end() || - find(ac.begin(), ac.end(), static_cast(dcp::BSR)) != ac.end() - ) ? dcp::SEVEN_POINT_ONE : dcp::FIVE_POINT_ONE; + find(ac.begin(), ac.end(), static_cast(dcp::Channel::BSL)) != ac.end() || + find(ac.begin(), ac.end(), static_cast(dcp::Channel::BSR)) != ac.end() + ) ? dcp::MCASoundField::SEVEN_POINT_ONE : dcp::MCASoundField::FIVE_POINT_ONE; dcp::MainSoundConfiguration msc (field, film()->audio_channels()); for (auto i: ac) { - if (i < film()->audio_channels()) { + if (static_cast(i) < film()->audio_channels()) { msc.set_mapping (i, static_cast(i)); } } @@ -655,7 +655,7 @@ Writer::finish (boost::filesystem::path output_dcp) } dcp.write_xml ( - film()->interop() ? dcp::INTEROP : dcp::SMPTE, + film()->interop() ? dcp::Standard::INTEROP : dcp::Standard::SMPTE, issuer, creator, dcp::LocalTime().as_string(), diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 0db26566a..78466d25b 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -939,7 +939,7 @@ private: vector(), d->cpl (), from, to, - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0 ); diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 1d3387f18..a2d5c8e5d 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -99,7 +99,7 @@ main (int argc, char* argv[]) film->set_container (cc.container_ratio); } film->set_dcp_content_type (cc.dcp_content_type); - film->set_interop (cc.standard == dcp::INTEROP); + film->set_interop (cc.standard == dcp::Standard::INTEROP); film->set_use_isdcf_name (!cc.no_use_isdcf_name); film->set_encrypted (cc.encrypt); film->set_three_d (cc.threed); diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index d0ee0cad9..f21772a4d 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -407,7 +407,7 @@ int main (int argc, char* argv[]) bool list_dkdm_cpls = false; optional duration_string; bool verbose = false; - dcp::Formulation formulation = dcp::MODIFIED_TRANSITIONAL_1; + dcp::Formulation formulation = dcp::Formulation::MODIFIED_TRANSITIONAL_1; bool disable_forensic_marking_picture = false; optional disable_forensic_marking_audio; @@ -467,13 +467,13 @@ int main (int argc, char* argv[]) break; case 'F': if (string (optarg) == "modified-transitional-1") { - formulation = dcp::MODIFIED_TRANSITIONAL_1; + formulation = dcp::Formulation::MODIFIED_TRANSITIONAL_1; } else if (string (optarg) == "multiple-modified-transitional-1") { - formulation = dcp::MULTIPLE_MODIFIED_TRANSITIONAL_1; + formulation = dcp::Formulation::MULTIPLE_MODIFIED_TRANSITIONAL_1; } else if (string (optarg) == "dci-any") { - formulation = dcp::DCI_ANY; + formulation = dcp::Formulation::DCI_ANY; } else if (string (optarg) == "dci-specific") { - formulation = dcp::DCI_SPECIFIC; + formulation = dcp::Formulation::DCI_SPECIFIC; } else { error ("unrecognised KDM formulation " + string (optarg)); } diff --git a/src/wx/closed_captions_dialog.cc b/src/wx/closed_captions_dialog.cc index 4f34f0531..c23c2902b 100644 --- a/src/wx/closed_captions_dialog.cc +++ b/src/wx/closed_captions_dialog.cc @@ -134,11 +134,11 @@ private: float from_top (StringText const & c) const { switch (c.v_align()) { - case dcp::VALIGN_TOP: + case dcp::VAlign::TOP: return c.v_position(); - case dcp::VALIGN_CENTER: + case dcp::VAlign::CENTER: return c.v_position() + 0.5; - case dcp::VALIGN_BOTTOM: + case dcp::VAlign::BOTTOM: return 1.0 - c.v_position(); } DCPOMATIC_ASSERT (false); diff --git a/src/wx/colour_conversion_editor.cc b/src/wx/colour_conversion_editor.cc index 46bf77a8e..a615b666a 100644 --- a/src/wx/colour_conversion_editor.cc +++ b/src/wx/colour_conversion_editor.cc @@ -267,7 +267,7 @@ ColourConversionEditor::set (ColourConversion conversion) checked_set (_input, 2); } - _yuv_to_rgb->SetSelection (conversion.yuv_to_rgb ()); + _yuv_to_rgb->SetSelection (static_cast(conversion.yuv_to_rgb())); _ignore_chromaticity_changed = true; diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc index b002a765c..8c7f4007b 100644 --- a/src/wx/kdm_output_panel.cc +++ b/src/wx/kdm_output_panel.cc @@ -68,12 +68,12 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop) wxBoxSizer* type = new wxBoxSizer (wxHORIZONTAL); _type = new wxChoice (this, wxID_ANY); - _type->Append ("Modified Transitional 1", ((void *) dcp::MODIFIED_TRANSITIONAL_1)); - _type->Append ("Multiple Modified Transitional 1", ((void *) dcp::MULTIPLE_MODIFIED_TRANSITIONAL_1)); - _type->Append ("Modified Transitional 1 (without AuthorizedDeviceInfo)", ((void *) dcp::MODIFIED_TRANSITIONAL_TEST)); + _type->Append ("Modified Transitional 1", ((void *) dcp::Formulation::MODIFIED_TRANSITIONAL_1)); + _type->Append ("Multiple Modified Transitional 1", ((void *) dcp::Formulation::MULTIPLE_MODIFIED_TRANSITIONAL_1)); + _type->Append ("Modified Transitional 1 (without AuthorizedDeviceInfo)", ((void *) dcp::Formulation::MODIFIED_TRANSITIONAL_TEST)); if (!interop) { - _type->Append ("DCI Any", ((void *) dcp::DCI_ANY)); - _type->Append ("DCI Specific", ((void *) dcp::DCI_SPECIFIC)); + _type->Append ("DCI Any", ((void *) dcp::Formulation::DCI_ANY)); + _type->Append ("DCI Specific", ((void *) dcp::Formulation::DCI_SPECIFIC)); } type->Add (_type, 1, wxEXPAND); _type->SetSelection (0); diff --git a/src/wx/language_tag_dialog.cc b/src/wx/language_tag_dialog.cc index d9add6dca..e0f6ef883 100644 --- a/src/wx/language_tag_dialog.cc +++ b/src/wx/language_tag_dialog.cc @@ -205,7 +205,7 @@ LanguageTagDialog::LanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag) button_sizer->Add (_remove, 0, wxTOP | wxBOTTOM | wxEXPAND, 2); _choose_subtag_panel = new LanguageSubtagPanel (this); - _choose_subtag_panel->set (dcp::LanguageTag::LANGUAGE, ""); + _choose_subtag_panel->set (dcp::LanguageTag::SubtagType::LANGUAGE, ""); wxBoxSizer* ltor_sizer = new wxBoxSizer (wxHORIZONTAL); ltor_sizer->Add (_current_tag_list, 1, wxALL, 8); @@ -224,10 +224,10 @@ LanguageTagDialog::LanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag) set (tag); - _add_script->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SCRIPT, boost::optional())); - _add_region->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::REGION, boost::optional())); - _add_variant->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::VARIANT, boost::optional())); - _add_external->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::EXTLANG, boost::optional())); + _add_script->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::SCRIPT, boost::optional())); + _add_region->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::REGION, boost::optional())); + _add_variant->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::VARIANT, boost::optional())); + _add_external->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::add_to_current_tag, this, dcp::LanguageTag::SubtagType::EXTLANG, boost::optional())); _remove->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagDialog::remove_from_current_tag, this)); _choose_subtag_panel->SelectionChanged.connect(bind(&LanguageTagDialog::chosen_subtag_changed, this, _1)); _choose_subtag_panel->SearchChanged.connect(bind(&LanguageTagDialog::search_changed, this, _1)); @@ -266,19 +266,19 @@ dcp::LanguageTag LanguageTagDialog::get () const continue; } switch (i.type) { - case dcp::LanguageTag::LANGUAGE: + case dcp::LanguageTag::SubtagType::LANGUAGE: tag.set_language (i.subtag->subtag); break; - case dcp::LanguageTag::SCRIPT: + case dcp::LanguageTag::SubtagType::SCRIPT: tag.set_script (i.subtag->subtag); break; - case dcp::LanguageTag::REGION: + case dcp::LanguageTag::SubtagType::REGION: tag.set_region (i.subtag->subtag); break; - case dcp::LanguageTag::VARIANT: + case dcp::LanguageTag::SubtagType::VARIANT: variants.push_back (i.subtag->subtag); break; - case dcp::LanguageTag::EXTLANG: + case dcp::LanguageTag::SubtagType::EXTLANG: extlangs.push_back (i.subtag->subtag); break; } @@ -297,16 +297,15 @@ LanguageTagDialog::set (dcp::LanguageTag tag) _current_tag_list->DeleteAllItems (); bool have_language = false; - vector > subtags = tag.subtags(); - for (vector >::const_iterator i = subtags.begin(); i != subtags.end(); ++i) { - add_to_current_tag (i->first, i->second); - if (i->first == dcp::LanguageTag::LANGUAGE) { + for (auto const& i: tag.subtags()) { + add_to_current_tag (i.first, i.second); + if (i.first == dcp::LanguageTag::SubtagType::LANGUAGE) { have_language = true; } } if (!have_language) { - add_to_current_tag (dcp::LanguageTag::LANGUAGE, dcp::LanguageTag::SubtagData("en", "English")); + add_to_current_tag (dcp::LanguageTag::SubtagType::LANGUAGE, dcp::LanguageTag::SubtagData("en", "English")); } } @@ -314,15 +313,15 @@ LanguageTagDialog::set (dcp::LanguageTag tag) string LanguageTagDialog::subtag_type_name (dcp::LanguageTag::SubtagType type) { switch (type) { - case dcp::LanguageTag::LANGUAGE: + case dcp::LanguageTag::SubtagType::LANGUAGE: return "Language"; - case dcp::LanguageTag::SCRIPT: + case dcp::LanguageTag::SubtagType::SCRIPT: return "Script"; - case dcp::LanguageTag::REGION: + case dcp::LanguageTag::SubtagType::REGION: return "Region"; - case dcp::LanguageTag::VARIANT: + case dcp::LanguageTag::SubtagType::VARIANT: return "Variant"; - case dcp::LanguageTag::EXTLANG: + case dcp::LanguageTag::SubtagType::EXTLANG: return "External"; } @@ -402,16 +401,16 @@ LanguageTagDialog::setup_sensitivity () _add_external->Enable (); for (auto const& i: _current_tag_subtags) { switch (i.type) { - case dcp::LanguageTag::SCRIPT: + case dcp::LanguageTag::SubtagType::SCRIPT: _add_script->Enable (false); break; - case dcp::LanguageTag::REGION: + case dcp::LanguageTag::SubtagType::REGION: _add_region->Enable (false); break; - case dcp::LanguageTag::VARIANT: + case dcp::LanguageTag::SubtagType::VARIANT: _add_variant->Enable (false); break; - case dcp::LanguageTag::EXTLANG: + case dcp::LanguageTag::SubtagType::EXTLANG: _add_external->Enable (false); break; default: @@ -437,7 +436,7 @@ RegionSubtagDialog::RegionSubtagDialog (wxWindow* parent, dcp::LanguageTag::Regi SetSizer (sizer); - _panel->set (dcp::LanguageTag::REGION, "", *dcp::LanguageTag::get_subtag_data(region)); + _panel->set (dcp::LanguageTag::SubtagType::REGION, "", *dcp::LanguageTag::get_subtag_data(region)); } diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc index c44e38146..772250701 100644 --- a/src/wx/smpte_metadata_dialog.cc +++ b/src/wx/smpte_metadata_dialog.cc @@ -269,18 +269,18 @@ SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property) if (property == Film::NAME_LANGUAGE) { _name_language->set (film()->name_language()); } else if (property == Film::RELEASE_TERRITORY) { - checked_set (_release_territory, std_to_wx(*dcp::LanguageTag::get_subtag_description(dcp::LanguageTag::REGION, film()->release_territory().subtag()))); + checked_set (_release_territory, std_to_wx(*dcp::LanguageTag::get_subtag_description(dcp::LanguageTag::SubtagType::REGION, film()->release_territory().subtag()))); } else if (property == Film::VERSION_NUMBER) { checked_set (_version_number, film()->version_number()); } else if (property == Film::STATUS) { switch (film()->status()) { - case dcp::TEMP: + case dcp::Status::TEMP: checked_set (_status, 0); break; - case dcp::PRE: + case dcp::Status::PRE: checked_set (_status, 1); break; - case dcp::FINAL: + case dcp::Status::FINAL: checked_set (_status, 2); break; } @@ -293,10 +293,10 @@ SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property) } else if (property == Film::LUMINANCE) { checked_set (_luminance_value, film()->luminance().value()); switch (film()->luminance().unit()) { - case dcp::Luminance::CANDELA_PER_SQUARE_METRE: + case dcp::Luminance::Unit::CANDELA_PER_SQUARE_METRE: checked_set (_luminance_unit, 0); break; - case dcp::Luminance::FOOT_LAMBERT: + case dcp::Luminance::Unit::FOOT_LAMBERT: checked_set (_luminance_unit, 1); break; } @@ -379,13 +379,13 @@ SMPTEMetadataDialog::status_changed () { switch (_status->GetSelection()) { case 0: - film()->set_status (dcp::TEMP); + film()->set_status(dcp::Status::TEMP); break; case 1: - film()->set_status (dcp::PRE); + film()->set_status(dcp::Status::PRE); break; case 2: - film()->set_status (dcp::FINAL); + film()->set_status(dcp::Status::FINAL); break; } } @@ -418,10 +418,10 @@ SMPTEMetadataDialog::luminance_changed () dcp::Luminance::Unit unit; switch (_luminance_unit->GetSelection()) { case 0: - unit = dcp::Luminance::CANDELA_PER_SQUARE_METRE; + unit = dcp::Luminance::Unit::CANDELA_PER_SQUARE_METRE; break; case 1: - unit = dcp::Luminance::FOOT_LAMBERT; + unit = dcp::Luminance::Unit::FOOT_LAMBERT; break; default: DCPOMATIC_ASSERT (false); diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc index 69ee61966..e21093798 100644 --- a/src/wx/subtitle_appearance_dialog.cc +++ b/src/wx/subtitle_appearance_dialog.cc @@ -160,13 +160,13 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr _force_effect->SetValue (static_cast(effect)); if (effect) { switch (*effect) { - case dcp::NONE: + case dcp::Effect::NONE: _effect->SetSelection (NONE); break; - case dcp::BORDER: + case dcp::Effect::BORDER: _effect->SetSelection (OUTLINE); break; - case dcp::SHADOW: + case dcp::Effect::SHADOW: _effect->SetSelection (SHADOW); break; } @@ -245,13 +245,13 @@ SubtitleAppearanceDialog::apply () if (_force_effect->GetValue()) { switch (_effect->GetSelection()) { case NONE: - _caption->set_effect (dcp::NONE); + _caption->set_effect (dcp::Effect::NONE); break; case OUTLINE: - _caption->set_effect (dcp::BORDER); + _caption->set_effect (dcp::Effect::BORDER); break; case SHADOW: - _caption->set_effect (dcp::SHADOW); + _caption->set_effect (dcp::Effect::SHADOW); break; } } else { diff --git a/src/wx/verify_dcp_dialog.cc b/src/wx/verify_dcp_dialog.cc index 50fd4be0c..604327ebd 100644 --- a/src/wx/verify_dcp_dialog.cc +++ b/src/wx/verify_dcp_dialog.cc @@ -42,12 +42,12 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr job sizer->Add (notebook, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); map pages; - pages[dcp::VerificationNote::VERIFY_ERROR] = new wxRichTextCtrl (notebook, wxID_ANY, wxEmptyString, wxDefaultPosition, {400, 300}, wxRE_READONLY); - notebook->AddPage (pages[dcp::VerificationNote::VERIFY_ERROR], _("Errors")); - pages[dcp::VerificationNote::VERIFY_BV21_ERROR] = new wxRichTextCtrl (notebook, wxID_ANY, wxEmptyString, wxDefaultPosition, {400, 300}, wxRE_READONLY); - notebook->AddPage (pages[dcp::VerificationNote::VERIFY_BV21_ERROR], _("SMPTE Bv2.1 errors")); - pages[dcp::VerificationNote::VERIFY_WARNING] = new wxRichTextCtrl (notebook, wxID_ANY, wxEmptyString, wxDefaultPosition, {400, 300}, wxRE_READONLY); - notebook->AddPage (pages[dcp::VerificationNote::VERIFY_WARNING], _("Warnings")); + pages[dcp::VerificationNote::Type::ERROR] = new wxRichTextCtrl (notebook, wxID_ANY, wxEmptyString, wxDefaultPosition, {400, 300}, wxRE_READONLY); + notebook->AddPage (pages[dcp::VerificationNote::Type::ERROR], _("Errors")); + pages[dcp::VerificationNote::Type::BV21_ERROR] = new wxRichTextCtrl (notebook, wxID_ANY, wxEmptyString, wxDefaultPosition, {400, 300}, wxRE_READONLY); + notebook->AddPage (pages[dcp::VerificationNote::Type::BV21_ERROR], _("SMPTE Bv2.1 errors")); + pages[dcp::VerificationNote::Type::WARNING] = new wxRichTextCtrl (notebook, wxID_ANY, wxEmptyString, wxDefaultPosition, {400, 300}, wxRE_READONLY); + notebook->AddPage (pages[dcp::VerificationNote::Type::WARNING], _("Warnings")); auto summary = new wxStaticText (this, wxID_ANY, wxT("")); sizer->Add (summary, 0, wxALL, DCPOMATIC_DIALOG_BORDER); @@ -71,9 +71,9 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr job } map counts; - counts[dcp::VerificationNote::VERIFY_WARNING] = 0; - counts[dcp::VerificationNote::VERIFY_BV21_ERROR] = 0; - counts[dcp::VerificationNote::VERIFY_ERROR] = 0; + counts[dcp::VerificationNote::Type::WARNING] = 0; + counts[dcp::VerificationNote::Type::BV21_ERROR] = 0; + counts[dcp::VerificationNote::Type::ERROR] = 0; auto add_bullet = [&pages](dcp::VerificationNote::Type type, wxString message) { pages[type]->BeginStandardBullet(N_("standard/diamond"), 1, 50); @@ -98,202 +98,202 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr job if (job->finished_in_error() && job->error_summary() != "") { /* We have an error that did not come from dcp::verify */ - add_bullet (dcp::VerificationNote::VERIFY_ERROR, std_to_wx(job->error_summary())); + add_bullet (dcp::VerificationNote::Type::ERROR, std_to_wx(job->error_summary())); } for (auto i: job->notes()) { switch (i.code()) { - case dcp::VerificationNote::FAILED_READ: + case dcp::VerificationNote::Code::FAILED_READ: add (i, std_to_wx(*i.note())); break; - case dcp::VerificationNote::MISMATCHED_CPL_HASHES: + case dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES: add(i, _("The hash of the CPL %n in the PKL does not agree with the CPL file. This probably means that the CPL file is corrupt.")); break; - case dcp::VerificationNote::INVALID_PICTURE_FRAME_RATE: + case dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE: add(i, _("The picture in a reel has a frame rate of %n, which is not valid.")); break; - case dcp::VerificationNote::INCORRECT_PICTURE_HASH: + case dcp::VerificationNote::Code::INCORRECT_PICTURE_HASH: add(i, _("The hash of the picture asset %f does not agree with the PKL file. This probably means that the asset file is corrupt.")); break; - case dcp::VerificationNote::MISMATCHED_PICTURE_HASHES: + case dcp::VerificationNote::Code::MISMATCHED_PICTURE_HASHES: add(i, _("The PKL and CPL hashes disagree for picture asset %f.")); break; - case dcp::VerificationNote::INCORRECT_SOUND_HASH: + case dcp::VerificationNote::Code::INCORRECT_SOUND_HASH: add(i, _("The hash of the sound asset %f does not agree with the PKL file. This probably means that the asset file is corrupt.")); break; - case dcp::VerificationNote::MISMATCHED_SOUND_HASHES: + case dcp::VerificationNote::Code::MISMATCHED_SOUND_HASHES: add(i, _("The PKL and CPL hashes disagree for sound asset %f.")); break; - case dcp::VerificationNote::EMPTY_ASSET_PATH: + case dcp::VerificationNote::Code::EMPTY_ASSET_PATH: add(i, _("An asset has an empty path in the ASSETMAP.")); break; - case dcp::VerificationNote::MISSING_ASSET: + case dcp::VerificationNote::Code::MISSING_ASSET: add(i, _("The asset %f is missing.")); break; - case dcp::VerificationNote::MISMATCHED_STANDARD: + case dcp::VerificationNote::Code::MISMATCHED_STANDARD: add(i, _("Parts of the DCP are written according to the Interop standard and parts according to SMPTE.")); break; - case dcp::VerificationNote::INVALID_XML: + case dcp::VerificationNote::Code::INVALID_XML: if (i.line()) { add(i, _("The XML in %f is malformed on line %l (%n).")); } else { add(i, _("The XML in %f is malformed (%n).")); } break; - case dcp::VerificationNote::MISSING_ASSETMAP: + case dcp::VerificationNote::Code::MISSING_ASSETMAP: add(i, _("No ASSETMAP or ASSETMAP.xml file was found.")); break; - case dcp::VerificationNote::INVALID_INTRINSIC_DURATION: + case dcp::VerificationNote::Code::INVALID_INTRINSIC_DURATION: add(i, _("The asset %n has an instrinsic duration of less than 1 second, which is invalid.")); break; - case dcp::VerificationNote::INVALID_DURATION: + case dcp::VerificationNote::Code::INVALID_DURATION: add(i, _("The asset %n has a duration of less than 1 second, which is invalid.")); break; - case dcp::VerificationNote::INVALID_PICTURE_FRAME_SIZE_IN_BYTES: + case dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES: add(i, _("At least one frame of the video asset %f is over the limit of 250Mbit/s.")); break; - case dcp::VerificationNote::NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES: + case dcp::VerificationNote::Code::NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES: add(i, _("At least one frame of the video asset %f is close to the limit of 250MBit/s.")); break; - case dcp::VerificationNote::EXTERNAL_ASSET: + case dcp::VerificationNote::Code::EXTERNAL_ASSET: add(i, _("This DCP refers to at the asset %n in another DCP (and perhaps others), so it is a \"version file\" (VF)")); break; - case dcp::VerificationNote::INVALID_STANDARD: + case dcp::VerificationNote::Code::INVALID_STANDARD: add(i, _("This DCP uses the Interop standard, but it should be made with SMPTE.")); break; - case dcp::VerificationNote::INVALID_LANGUAGE: + case dcp::VerificationNote::Code::INVALID_LANGUAGE: add(i, _("The invalid language tag %n is used.")); break; - case dcp::VerificationNote::INVALID_PICTURE_SIZE_IN_PIXELS: + case dcp::VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS: add(i, _("The video asset %f uses the invalid image size %n.")); break; - case dcp::VerificationNote::INVALID_PICTURE_FRAME_RATE_FOR_2K: + case dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K: add(i, _("The video asset %f uses the invalid frame rate %n.")); break; - case dcp::VerificationNote::INVALID_PICTURE_FRAME_RATE_FOR_4K: + case dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_4K: add(i, _("The video asset %f uses the frame rate %n which is invalid for 4K video.")); break; - case dcp::VerificationNote::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D: + case dcp::VerificationNote::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D: add(i, _("The video asset %f uses the frame rate %n which is invalid for 3D video.")); break; - case dcp::VerificationNote::INVALID_CLOSED_CAPTION_XML_SIZE_IN_BYTES: + case dcp::VerificationNote::Code::INVALID_CLOSED_CAPTION_XML_SIZE_IN_BYTES: add(i, _("The XML in the closed caption asset %f takes up %n bytes which is over the 256KB limit.")); break; - case dcp::VerificationNote::INVALID_TIMED_TEXT_SIZE_IN_BYTES: + case dcp::VerificationNote::Code::INVALID_TIMED_TEXT_SIZE_IN_BYTES: add(i, _("The timed text asset %f takes up %n bytes which is over the 115MB limit.")); break; - case dcp::VerificationNote::INVALID_TIMED_TEXT_FONT_SIZE_IN_BYTES: + case dcp::VerificationNote::Code::INVALID_TIMED_TEXT_FONT_SIZE_IN_BYTES: add(i, _("The fonts in the timed text asset %f take up %n bytes which is over the 10MB limit.")); break; - case dcp::VerificationNote::MISSING_SUBTITLE_LANGUAGE: + case dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE: add(i, _("The subtitle asset %f contains no tag.")); break; - case dcp::VerificationNote::MISMATCHED_SUBTITLE_LANGUAGES: + case dcp::VerificationNote::Code::MISMATCHED_SUBTITLE_LANGUAGES: add(i, _("Not all subtitle assets specify the same tag.")); break; - case dcp::VerificationNote::MISSING_SUBTITLE_START_TIME: + case dcp::VerificationNote::Code::MISSING_SUBTITLE_START_TIME: add(i, _("The subtitle asset %f contains no tag.")); break; - case dcp::VerificationNote::INVALID_SUBTITLE_START_TIME: + case dcp::VerificationNote::Code::INVALID_SUBTITLE_START_TIME: add(i, _("The subtitle asset %f has a which is not zero.")); break; - case dcp::VerificationNote::INVALID_SUBTITLE_FIRST_TEXT_TIME: + case dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME: add(i, _("The first subtitle or closed caption happens before 4s into the first reel.")); break; - case dcp::VerificationNote::INVALID_SUBTITLE_DURATION: + case dcp::VerificationNote::Code::INVALID_SUBTITLE_DURATION: add(i, _("At least one subtitle lasts less than 15 frames.")); break; - case dcp::VerificationNote::INVALID_SUBTITLE_SPACING: + case dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING: add(i, _("At least one pair of subtitles is separated by less than 2 frames.")); break; - case dcp::VerificationNote::INVALID_SUBTITLE_LINE_COUNT: + case dcp::VerificationNote::Code::INVALID_SUBTITLE_LINE_COUNT: add(i, _("There are more than 3 subtitle lines in at least one place.")); break; - case dcp::VerificationNote::NEARLY_INVALID_SUBTITLE_LINE_LENGTH: + case dcp::VerificationNote::Code::NEARLY_INVALID_SUBTITLE_LINE_LENGTH: add(i, _("There are more than 52 characters in at least one subtitle line.")); break; - case dcp::VerificationNote::INVALID_SUBTITLE_LINE_LENGTH: + case dcp::VerificationNote::Code::INVALID_SUBTITLE_LINE_LENGTH: add(i, _("There are more than 79 characters in at least one subtitle line.")); break; - case dcp::VerificationNote::INVALID_CLOSED_CAPTION_LINE_COUNT: + case dcp::VerificationNote::Code::INVALID_CLOSED_CAPTION_LINE_COUNT: add(i, _("There are more than 3 closed caption lines in at least one place.")); break; - case dcp::VerificationNote::INVALID_CLOSED_CAPTION_LINE_LENGTH: + case dcp::VerificationNote::Code::INVALID_CLOSED_CAPTION_LINE_LENGTH: add(i, _("There are more than 32 characters in at least one closed caption line.")); break; - case dcp::VerificationNote::INVALID_SOUND_FRAME_RATE: + case dcp::VerificationNote::Code::INVALID_SOUND_FRAME_RATE: add(i, _("The sound asset %f has an invalid frame rate of %n.")); break; - case dcp::VerificationNote::MISSING_CPL_ANNOTATION_TEXT: + case dcp::VerificationNote::Code::MISSING_CPL_ANNOTATION_TEXT: add(i, _("The CPL %n has no tag.")); break; - case dcp::VerificationNote::MISMATCHED_CPL_ANNOTATION_TEXT: + case dcp::VerificationNote::Code::MISMATCHED_CPL_ANNOTATION_TEXT: add(i, _("The CPL %n has an which is not the same as its .")); break; - case dcp::VerificationNote::MISMATCHED_ASSET_DURATION: + case dcp::VerificationNote::Code::MISMATCHED_ASSET_DURATION: add(i, _("At least one asset in a reel does not have the same duration as the others.")); break; - case dcp::VerificationNote::MISSING_MAIN_SUBTITLE_FROM_SOME_REELS: + case dcp::VerificationNote::Code::MISSING_MAIN_SUBTITLE_FROM_SOME_REELS: add(i, _("The DCP has subtitles but at least one reel has no subtitle asset.")); break; - case dcp::VerificationNote::MISMATCHED_CLOSED_CAPTION_ASSET_COUNTS: + case dcp::VerificationNote::Code::MISMATCHED_CLOSED_CAPTION_ASSET_COUNTS: add(i, _("The DCP has closed captions but not every reel has the same number of closed caption assets.")); break; - case dcp::VerificationNote::MISSING_SUBTITLE_ENTRY_POINT: + case dcp::VerificationNote::Code::MISSING_SUBTITLE_ENTRY_POINT: add(i, _("The subtitle asset %n has no tag.")); break; - case dcp::VerificationNote::INCORRECT_SUBTITLE_ENTRY_POINT: + case dcp::VerificationNote::Code::INCORRECT_SUBTITLE_ENTRY_POINT: add(i, _("Subtitle asset %n has a non-zero .")); break; - case dcp::VerificationNote::MISSING_CLOSED_CAPTION_ENTRY_POINT: + case dcp::VerificationNote::Code::MISSING_CLOSED_CAPTION_ENTRY_POINT: add(i, _("The closed caption asset %n has no tag.")); break; - case dcp::VerificationNote::INCORRECT_CLOSED_CAPTION_ENTRY_POINT: + case dcp::VerificationNote::Code::INCORRECT_CLOSED_CAPTION_ENTRY_POINT: add(i, _("Closed caption asset %n has a non-zero .")); break; - case dcp::VerificationNote::MISSING_HASH: + case dcp::VerificationNote::Code::MISSING_HASH: add(i, _("The asset %n has no in the CPL.")); break; - case dcp::VerificationNote::MISSING_FFEC_IN_FEATURE: + case dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE: add(i, _("The DCP is a feature but has no FFEC (first frame of end credits) marker.")); break; - case dcp::VerificationNote::MISSING_FFMC_IN_FEATURE: + case dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE: add(i, _("The DCP is a feature but has no FFMC (first frame of moving credits) marker.")); break; - case dcp::VerificationNote::MISSING_FFOC: + case dcp::VerificationNote::Code::MISSING_FFOC: add(i, _("The DCP has no FFOC (first frame of content) marker.")); break; - case dcp::VerificationNote::MISSING_LFOC: + case dcp::VerificationNote::Code::MISSING_LFOC: add(i, _("The DCP has no LFOC (last frame of content) marker.")); break; - case dcp::VerificationNote::INCORRECT_FFOC: + case dcp::VerificationNote::Code::INCORRECT_FFOC: add(i, _("The DCP has a FFOC of %n instead of 1.")); break; - case dcp::VerificationNote::INCORRECT_LFOC: + case dcp::VerificationNote::Code::INCORRECT_LFOC: add(i, _("The DCP has a LFOC of %n instead of the reel duration minus one.")); break; - case dcp::VerificationNote::MISSING_CPL_METADATA: + case dcp::VerificationNote::Code::MISSING_CPL_METADATA: add(i, _("The CPL %n has no CPL metadata tag.")); break; - case dcp::VerificationNote::MISSING_CPL_METADATA_VERSION_NUMBER: + case dcp::VerificationNote::Code::MISSING_CPL_METADATA_VERSION_NUMBER: add(i, _("The CPL %n has no CPL metadata version number tag.")); break; - case dcp::VerificationNote::MISSING_EXTENSION_METADATA: + case dcp::VerificationNote::Code::MISSING_EXTENSION_METADATA: add(i, _("The CPL %n has no CPL extension metadata tag.")); break; - case dcp::VerificationNote::INVALID_EXTENSION_METADATA: + case dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA: add(i, _("The CPL %f has an invalid CPL extension metadata tag (%n)")); break; - case dcp::VerificationNote::UNSIGNED_CPL_WITH_ENCRYPTED_CONTENT: + case dcp::VerificationNote::Code::UNSIGNED_CPL_WITH_ENCRYPTED_CONTENT: add(i, _("The CPL %n has encrypted content but is not signed.")); break; - case dcp::VerificationNote::UNSIGNED_PKL_WITH_ENCRYPTED_CONTENT: + case dcp::VerificationNote::Code::UNSIGNED_PKL_WITH_ENCRYPTED_CONTENT: add(i, _("The PKL %n has encrypted content but is not signed.")); break; - case dcp::VerificationNote::MISMATCHED_PKL_ANNOTATION_TEXT_WITH_CPL: + case dcp::VerificationNote::Code::MISMATCHED_PKL_ANNOTATION_TEXT_WITH_CPL: add(i, _("The PKL %n has an which does not match its CPL's .")); break; - case dcp::VerificationNote::PARTIALLY_ENCRYPTED: + case dcp::VerificationNote::Code::PARTIALLY_ENCRYPTED: add(i, _("The DCP has encrypted content, but not all its assets are encrypted.")); break; } @@ -301,41 +301,41 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr job wxString summary_text; - if (counts[dcp::VerificationNote::VERIFY_ERROR] == 1) { + if (counts[dcp::VerificationNote::Type::ERROR] == 1) { /// TRANSLATORS: this will be used at the start of a string like "1 error, 2 Bv2.1 errors and 3 warnings." summary_text = _("1 error, "); } else { /// TRANSLATORS: this will be used at the start of a string like "1 error, 2 Bv2.1 errors and 3 warnings." - summary_text = wxString::Format("%d errors, ", counts[dcp::VerificationNote::VERIFY_ERROR]); + summary_text = wxString::Format("%d errors, ", counts[dcp::VerificationNote::Type::ERROR]); } - if (counts[dcp::VerificationNote::VERIFY_BV21_ERROR] == 1) { + if (counts[dcp::VerificationNote::Type::BV21_ERROR] == 1) { /// TRANSLATORS: this will be used in the middle of a string like "1 error, 2 Bv2.1 errors and 3 warnings." summary_text += _("1 Bv2.1 error, "); } else { /// TRANSLATORS: this will be used in the middle of a string like "1 error, 2 Bv2.1 errors and 3 warnings." - summary_text += wxString::Format("%d Bv2.1 errors, ", counts[dcp::VerificationNote::VERIFY_BV21_ERROR]); + summary_text += wxString::Format("%d Bv2.1 errors, ", counts[dcp::VerificationNote::Type::BV21_ERROR]); } - if (counts[dcp::VerificationNote::VERIFY_WARNING] == 1) { + if (counts[dcp::VerificationNote::Type::WARNING] == 1) { /// TRANSLATORS: this will be used at the end of a string like "1 error, 2 Bv2.1 errors and 3 warnings." summary_text += _("and 1 warning."); } else { /// TRANSLATORS: this will be used at the end of a string like "1 error, 2 Bv2.1 errors and 3 warnings." - summary_text += wxString::Format("and %d warnings.", counts[dcp::VerificationNote::VERIFY_WARNING]); + summary_text += wxString::Format("and %d warnings.", counts[dcp::VerificationNote::Type::WARNING]); } summary->SetLabel(summary_text); - if (counts[dcp::VerificationNote::VERIFY_ERROR] == 0) { - add_bullet (dcp::VerificationNote::VERIFY_ERROR, _("No errors found.")); + if (counts[dcp::VerificationNote::Type::ERROR] == 0) { + add_bullet (dcp::VerificationNote::Type::ERROR, _("No errors found.")); } - if (counts[dcp::VerificationNote::VERIFY_BV21_ERROR] == 0) { - add_bullet (dcp::VerificationNote::VERIFY_BV21_ERROR, _("No SMPTE Bv2.1 errors found.")); + if (counts[dcp::VerificationNote::Type::BV21_ERROR] == 0) { + add_bullet (dcp::VerificationNote::Type::BV21_ERROR, _("No SMPTE Bv2.1 errors found.")); } - if (counts[dcp::VerificationNote::VERIFY_WARNING] == 0) { - add_bullet (dcp::VerificationNote::VERIFY_WARNING, _("No warnings found.")); + if (counts[dcp::VerificationNote::Type::WARNING] == 0) { + add_bullet (dcp::VerificationNote::Type::WARNING, _("No warnings found.")); } } diff --git a/src/wx/video_waveform_plot.cc b/src/wx/video_waveform_plot.cc index cf07a2ea7..7293af690 100644 --- a/src/wx/video_waveform_plot.cc +++ b/src/wx/video_waveform_plot.cc @@ -181,7 +181,7 @@ VideoWaveformPlot::create_waveform () _waveform = _waveform->scale ( dcp::Size (GetSize().GetWidth() - _x_axis_width, waveform_height), - dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false, false + dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, false, false ); } diff --git a/test/atmos_test.cc b/test/atmos_test.cc index 95c43ce34..6689ee8d7 100644 --- a/test/atmos_test.cc +++ b/test/atmos_test.cc @@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE (atmos_encrypted_passthrough_test) dcp_file(film, "cpl"), dcp::LocalTime(), dcp::LocalTime(), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, optional() ); diff --git a/test/create_cli_test.cc b/test/create_cli_test.cc index 747f0f045..31c8ae877 100644 --- a/test/create_cli_test.cc +++ b/test/create_cli_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2019 Carl Hetherington + Copyright (C) 2019-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -21,6 +21,7 @@ #include "lib/create_cli.h" #include "lib/ratio.h" #include "lib/dcp_content_type.h" +#include "test.h" #include #include #include @@ -98,11 +99,11 @@ BOOST_AUTO_TEST_CASE (create_cli_test) cc = run ("dcpomatic2_create x --standard SMPTE"); BOOST_CHECK (!cc.error); - BOOST_CHECK_EQUAL (cc.standard, dcp::SMPTE); + BOOST_CHECK_EQUAL (cc.standard, dcp::Standard::SMPTE); cc = run ("dcpomatic2_create x --standard interop"); BOOST_CHECK (!cc.error); - BOOST_CHECK_EQUAL (cc.standard, dcp::INTEROP); + BOOST_CHECK_EQUAL (cc.standard, dcp::Standard::INTEROP); cc = run ("dcpomatic2_create x --standard SMPTEX"); BOOST_CHECK (cc.error); diff --git a/test/dcp_decoder_test.cc b/test/dcp_decoder_test.cc index 28538a281..c1ad90d6f 100644 --- a/test/dcp_decoder_test.cc +++ b/test/dcp_decoder_test.cc @@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE (check_reuse_old_data_test) encrypted_dcp.cpls().front()->file().get(), dcp::LocalTime ("2030-07-21T00:00:00+00:00"), dcp::LocalTime ("2031-07-21T00:00:00+00:00"), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0 ); diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc index e43ea76e8..1147b4d07 100644 --- a/test/ffmpeg_encoder_test.cc +++ b/test/ffmpeg_encoder_test.cc @@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test6) film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->only_text()->set_colour (dcp::Colour (255, 255, 0)); - s->only_text()->set_effect (dcp::SHADOW); + s->only_text()->set_effect (dcp::Effect::SHADOW); s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255)); film->write_metadata(); @@ -156,7 +156,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test7) film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->only_text()->set_colour (dcp::Colour (255, 255, 0)); - s->only_text()->set_effect (dcp::SHADOW); + s->only_text()->set_effect (dcp::Effect::SHADOW); s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255)); shared_ptr job (new TranscodeJob (film)); @@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2) film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->only_text()->set_colour (dcp::Colour (255, 255, 0)); - s->only_text()->set_effect (dcp::SHADOW); + s->only_text()->set_effect (dcp::Effect::SHADOW); s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255)); film->write_metadata(); @@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3) film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->only_text()->set_colour (dcp::Colour (255, 255, 0)); - s->only_text()->set_effect (dcp::SHADOW); + s->only_text()->set_effect (dcp::Effect::SHADOW); s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255)); film->write_metadata(); diff --git a/test/image_test.cc b/test/image_test.cc index 88bb00b8d..f69383724 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -140,7 +140,7 @@ alpha_blend_test_one (AVPixelFormat format, string suffix) { shared_ptr proxy (new FFmpegImageProxy (TestPaths::private_data() / "prophet_frame.tiff", VIDEO_RANGE_FULL)); shared_ptr raw = proxy->image().image; - shared_ptr background = raw->convert_pixel_format (dcp::YUV_TO_RGB_REC709, format, true, false); + shared_ptr background = raw->convert_pixel_format (dcp::YUVToRGB::REC709, format, true, false); shared_ptr overlay (new Image (AV_PIX_FMT_BGRA, dcp::Size(431, 891), true)); overlay->make_transparent (); @@ -171,7 +171,7 @@ alpha_blend_test_one (AVPixelFormat format, string suffix) background->alpha_blend (overlay, Position (13, 17)); - shared_ptr save = background->convert_pixel_format (dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false, false); + shared_ptr save = background->convert_pixel_format (dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, false, false); write_image (save, "build/test/image_test_" + suffix + ".png"); check_image ("build/test/image_test_" + suffix + ".png", TestPaths::private_data() / ("image_test_" + suffix + ".png")); @@ -263,9 +263,9 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test) shared_ptr proxy(new FFmpegImageProxy("test/data/flat_red.png", VIDEO_RANGE_FULL)); shared_ptr raw = proxy->image().image; shared_ptr out = raw->crop_scale_window( - Crop(), dcp::Size(1998, 836), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_YUV420P, VIDEO_RANGE_FULL, true, false + Crop(), dcp::Size(1998, 836), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_YUV420P, VIDEO_RANGE_FULL, true, false ); - shared_ptr save = out->scale(dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false, false); + shared_ptr save = out->scale(dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, false, false); write_image(save, "build/test/crop_scale_window_test.png"); check_image("test/data/crop_scale_window_test.png", "build/test/crop_scale_window_test.png"); } @@ -275,19 +275,19 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test2) { shared_ptr image (new Image(AV_PIX_FMT_XYZ12LE, dcp::Size(2048, 858), true)); image->crop_scale_window ( - Crop(279, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false + Crop(279, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false ); image->crop_scale_window ( - Crop(2048, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false + Crop(2048, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false ); } BOOST_AUTO_TEST_CASE (crop_scale_window_test3) { shared_ptr proxy(new FFmpegImageProxy(TestPaths::private_data() / "player_seek_test_0.png", VIDEO_RANGE_FULL)); - shared_ptr xyz = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, true, false); + shared_ptr xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, true, false); shared_ptr cropped = xyz->crop_scale_window( - Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false + Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false ); write_image(cropped, "build/test/crop_scale_window_test3.png"); check_image("test/data/crop_scale_window_test3.png", "build/test/crop_scale_window_test3.png"); @@ -296,9 +296,9 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test3) BOOST_AUTO_TEST_CASE (crop_scale_window_test4) { shared_ptr proxy(new FFmpegImageProxy(TestPaths::private_data() / "player_seek_test_0.png", VIDEO_RANGE_FULL)); - shared_ptr xyz = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, true, false); + shared_ptr xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, true, false); shared_ptr cropped = xyz->crop_scale_window( - Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_XYZ12LE, VIDEO_RANGE_FULL, false, false + Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_XYZ12LE, VIDEO_RANGE_FULL, false, false ); write_image(cropped, "build/test/crop_scale_window_test4.png"); check_image("test/data/crop_scale_window_test4.png", "build/test/crop_scale_window_test4.png", 35000); @@ -307,9 +307,9 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test4) BOOST_AUTO_TEST_CASE (crop_scale_window_test5) { shared_ptr proxy(new FFmpegImageProxy(TestPaths::private_data() / "player_seek_test_0.png", VIDEO_RANGE_FULL)); - shared_ptr xyz = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_XYZ12LE, true, false); + shared_ptr xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_XYZ12LE, true, false); shared_ptr cropped = xyz->crop_scale_window( - Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false + Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false ); write_image(cropped, "build/test/crop_scale_window_test5.png"); check_image("test/data/crop_scale_window_test5.png", "build/test/crop_scale_window_test5.png"); @@ -318,9 +318,9 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test5) BOOST_AUTO_TEST_CASE (crop_scale_window_test6) { shared_ptr proxy(new FFmpegImageProxy(TestPaths::private_data() / "player_seek_test_0.png", VIDEO_RANGE_FULL)); - shared_ptr xyz = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_XYZ12LE, true, false); + shared_ptr xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_XYZ12LE, true, false); shared_ptr cropped = xyz->crop_scale_window( - Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_XYZ12LE, VIDEO_RANGE_FULL, false, false + Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_XYZ12LE, VIDEO_RANGE_FULL, false, false ); write_image(cropped, "build/test/crop_scale_window_test6.png"); check_image("test/data/crop_scale_window_test6.png", "build/test/crop_scale_window_test6.png", 35000); @@ -333,13 +333,13 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test7) using namespace boost::filesystem; for (int left_crop = 0; left_crop < 8; ++left_crop) { shared_ptr proxy(new FFmpegImageProxy("test/data/rgb_grey_testcard.png", VIDEO_RANGE_FULL)); - shared_ptr yuv = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_YUV420P, true, false); + shared_ptr yuv = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_YUV420P, true, false); int rounded = left_crop - (left_crop % 2); shared_ptr cropped = yuv->crop_scale_window( Crop(left_crop, 0, 0, 0), dcp::Size(1998 - rounded, 1080), dcp::Size(1998 - rounded, 1080), - dcp::YUV_TO_RGB_REC709, + dcp::YUVToRGB::REC709, VIDEO_RANGE_VIDEO, AV_PIX_FMT_RGB24, VIDEO_RANGE_VIDEO, @@ -357,7 +357,7 @@ BOOST_AUTO_TEST_CASE (as_png_test) { shared_ptr proxy(new FFmpegImageProxy("test/data/3d_test/000001.png", VIDEO_RANGE_FULL)); shared_ptr image_rgb = proxy->image().image; - shared_ptr image_bgr = image_rgb->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_BGRA, true, false); + shared_ptr image_bgr = image_rgb->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_BGRA, true, false); image_rgb->as_png().write ("build/test/as_png_rgb.png"); image_bgr->as_png().write ("build/test/as_png_bgr.png"); @@ -373,7 +373,7 @@ fade_test_format_black (AVPixelFormat f, string name) yuv.make_black (); yuv.fade (0); string const filename = "fade_test_black_" + name + ".png"; - yuv.convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename); + yuv.convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename); check_image ("test/data/" + filename, "build/test/" + filename); } @@ -382,10 +382,10 @@ static void fade_test_format_red (AVPixelFormat f, float amount, string name) { shared_ptr proxy(new FFmpegImageProxy("test/data/flat_red.png", VIDEO_RANGE_FULL)); - shared_ptr red = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, f, true, false); + shared_ptr red = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, f, true, false); red->fade (amount); string const filename = "fade_test_red_" + name + ".png"; - red->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename); + red->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename); check_image ("test/data/" + filename, "build/test/" + filename); } @@ -462,7 +462,7 @@ BOOST_AUTO_TEST_CASE (make_black_test) for (list::const_iterator i = pix_fmts.begin(); i != pix_fmts.end(); ++i) { std::shared_ptr foo (new Image (*i, in_size, true)); foo->make_black (); - std::shared_ptr bar = foo->scale (out_size, dcp::YUV_TO_RGB_REC601, AV_PIX_FMT_RGB24, true, false); + std::shared_ptr bar = foo->scale (out_size, dcp::YUVToRGB::REC601, AV_PIX_FMT_RGB24, true, false); uint8_t* p = bar->data()[0]; for (int y = 0; y < bar->size().height; ++y) { @@ -490,7 +490,7 @@ BOOST_AUTO_TEST_CASE (over_crop_test) shared_ptr image (new Image (AV_PIX_FMT_RGB24, dcp::Size(128, 128), true)); image->make_black (); shared_ptr scaled = image->crop_scale_window ( - Crop(0, 0, 128, 128), dcp::Size(1323, 565), dcp::Size(1349, 565), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, true, true + Crop(0, 0, 128, 128), dcp::Size(1323, 565), dcp::Size(1349, 565), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, true, true ); string const filename = "over_crop_test.png"; write_image (scaled, "build/test/" + filename); diff --git a/test/import_dcp_test.cc b/test/import_dcp_test.cc index 7ecb6c822..7729cfe5b 100644 --- a/test/import_dcp_test.cc +++ b/test/import_dcp_test.cc @@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test) A_dcp.cpls().front()->file().get(), dcp::LocalTime ("2030-07-21T00:00:00+00:00"), dcp::LocalTime ("2031-07-21T00:00:00+00:00"), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0 ); diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index 11886cbef..3465db750 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -162,56 +162,56 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) AudioMapping mapping = sound->audio->mapping (); - mapping.set (0, dcp::LEFT, 1.0); + mapping.set (0, dcp::Channel::LEFT, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_20_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::RIGHT, 1.0); + mapping.set (0, dcp::Channel::RIGHT, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_30_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::LFE, 1.0); + mapping.set (0, dcp::Channel::LFE, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_31_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::LS, 1.0); + mapping.set (0, dcp::Channel::LS, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_41_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::RS, 1.0); + mapping.set (0, dcp::Channel::RS, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::HI, 1.0); + mapping.set (0, dcp::Channel::HI, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV"); film->set_audio_channels (8); - mapping.set (0, dcp::HI, 1.0); + mapping.set (0, dcp::Channel::HI, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::VI, 1.0); + mapping.set (0, dcp::Channel::VI, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI-VI_4K_DI_20140704_PP_SMPTE_OV"); film->set_audio_channels(10); - mapping.set (0, dcp::HI, 0.0); - mapping.set (0, dcp::VI, 0.0); + mapping.set (0, dcp::Channel::HI, 0.0); + mapping.set (0, dcp::Channel::VI, 0.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::HI, 1.0); + mapping.set (0, dcp::Channel::HI, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::VI, 1.0); + mapping.set (0, dcp::Channel::VI, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI-VI_4K_DI_20140704_PP_SMPTE_OV"); film->set_audio_channels(12); - mapping.set (0, dcp::BSL, 1.0); - mapping.set (0, dcp::BSR, 1.0); - mapping.set (0, dcp::HI, 0.0); - mapping.set (0, dcp::VI, 0.0); + mapping.set (0, dcp::Channel::BSL, 1.0); + mapping.set (0, dcp::Channel::BSR, 1.0); + mapping.set (0, dcp::Channel::HI, 0.0); + mapping.set (0, dcp::Channel::VI, 0.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::HI, 1.0); + mapping.set (0, dcp::Channel::HI, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI_4K_DI_20140704_PP_SMPTE_OV"); - mapping.set (0, dcp::VI, 1.0); + mapping.set (0, dcp::Channel::VI, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI-VI_4K_DI_20140704_PP_SMPTE_OV"); } diff --git a/test/kdm_naming_test.cc b/test/kdm_naming_test.cc index 85a0b60f6..fb0f37dcf 100644 --- a/test/kdm_naming_test.cc +++ b/test/kdm_naming_test.cc @@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test) cinema_a_screen_1, boost::posix_time::time_from_string(from_string), boost::posix_time::time_from_string(until_string), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, optional() ); @@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on( i, boost::posix_time::time_from_string(from_string), boost::posix_time::time_from_string(until_string), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, optional() ); diff --git a/test/ratio_test.cc b/test/ratio_test.cc index 43f1d2a15..1e8d54333 100644 --- a/test/ratio_test.cc +++ b/test/ratio_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -28,6 +28,7 @@ #include #include "lib/ratio.h" #include "lib/util.h" +#include "test.h" using std::ostream; diff --git a/test/recover_test.cc b/test/recover_test.cc index aa8da8ba9..13cb37a07 100644 --- a/test/recover_test.cc +++ b/test/recover_test.cc @@ -45,7 +45,7 @@ using namespace boost::placeholders; static void note (dcp::NoteType t, string n) { - if (t == dcp::DCP_ERROR) { + if (t == dcp::NoteType::ERROR) { cout << n << "\n"; } } diff --git a/test/remake_id_test.cc b/test/remake_id_test.cc index 488fada90..8f8ab820b 100644 --- a/test/remake_id_test.cc +++ b/test/remake_id_test.cc @@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE (remake_id_test2) *cpl, dcp::LocalTime ("2030-01-01T01:00:00+00:00"), dcp::LocalTime ("2031-01-01T01:00:00+00:00"), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0 ); diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc index 99e1e7a1b..a81ef05bf 100644 --- a/test/render_subtitles_test.cc +++ b/test/render_subtitles_test.cc @@ -43,12 +43,12 @@ add (std::list& s, std::string text, bool italic, bool bold, bool un dcp::Time (), dcp::Time (), 1, - dcp::HALIGN_LEFT, + dcp::HAlign::LEFT, 1, - dcp::VALIGN_TOP, - dcp::DIRECTION_LTR, + dcp::VAlign::TOP, + dcp::Direction::LTR, text, - dcp::NONE, + dcp::Effect::NONE, dcp::Colour (0, 0, 0), dcp::Time (), dcp::Time () diff --git a/test/stream_test.cc b/test/stream_test.cc index a706906f8..25c2d98a6 100644 --- a/test/stream_test.cc +++ b/test/stream_test.cc @@ -82,11 +82,11 @@ BOOST_AUTO_TEST_CASE (stream_test) BOOST_CHECK_EQUAL (a.name, "hello there world"); BOOST_CHECK_EQUAL (a.mapping().input_channels(), 2); - BOOST_CHECK_EQUAL (a.mapping().get (0, static_cast (dcp::LEFT)), 1); - BOOST_CHECK_EQUAL (a.mapping().get (0, static_cast (dcp::RIGHT)), 0); - BOOST_CHECK_EQUAL (a.mapping().get (0, static_cast (dcp::CENTRE)), 1); - BOOST_CHECK_EQUAL (a.mapping().get (1, static_cast (dcp::LEFT)), 0); - BOOST_CHECK_EQUAL (a.mapping().get (1, static_cast (dcp::RIGHT)), 1); - BOOST_CHECK_EQUAL (a.mapping().get (1, static_cast (dcp::CENTRE)), 1); + BOOST_CHECK_EQUAL (a.mapping().get(0, dcp::Channel::LEFT), 1); + BOOST_CHECK_EQUAL (a.mapping().get(0, dcp::Channel::RIGHT), 0); + BOOST_CHECK_EQUAL (a.mapping().get(0, dcp::Channel::CENTRE), 1); + BOOST_CHECK_EQUAL (a.mapping().get(1, dcp::Channel::LEFT), 0); + BOOST_CHECK_EQUAL (a.mapping().get(1, dcp::Channel::RIGHT), 1); + BOOST_CHECK_EQUAL (a.mapping().get(1, dcp::Channel::CENTRE), 1); } diff --git a/test/test.cc b/test/test.cc index 19e8f978a..cbd12e1ee 100644 --- a/test/test.cc +++ b/test/test.cc @@ -458,7 +458,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) static void note (dcp::NoteType t, string n) { - if (t == dcp::DCP_ERROR) { + if (t == dcp::NoteType::ERROR) { cerr << n << "\n"; } } @@ -790,3 +790,24 @@ LogSwitcher::~LogSwitcher () dcpomatic_log = _old; } +std::ostream& +dcp::operator<< (std::ostream& s, dcp::Size i) +{ + s << i.width << "x" << i.height; + return s; +} + +std::ostream& +dcp::operator<< (std::ostream& s, Standard t) +{ + switch (t) { + case Standard::INTEROP: + s << "interop"; + break; + case Standard::SMPTE: + s << "smpte"; + break; + } + return s; +} + diff --git a/test/test.h b/test/test.h index 44ca706f6..c188a614f 100644 --- a/test/test.h +++ b/test/test.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2019 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -20,6 +20,7 @@ #include "lib/warnings.h" +#include #include @@ -66,3 +67,9 @@ private: std::shared_ptr _old; }; +namespace dcp { + +std::ostream& operator<< (std::ostream& s, dcp::Size i); +std::ostream& operator<< (std::ostream& s, Standard t); + +} diff --git a/test/vf_kdm_test.cc b/test/vf_kdm_test.cc index 7a9c30263..9b987a703 100644 --- a/test/vf_kdm_test.cc +++ b/test/vf_kdm_test.cc @@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE (vf_kdm_test) A_dcp.cpls().front()->file().get(), dcp::LocalTime ("2030-07-21T00:00:00+00:00"), dcp::LocalTime ("2031-07-21T00:00:00+00:00"), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0 ); @@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE (vf_kdm_test) B_dcp.cpls().front()->file().get(), dcp::LocalTime ("2030-07-21T00:00:00+00:00"), dcp::LocalTime ("2031-07-21T00:00:00+00:00"), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0 ); diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc index b3e3ff76c..73feb7dc6 100644 --- a/test/video_content_scale_test.cc +++ b/test/video_content_scale_test.cc @@ -21,6 +21,7 @@ #include "lib/ratio.h" #include "lib/video_content.h" +#include "test.h" #include -- 2.30.2