summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-19 10:18:28 +0100
committerCarl Hetherington <cth@carlh.net>2022-12-19 10:19:05 +0100
commit8f20282208b6074048516bc80bc79f22a82d6e5a (patch)
treef8c4018be270a39cd639e0c58d0e9bc6e16f8029 /src
parente0f8983a07f7b082e065549c05f9a98d8a052362 (diff)
Add newly-required reader factories.
Diffstat (limited to 'src')
-rw-r--r--src/asset_factory.cc4
-rw-r--r--src/asset_reader.h3
-rw-r--r--src/atmos_asset.cc3
-rw-r--r--src/mono_picture_asset.cc8
-rw-r--r--src/smpte_subtitle_asset.cc9
-rw-r--r--src/sound_asset.cc11
-rw-r--r--src/stereo_picture_asset.cc8
7 files changed, 30 insertions, 16 deletions
diff --git a/src/asset_factory.cc b/src/asset_factory.cc
index 833d3d2b..fb1eb73d 100644
--- a/src/asset_factory.cc
+++ b/src/asset_factory.cc
@@ -60,8 +60,10 @@ dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_
(Interop / SMPTE)
*/
+ Kumu::FileReaderFactory factory;
+
ASDCP::EssenceType_t type;
- if (ASDCP::EssenceType (path.string().c_str(), type) != ASDCP::RESULT_OK) {
+ if (ASDCP::EssenceType(path.string().c_str(), type, factory) != ASDCP::RESULT_OK) {
throw ReadError("Could not find essence type", path.string());
}
switch (type) {
diff --git a/src/asset_reader.h b/src/asset_reader.h
index 6642a872..9f888372 100644
--- a/src/asset_reader.h
+++ b/src/asset_reader.h
@@ -96,7 +96,8 @@ private:
explicit AssetReader (Asset const * asset, boost::optional<Key> key, Standard standard)
: _crypto_context (new DecryptionContext(key, standard))
{
- _reader = new R ();
+ Kumu::FileReaderFactory factory;
+ _reader = new R(factory);
DCP_ASSERT (asset->file());
auto const r = _reader->OpenRead (asset->file()->string().c_str());
if (ASDCP_FAILURE(r)) {
diff --git a/src/atmos_asset.cc b/src/atmos_asset.cc
index 39f48845..6665be8a 100644
--- a/src/atmos_asset.cc
+++ b/src/atmos_asset.cc
@@ -67,7 +67,8 @@ AtmosAsset::AtmosAsset (boost::filesystem::path file)
: Asset (file)
, MXF (Standard::SMPTE)
{
- ASDCP::ATMOS::MXFReader reader;
+ Kumu::FileReaderFactory factory;
+ ASDCP::ATMOS::MXFReader reader(factory);
auto r = reader.OpenRead (file.string().c_str());
if (ASDCP_FAILURE (r)) {
boost::throw_exception (MXFFileError("could not open MXF file for reading", file.string(), r));
diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc
index 98e2fd55..4b3acbe1 100644
--- a/src/mono_picture_asset.cc
+++ b/src/mono_picture_asset.cc
@@ -64,7 +64,8 @@ using namespace dcp;
MonoPictureAsset::MonoPictureAsset (boost::filesystem::path file)
: PictureAsset (file)
{
- ASDCP::JP2K::MXFReader reader;
+ Kumu::FileReaderFactory factory;
+ ASDCP::JP2K::MXFReader reader(factory);
auto r = reader.OpenRead (file.string().c_str());
if (ASDCP_FAILURE(r)) {
boost::throw_exception (MXFFileError("could not open MXF file for reading", file.string(), r));
@@ -107,14 +108,15 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, No
return false;
}
- ASDCP::JP2K::MXFReader reader_A;
+ Kumu::FileReaderFactory factory;
+ ASDCP::JP2K::MXFReader reader_A(factory);
DCP_ASSERT (_file);
auto r = reader_A.OpenRead (_file->string().c_str());
if (ASDCP_FAILURE(r)) {
boost::throw_exception (MXFFileError("could not open MXF file for reading", _file->string(), r));
}
- ASDCP::JP2K::MXFReader reader_B;
+ ASDCP::JP2K::MXFReader reader_B(factory);
DCP_ASSERT (other->file ());
r = reader_B.OpenRead (other->file()->string().c_str());
if (ASDCP_FAILURE (r)) {
diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc
index 999c6eb2..1a1f79fe 100644
--- a/src/smpte_subtitle_asset.cc
+++ b/src/smpte_subtitle_asset.cc
@@ -90,7 +90,8 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file)
{
auto xml = make_shared<cxml::Document>("SubtitleReel");
- auto reader = make_shared<ASDCP::TimedText::MXFReader>();
+ Kumu::FileReaderFactory factory;
+ auto reader = make_shared<ASDCP::TimedText::MXFReader>(factory);
auto r = Kumu::RESULT_OK;
{
ASDCPErrorSuspender sus;
@@ -298,7 +299,8 @@ SMPTESubtitleAsset::set_key (Key key)
/* Our data was encrypted; now we can decrypt it */
- auto reader = make_shared<ASDCP::TimedText::MXFReader>();
+ Kumu::FileReaderFactory factory;
+ auto reader = make_shared<ASDCP::TimedText::MXFReader>(factory);
auto r = reader->OpenRead (_file->string().c_str ());
if (ASDCP_FAILURE (r)) {
boost::throw_exception (
@@ -331,7 +333,8 @@ SMPTESubtitleAsset::load_font_nodes () const
bool
SMPTESubtitleAsset::valid_mxf (boost::filesystem::path file)
{
- ASDCP::TimedText::MXFReader reader;
+ Kumu::FileReaderFactory factory;
+ ASDCP::TimedText::MXFReader reader(factory);
Kumu::DefaultLogSink().UnsetFilterFlag(Kumu::LOG_ALLOW_ALL);
auto r = reader.OpenRead (file.string().c_str ());
Kumu::DefaultLogSink().SetFilterFlag(Kumu::LOG_ALLOW_ALL);
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 8fcd35c4..419bc891 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -67,7 +67,8 @@ using namespace dcp;
SoundAsset::SoundAsset (boost::filesystem::path file)
: Asset (file)
{
- ASDCP::PCM::MXFReader reader;
+ Kumu::FileReaderFactory factory;
+ ASDCP::PCM::MXFReader reader(factory);
auto r = reader.OpenRead (file.string().c_str());
if (ASDCP_FAILURE(r)) {
boost::throw_exception (MXFFileError("could not open MXF file for reading", file.string(), r));
@@ -121,14 +122,15 @@ SoundAsset::SoundAsset (Fraction edit_rate, int sampling_rate, int channels, Lan
bool
SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note) const
{
- ASDCP::PCM::MXFReader reader_A;
+ Kumu::FileReaderFactory factory;
+ ASDCP::PCM::MXFReader reader_A(factory);
DCP_ASSERT (file());
auto r = reader_A.OpenRead (file()->string().c_str());
if (ASDCP_FAILURE(r)) {
boost::throw_exception (MXFFileError("could not open MXF file for reading", file()->string(), r));
}
- ASDCP::PCM::MXFReader reader_B;
+ ASDCP::PCM::MXFReader reader_B(factory);
r = reader_B.OpenRead (other->file()->string().c_str());
if (ASDCP_FAILURE (r)) {
boost::throw_exception (MXFFileError("could not open MXF file for reading", other->file()->string(), r));
@@ -254,7 +256,8 @@ SoundAsset::static_pkl_type (Standard standard)
bool
SoundAsset::valid_mxf (boost::filesystem::path file)
{
- ASDCP::PCM::MXFReader reader;
+ Kumu::FileReaderFactory factory;
+ ASDCP::PCM::MXFReader reader(factory);
Kumu::Result_t r = reader.OpenRead (file.string().c_str());
return !ASDCP_FAILURE (r);
}
diff --git a/src/stereo_picture_asset.cc b/src/stereo_picture_asset.cc
index aba8ce0b..b1e79cf1 100644
--- a/src/stereo_picture_asset.cc
+++ b/src/stereo_picture_asset.cc
@@ -57,7 +57,8 @@ using namespace dcp;
StereoPictureAsset::StereoPictureAsset (boost::filesystem::path file)
: PictureAsset (file)
{
- ASDCP::JP2K::MXFSReader reader;
+ Kumu::FileReaderFactory factory;
+ ASDCP::JP2K::MXFSReader reader(factory);
auto r = reader.OpenRead (file.string().c_str());
if (ASDCP_FAILURE(r)) {
boost::throw_exception (MXFFileError("could not open MXF file for reading", file.string(), r));
@@ -103,14 +104,15 @@ StereoPictureAsset::start_read () const
bool
StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note) const
{
- ASDCP::JP2K::MXFSReader reader_A;
+ Kumu::FileReaderFactory factory;
+ ASDCP::JP2K::MXFSReader reader_A(factory);
DCP_ASSERT (file());
auto r = reader_A.OpenRead (file()->string().c_str());
if (ASDCP_FAILURE (r)) {
boost::throw_exception (MXFFileError ("could not open MXF file for reading", file()->string(), r));
}
- ASDCP::JP2K::MXFSReader reader_B;
+ ASDCP::JP2K::MXFSReader reader_B(factory);
DCP_ASSERT (other->file());
r = reader_B.OpenRead (other->file()->string().c_str());
if (ASDCP_FAILURE (r)) {