libdcp.git
23 months agoAdd and use new File class. master
Carl Hetherington [Tue, 12 Apr 2022 20:34:04 +0000 (22:34 +0200)]
Add and use new File class.

It was always a bit troubling that fopen_boost wasn't exception safe,
and this also fixes a leak where load_ratings_list would never close
the ratings file.

23 months agoSome more detailed notes in dcpdiff.
Carl Hetherington [Thu, 24 Mar 2022 19:02:37 +0000 (20:02 +0100)]
Some more detailed notes in dcpdiff.

23 months agoAdd verify test to check for erroneous <EntryPoint> and <Duration>
Carl Hetherington [Thu, 24 Mar 2022 00:28:16 +0000 (01:28 +0100)]
Add verify test to check for erroneous <EntryPoint> and <Duration>
tags inside <MainMarkers>

23 months agoRemove <EntryPoint> and <Duration> from <ReelMarkerAsset> tags.
Carl Hetherington [Wed, 23 Mar 2022 23:41:32 +0000 (00:41 +0100)]
Remove <EntryPoint> and <Duration> from <ReelMarkerAsset> tags.

They should not be there:
"EntryPoint" ... "This element shall only be present when the
Asset refers to an external resource such as a Track File".

Fixes DoM bug #2215.

23 months agoNearly pretty-print subtitle XML (though not in <Text> nodes).
Carl Hetherington [Tue, 15 Mar 2022 14:32:49 +0000 (15:32 +0100)]
Nearly pretty-print subtitle XML (though not in <Text> nodes).

This is an attempt to fix DoM bug #2205.

23 months agoC++11 tidying.
Carl Hetherington [Tue, 15 Mar 2022 10:28:05 +0000 (11:28 +0100)]
C++11 tidying.

23 months agoAdd string converters for KDM formulations.
Carl Hetherington [Sat, 19 Mar 2022 20:39:58 +0000 (21:39 +0100)]
Add string converters for KDM formulations.

23 months agoRemove old MODIFIED_TRANSITIONAL_TEST.
Carl Hetherington [Sat, 19 Mar 2022 20:24:54 +0000 (21:24 +0100)]
Remove old MODIFIED_TRANSITIONAL_TEST.

2 years agoSome small documentation tweaks.
Carl Hetherington [Mon, 7 Mar 2022 22:10:45 +0000 (23:10 +0100)]
Some small documentation tweaks.

2 years agoTidy some includes.
Carl Hetherington [Mon, 7 Mar 2022 21:16:41 +0000 (22:16 +0100)]
Tidy some includes.

2 years agoHide another warning (from ImageMagick in the examples).
Carl Hetherington [Mon, 7 Mar 2022 21:16:37 +0000 (22:16 +0100)]
Hide another warning (from ImageMagick in the examples).

2 years agoTweak path in the example.
Carl Hetherington [Mon, 7 Mar 2022 20:52:21 +0000 (21:52 +0100)]
Tweak path in the example.

2 years agoRemove unused capture.
Carl Hetherington [Thu, 3 Mar 2022 23:05:31 +0000 (00:05 +0100)]
Remove unused capture.

2 years agoFix slightly extended libxml++ dependency.
Carl Hetherington [Thu, 3 Mar 2022 21:28:01 +0000 (22:28 +0100)]
Fix slightly extended libxml++ dependency.

2 years agoAdd lists of ratings.
Carl Hetherington [Tue, 1 Mar 2022 16:06:26 +0000 (17:06 +0100)]
Add lists of ratings.

2 years agoMake dcp::init() take a general resources directory rather than specifically tags.
Carl Hetherington [Tue, 1 Mar 2022 19:29:13 +0000 (20:29 +0100)]
Make dcp::init() take a general resources directory rather than specifically tags.

2 years agoMove Rating out to a separate file.
Carl Hetherington [Tue, 1 Mar 2022 15:27:59 +0000 (16:27 +0100)]
Move Rating out to a separate file.

2 years agoAdd -x32/-x64 suffix to boost libraries when building for Windows.
Carl Hetherington [Tue, 22 Feb 2022 21:56:48 +0000 (22:56 +0100)]
Add -x32/-x64 suffix to boost libraries when building for Windows.

2 years agoDon't look for ImageMagick/GraphicsMagick if not building examples.
Carl Hetherington [Sat, 19 Feb 2022 22:27:37 +0000 (23:27 +0100)]
Don't look for ImageMagick/GraphicsMagick if not building examples.

2 years agoPass certificate validity length into the constructor.
Carl Hetherington [Sat, 12 Feb 2022 20:22:40 +0000 (21:22 +0100)]
Pass certificate validity length into the constructor.

2 years agoCleanup: use dcp::LocalTime for certificate validity times.
Carl Hetherington [Sat, 12 Feb 2022 20:15:03 +0000 (21:15 +0100)]
Cleanup: use dcp::LocalTime for certificate validity times.

Before we were using struct tm but not filling it all in, which
seems quite unpleasant.

2 years agoBump waf.
Carl Hetherington [Tue, 1 Feb 2022 22:03:11 +0000 (23:03 +0100)]
Bump waf.

2 years agoFix a crazy number of suggest-override warnings when building on Ubuntu 18.04.
Carl Hetherington [Fri, 28 Jan 2022 20:41:03 +0000 (21:41 +0100)]
Fix a crazy number of suggest-override warnings when building on Ubuntu 18.04.

2 years agoUse optional for ReelAsset _annotation_text.
Carl Hetherington [Mon, 17 Jan 2022 17:45:19 +0000 (18:45 +0100)]
Use optional for ReelAsset _annotation_text.

Not only is this tag optional in Interop and SMPTE, but it would
appear that if it is present but empty a DCP will not play back
on Sony SRX320 / LMT3000 systems (DoM bug #2124).

Here we use optional<>, as seems to make sense, and also refuse
to write empty tags (instead omitting the tag entirely).

2 years agoFix failure to find_and_resolve_all_cpls() in some cases.
Carl Hetherington [Tue, 4 Jan 2022 20:54:24 +0000 (20:54 +0000)]
Fix failure to find_and_resolve_all_cpls() in some cases.

It seems to me that we need to ignore as-yet-unresolved assets
otherwise if we see them in the wrong order we'll throw an exception.

2 years agoSimplify the implementation of DCP::add.
Carl Hetherington [Mon, 3 Jan 2022 23:27:45 +0000 (23:27 +0000)]
Simplify the implementation of DCP::add.

2 years agoAdd a test for DCP::add() for KDMs.
Carl Hetherington [Mon, 3 Jan 2022 23:27:37 +0000 (23:27 +0000)]
Add a test for DCP::add() for KDMs.

2 years agoMove code to find CPLs in directories out of DCP-o-matic.
Carl Hetherington [Mon, 3 Jan 2022 23:26:49 +0000 (23:26 +0000)]
Move code to find CPLs in directories out of DCP-o-matic.

This adds find_and_resolve_cpls().

2 years agoRemove unnecessary include.
Carl Hetherington [Tue, 28 Dec 2021 22:50:18 +0000 (23:50 +0100)]
Remove unnecessary include.

2 years agoC++11 tidying, formatting tidying, add --frame option.
Carl Hetherington [Wed, 24 Nov 2021 22:56:28 +0000 (23:56 +0100)]
C++11 tidying, formatting tidying, add --frame option.

2 years agoClarify some errors and add comments wondering about their validity.
Carl Hetherington [Mon, 22 Nov 2021 19:57:07 +0000 (20:57 +0100)]
Clarify some errors and add comments wondering about their validity.

2 years agoFix off-by-one in verification of closed caption line length. v1.8.5
Carl Hetherington [Tue, 9 Nov 2021 22:43:46 +0000 (23:43 +0100)]
Fix off-by-one in verification of closed caption line length.

2 years agoMessage tweak.
Carl Hetherington [Sun, 24 Oct 2021 23:13:07 +0000 (01:13 +0200)]
Message tweak.

2 years agoOrder subtitles in the XML according to their vertical position (DoM bug #2106). v1.8.4
Carl Hetherington [Mon, 18 Oct 2021 06:55:27 +0000 (08:55 +0200)]
Order subtitles in the XML according to their vertical position (DoM bug #2106).

2 years agoAllow specification of valign when writing verify tests.
Carl Hetherington [Sat, 23 Oct 2021 21:51:49 +0000 (23:51 +0200)]
Allow specification of valign when writing verify tests.

2 years agoRemove some unused using statements.
Carl Hetherington [Mon, 18 Oct 2021 06:55:07 +0000 (08:55 +0200)]
Remove some unused using statements.

2 years agoBasic implementation of <Space> tag in subtitles. v1.8.3
Carl Hetherington [Wed, 13 Oct 2021 20:18:59 +0000 (22:18 +0200)]
Basic implementation of <Space> tag in subtitles.

2 years agoRemove some unused using commands.
Carl Hetherington [Sun, 10 Oct 2021 20:38:03 +0000 (22:38 +0200)]
Remove some unused using commands.

2 years agoFix problems when adding KDMs to a VF, before adding the OV. v1.8.2
Carl Hetherington [Fri, 8 Oct 2021 10:08:10 +0000 (12:08 +0200)]
Fix problems when adding KDMs to a VF, before adding the OV.

If we have a KDM which contains keys for all the assets referred
to by a VF (even the ones in the OV) we would previously throw
an exception because we tried to give the KDM to the resolved
assets when it was given to the Reel.

Here we change things so that the addition of KDMs to assets can
be deferred if the asset is not yet resolved.

2 years agoFix incorrect error code (2K when it should be 4K). v1.8.1
Carl Hetherington [Tue, 5 Oct 2021 23:17:52 +0000 (01:17 +0200)]
Fix incorrect error code (2K when it should be 4K).

2 years agoTweak comments for the DoM manual.
Carl Hetherington [Tue, 5 Oct 2021 23:17:35 +0000 (01:17 +0200)]
Tweak comments for the DoM manual.

2 years agoRemove an unnecessary using.
Carl Hetherington [Tue, 5 Oct 2021 19:02:40 +0000 (21:02 +0200)]
Remove an unnecessary using.

2 years agoBuild with libcxml 0.17.2. v1.8.0
Carl Hetherington [Sun, 3 Oct 2021 20:23:59 +0000 (22:23 +0200)]
Build with libcxml 0.17.2.

2 years agoMake the former dcst namespace default for SMPTE subtitles.
Carl Hetherington [Sun, 3 Oct 2021 20:18:56 +0000 (22:18 +0200)]
Make the former dcst namespace default for SMPTE subtitles.

In DoM bug #2061 it is reported that Easy DCP gives the error

"XML Document has default root namespace prefix: dcst.
 Default namespace should not use prefix for root or root namespace child nodes."

with SMPTE subtitle files written by DCP-o-matic, and that the correct
fix is to make the former dcst: namespace the default and then remove
the dcst: qualifiers from everything.

I'm not sure I agree with the error; AFAICS the subtitle files written
by previous versions did not have a default root namespace prefix,
since it was specified by xmlns:dcst and not just xmlns alone, so I
think they were valid.

However, using a default NS also seems fine, slightly simplifies the
code and produces more compact subtitle files, so we change that here.
It should also stop Easy DCP complaining, which is always marginally
preferable to sticking to our guns and getting the blame for it.

2 years agoAdd .cache.
Carl Hetherington [Sun, 3 Oct 2021 20:18:42 +0000 (22:18 +0200)]
Add .cache.

2 years agoAdd some missing LIBDCP_RESOURCES.
Carl Hetherington [Sat, 21 Aug 2021 22:07:47 +0000 (00:07 +0200)]
Add some missing LIBDCP_RESOURCES.

2 years agoImprove message on verify test failure.
Carl Hetherington [Wed, 11 Aug 2021 21:35:30 +0000 (23:35 +0200)]
Improve message on verify test failure.

2 years agoAdd verify check for empty <Text> nodes in timed text.
Carl Hetherington [Tue, 10 Aug 2021 00:10:49 +0000 (02:10 +0200)]
Add verify check for empty <Text> nodes in timed text.

2 years agoRename verify_text_timing -> verify_text_details.
Carl Hetherington [Mon, 9 Aug 2021 16:04:09 +0000 (18:04 +0200)]
Rename verify_text_timing -> verify_text_details.

2 years agoAdd support for writing CPL metadata about sign language video tracks (DoM #2062).
Carl Hetherington [Wed, 4 Aug 2021 18:27:32 +0000 (20:27 +0200)]
Add support for writing CPL metadata about sign language video tracks (DoM #2062).

2 years agoC++11 tidying.
Carl Hetherington [Wed, 4 Aug 2021 18:25:02 +0000 (20:25 +0200)]
C++11 tidying.

2 years agoAdd a belt-and-braces check.
Carl Hetherington [Wed, 4 Aug 2021 18:24:29 +0000 (20:24 +0200)]
Add a belt-and-braces check.

2 years agoDon't bother checking the return of node_child as it can never be null
Carl Hetherington [Wed, 4 Aug 2021 18:24:16 +0000 (20:24 +0200)]
Don't bother checking the return of node_child as it can never be null

2 years agoMake adding extension metadata items more generic.
Carl Hetherington [Tue, 3 Aug 2021 22:11:43 +0000 (00:11 +0200)]
Make adding extension metadata items more generic.

2 years agoFix tests after previous commit.
Carl Hetherington [Tue, 3 Aug 2021 22:03:06 +0000 (00:03 +0200)]
Fix tests after previous commit.

2 years agoFix incorrect channel assigment (DoM bug #2062).
Carl Hetherington [Thu, 15 Jul 2021 12:08:08 +0000 (14:08 +0200)]
Fix incorrect channel assigment (DoM bug #2062).

2 years agoC++11 tidying.
Carl Hetherington [Wed, 14 Jul 2021 00:02:17 +0000 (02:02 +0200)]
C++11 tidying.

2 years agoC++11 cleanup.
Carl Hetherington [Fri, 25 Jun 2021 22:00:38 +0000 (00:00 +0200)]
C++11 cleanup.

2 years agoAdd issuer() and creator() getters to CPL.
Carl Hetherington [Thu, 24 Jun 2021 15:02:19 +0000 (17:02 +0200)]
Add issuer() and creator() getters to CPL.

2 years agoFix tests after changes to language tags.
Carl Hetherington [Fri, 18 Jun 2021 18:01:14 +0000 (20:01 +0200)]
Fix tests after changes to language tags.

2 years agoRemove count at start of language files that wasn't being read.
Carl Hetherington [Fri, 18 Jun 2021 18:01:05 +0000 (20:01 +0200)]
Remove count at start of language files that wasn't being read.

2 years agoFix strange python 3 incompatibilities.
Carl Hetherington [Fri, 18 Jun 2021 18:00:49 +0000 (20:00 +0200)]
Fix strange python 3 incompatibilities.

2 years agoFix update-language-subtags to include all descriptions for a particular code.
Carl Hetherington [Sat, 12 Jun 2021 18:51:44 +0000 (20:51 +0200)]
Fix update-language-subtags to include all descriptions for a particular code.

This avoids, e.g. "nl" being labelled as only Flemish and not also
Dutch.

2 years agoAdd option to ignore mismatched HMACs when reading MXFs.
Carl Hetherington [Fri, 4 Jun 2021 12:37:43 +0000 (14:37 +0200)]
Add option to ignore mismatched HMACs when reading MXFs.

2 years agoMissing finalize() in dcpdecryptmxf.
Carl Hetherington [Fri, 4 Jun 2021 11:54:23 +0000 (13:54 +0200)]
Missing finalize() in dcpdecryptmxf.

2 years agoImprove dcpdecryptmxf in various ways.
Carl Hetherington [Fri, 4 Jun 2021 11:32:30 +0000 (13:32 +0200)]
Improve dcpdecryptmxf in various ways.

2 years agoFix up dcpdecryptmxf start script in various ways.
Carl Hetherington [Fri, 4 Jun 2021 11:32:12 +0000 (13:32 +0200)]
Fix up dcpdecryptmxf start script in various ways.

2 years agoAdd missing LIBDCP_RESOURCES to script.
Carl Hetherington [Thu, 3 Jun 2021 22:21:49 +0000 (00:21 +0200)]
Add missing LIBDCP_RESOURCES to script.

2 years agoTest churn from adding make_uuid() into CPL.
Carl Hetherington [Tue, 1 Jun 2021 23:38:53 +0000 (01:38 +0200)]
Test churn from adding make_uuid() into CPL.

2 years agoImprove output when a test fails.
Carl Hetherington [Tue, 1 Jun 2021 23:27:41 +0000 (01:27 +0200)]
Improve output when a test fails.

2 years agoReduce test flakyness a bit.
Carl Hetherington [Tue, 1 Jun 2021 23:27:33 +0000 (01:27 +0200)]
Reduce test flakyness a bit.

2 years agoPass through CompositionMetadataAsset correctly.
Carl Hetherington [Tue, 1 Jun 2021 22:33:01 +0000 (00:33 +0200)]
Pass through CompositionMetadataAsset correctly.

We weren't saving Id, and were not quite handling FullContentText
correctly.

2 years agoMake similar changes to the previous commit for _xml_id.
Carl Hetherington [Thu, 27 May 2021 12:22:48 +0000 (14:22 +0200)]
Make similar changes to the previous commit for _xml_id.

This is also unavailable if the asset is encrypted.

2 years agoTidy handling of _raw_xml.
Carl Hetherington [Thu, 27 May 2021 12:21:35 +0000 (14:21 +0200)]
Tidy handling of _raw_xml.

Before this if we tried to get the XML of an encrypted asset we
would just get an empty string.  Now we get a boost::none which
means the verifier can avoid trying to check details of the XML
(and instead raise a warning that you are trying to verify data
that it cannot decrypt).

2 years agoFix bug causing failure to decrypt SMPTE subtitles.
Carl Hetherington [Thu, 27 May 2021 12:19:40 +0000 (14:19 +0200)]
Fix bug causing failure to decrypt SMPTE subtitles.

2 years agoC++11 cleanup.
Carl Hetherington [Thu, 27 May 2021 12:16:40 +0000 (14:16 +0200)]
C++11 cleanup.

2 years agoRead the bits we can from the MXF header even when it is encrypted.
Carl Hetherington [Thu, 27 May 2021 09:45:11 +0000 (11:45 +0200)]
Read the bits we can from the MXF header even when it is encrypted.

2 years agoSort notes when checking verifications.
Carl Hetherington [Thu, 27 May 2021 09:44:21 +0000 (11:44 +0200)]
Sort notes when checking verifications.

So that the lists in the tests don't have to be in the right order.

2 years agoActually use correct gcc version in check from previous.
Carl Hetherington [Fri, 7 May 2021 16:21:51 +0000 (18:21 +0200)]
Actually use correct gcc version in check from previous.

2 years agoFix build on old GCC.
Carl Hetherington [Fri, 7 May 2021 16:15:39 +0000 (18:15 +0200)]
Fix build on old GCC.

2 years agoAlso install mono_picture_asset_writer.h
Mart Jansink [Mon, 26 Apr 2021 09:52:39 +0000 (11:52 +0200)]
Also install mono_picture_asset_writer.h

2 years agoPrefer the tags directory specified in LIBDCP_RESOURCES
Mart Jansink [Mon, 26 Apr 2021 09:50:25 +0000 (11:50 +0200)]
Prefer the tags directory specified in LIBDCP_RESOURCES

2 years agoAlso depend on libcxml
Mart Jansink [Mon, 26 Apr 2021 09:48:53 +0000 (11:48 +0200)]
Also depend on libcxml

2 years agoSlightly more details message when sound data differs in ::equals().
Carl Hetherington [Thu, 29 Apr 2021 07:36:46 +0000 (09:36 +0200)]
Slightly more details message when sound data differs in ::equals().

2 years agoDon't give an error on verifying Interop DCPs with possibly-incorrectly
Carl Hetherington [Thu, 22 Apr 2021 19:56:38 +0000 (21:56 +0200)]
Don't give an error on verifying Interop DCPs with possibly-incorrectly
marked 3D assets.

This also adds a warning into the verification output.

I don't know if this is actually a standard violation but they
have been seen in the wild made by "reputable" DCP creation software.

DoM bug #1976.

3 years agoFix macOS build warning.
Carl Hetherington [Wed, 14 Apr 2021 22:02:56 +0000 (00:02 +0200)]
Fix macOS build warning.

3 years agoMissing header install.
Carl Hetherington [Wed, 14 Apr 2021 14:49:50 +0000 (16:49 +0200)]
Missing header install.

3 years agoImprove handling of image subtitle IDs in XML (DoM bug #1965)
Carl Hetherington [Wed, 14 Apr 2021 07:56:21 +0000 (09:56 +0200)]
Improve handling of image subtitle IDs in XML (DoM bug #1965)

When reading/writing the XML for image subtitles, we assumed that
the content of the <Image> tag is just the ID of the PNG in the MXF,
without any prefix.

DoM bug #1965 mentions a DCP where this is not the case, and SMPTE
429-5-2009 has an example where there is urn:uuid: in the XML.

This change makes DoM write this urn:uuid: prefix, and accept it if
it's present (but not complain if it's not).

If the urn:uuid: _is_ required in the field, it's a bit surprising
that nobody has complained up to this point.  Maybe nobody noticed,
or nobody reported it.

3 years agoIgnore parameters in PKL type strings when checking them.
Carl Hetherington [Wed, 14 Apr 2021 10:40:01 +0000 (12:40 +0200)]
Ignore parameters in PKL type strings when checking them.

3 years agoRename write_subtitle_test -> shared_subtitle_test
Carl Hetherington [Wed, 14 Apr 2021 09:28:50 +0000 (11:28 +0200)]
Rename write_subtitle_test -> shared_subtitle_test

3 years agoMove some tests from write_subtitle_test into interop_subtitle_test.
Carl Hetherington [Wed, 14 Apr 2021 09:26:08 +0000 (11:26 +0200)]
Move some tests from write_subtitle_test into interop_subtitle_test.

3 years agoRename read_interop_subtitle_test -> interop_subtitle_test.
Carl Hetherington [Wed, 14 Apr 2021 09:23:59 +0000 (11:23 +0200)]
Rename read_interop_subtitle_test -> interop_subtitle_test.

3 years agoMove some tests from write_subtitle_test to smpte_subtitle_test.
Carl Hetherington [Wed, 14 Apr 2021 09:14:13 +0000 (11:14 +0200)]
Move some tests from write_subtitle_test to smpte_subtitle_test.

3 years agoMerge read_smpte_subtitle_test with smpte_subtitle_test.
Carl Hetherington [Wed, 14 Apr 2021 09:11:47 +0000 (11:11 +0200)]
Merge read_smpte_subtitle_test with smpte_subtitle_test.

3 years agoMissing file.
Carl Hetherington [Wed, 14 Apr 2021 07:57:00 +0000 (09:57 +0200)]
Missing file.

3 years agoC++11 tidying.
Carl Hetherington [Wed, 14 Apr 2021 07:46:55 +0000 (09:46 +0200)]
C++11 tidying.

3 years agoFix/hide some warnings.
Carl Hetherington [Tue, 13 Apr 2021 23:00:05 +0000 (01:00 +0200)]
Fix/hide some warnings.

3 years agoTidying a few things up.
Carl Hetherington [Tue, 13 Apr 2021 21:50:28 +0000 (23:50 +0200)]
Tidying a few things up.

3 years agoRemove ReelEncryptableAsset and tidy up a bit.
Carl Hetherington [Tue, 13 Apr 2021 21:36:22 +0000 (23:36 +0200)]
Remove ReelEncryptableAsset and tidy up a bit.

3 years agoMake ReelAsset the parent of ReelFileAsset.
Carl Hetherington [Mon, 12 Apr 2021 23:38:56 +0000 (01:38 +0200)]
Make ReelAsset the parent of ReelFileAsset.