diff options
| -rw-r--r-- | benchmark/j2k_transcode.cc | 7 | ||||
| -rw-r--r-- | src/array_data.cc (renamed from src/data.cc) | 20 | ||||
| -rw-r--r-- | src/array_data.h (renamed from src/data.h) | 22 | ||||
| -rw-r--r-- | src/interop_subtitle_asset.cc | 2 | ||||
| -rw-r--r-- | src/j2k.cc | 17 | ||||
| -rw-r--r-- | src/j2k.h | 7 | ||||
| -rw-r--r-- | src/smpte_subtitle_asset.cc | 4 | ||||
| -rw-r--r-- | src/subtitle_asset.cc | 6 | ||||
| -rw-r--r-- | src/subtitle_asset.h | 9 | ||||
| -rw-r--r-- | src/subtitle_asset_internal.h | 7 | ||||
| -rw-r--r-- | src/subtitle_image.cc | 6 | ||||
| -rw-r--r-- | src/subtitle_image.h | 13 | ||||
| -rw-r--r-- | src/util.cc | 2 | ||||
| -rw-r--r-- | src/util.h | 5 | ||||
| -rw-r--r-- | src/verify.cc | 2 | ||||
| -rw-r--r-- | src/wscript | 6 | ||||
| -rw-r--r-- | test/frame_info_hash_test.cc | 2 | ||||
| -rw-r--r-- | test/make_digest_test.cc | 5 | ||||
| -rw-r--r-- | test/read_interop_subtitle_test.cc | 2 | ||||
| -rw-r--r-- | test/read_smpte_subtitle_test.cc | 2 | ||||
| -rw-r--r-- | test/test.cc | 6 | ||||
| -rw-r--r-- | test/test.h | 1 | ||||
| -rw-r--r-- | test/verify_test.cc | 14 | ||||
| -rw-r--r-- | test/write_subtitle_test.cc | 4 | ||||
| -rw-r--r-- | tools/dcpdumpsub.cc | 4 |
25 files changed, 91 insertions, 84 deletions
diff --git a/benchmark/j2k_transcode.cc b/benchmark/j2k_transcode.cc index 1a814b69..7bdf357d 100644 --- a/benchmark/j2k_transcode.cc +++ b/benchmark/j2k_transcode.cc @@ -31,7 +31,8 @@ files in the program, then also delete it here. */ -#include "data.h" + +#include "array_data.h" #include "util.h" #include "version.h" #include "j2k.h" @@ -87,12 +88,12 @@ main (int argc, char* argv[]) int const count = 100; int const j2k_bandwidth = 100000000; - dcp::Data j2k (boost::filesystem::path (argv[1]) / "thx.j2c"); + dcp::ArrayData j2k (boost::filesystem::path (argv[1]) / "thx.j2c"); Timer decompress; Timer compress; - dcp::Data recomp; + dcp::ArrayData recomp; for (int i = 0; i < count; ++i) { decompress.start (); shared_ptr<dcp::OpenJPEGImage> xyz = dcp::decompress_j2k (j2k, 0); diff --git a/src/data.cc b/src/array_data.cc index aed8a4d2..9d8473b8 100644 --- a/src/data.cc +++ b/src/array_data.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2015-2020 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -31,7 +31,7 @@ files in the program, then also delete it here. */ -#include "data.h" +#include "array_data.h" #include "util.h" #include "exceptions.h" #include <cstdio> @@ -40,34 +40,34 @@ using boost::shared_array; using namespace dcp; -Data::Data () +ArrayData::ArrayData () : _size (0) { } -Data::Data (int size) +ArrayData::ArrayData (int size) : _data (new uint8_t[size]) , _size (size) { } -Data::Data (uint8_t const * data, int size) +ArrayData::ArrayData (uint8_t const * data, int size) : _data (new uint8_t[size]) , _size (size) { memcpy (_data.get(), data, size); } -Data::Data (shared_array<uint8_t> data, int size) +ArrayData::ArrayData (shared_array<uint8_t> data, int size) : _data (data) , _size (size) { } -Data::Data (boost::filesystem::path file) +ArrayData::ArrayData (boost::filesystem::path file) { _size = boost::filesystem::file_size (file); _data.reset (new uint8_t[_size]); @@ -87,7 +87,7 @@ Data::Data (boost::filesystem::path file) } void -Data::write (boost::filesystem::path file) const +ArrayData::write (boost::filesystem::path file) const { FILE* f = fopen_boost (file, "wb"); if (!f) { @@ -102,14 +102,14 @@ Data::write (boost::filesystem::path file) const } void -Data::write_via_temp (boost::filesystem::path temp, boost::filesystem::path final) const +ArrayData::write_via_temp (boost::filesystem::path temp, boost::filesystem::path final) const { write (temp); boost::filesystem::rename (temp, final); } bool -dcp::operator== (Data const & a, Data const & b) +dcp::operator== (ArrayData const & a, ArrayData const & b) { return (a.size() == b.size() && memcmp (a.data().get(), b.data().get(), a.size()) == 0); } diff --git a/src/data.h b/src/array_data.h index fd6eb22b..06ccec27 100644 --- a/src/data.h +++ b/src/array_data.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2015-2020 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -31,8 +31,8 @@ files in the program, then also delete it here. */ -#ifndef LIBDCP_DATA_H -#define LIBDCP_DATA_H +#ifndef LIBDCP_ARRAY_DATA_H +#define LIBDCP_ARRAY_DATA_H #include <boost/shared_array.hpp> #include <boost/filesystem.hpp> @@ -40,16 +40,16 @@ namespace dcp { -class Data +class ArrayData { public: - Data (); - explicit Data (int size); - Data (uint8_t const * data, int size); - Data (boost::shared_array<uint8_t> data, int size); - explicit Data (boost::filesystem::path file); + ArrayData (); + explicit ArrayData (int size); + ArrayData (uint8_t const * data, int size); + ArrayData (boost::shared_array<uint8_t> data, int size); + explicit ArrayData (boost::filesystem::path file); - virtual ~Data () {} + virtual ~ArrayData () {} void write (boost::filesystem::path file) const; void write_via_temp (boost::filesystem::path temp, boost::filesystem::path final) const; @@ -72,7 +72,7 @@ private: int _size; }; -bool operator==(Data const & a, Data const & b); +bool operator==(ArrayData const & a, ArrayData const & b); } diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index f7e38965..316fb08a 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -271,7 +271,7 @@ InteropSubtitleAsset::add_to_pkl (shared_ptr<PKL> pkl, boost::filesystem::path r BOOST_FOREACH (shared_ptr<dcp::Subtitle> i, _subtitles) { shared_ptr<dcp::SubtitleImage> im = dynamic_pointer_cast<dcp::SubtitleImage> (i); if (im) { - Data png_image = im->png_image (); + ArrayData png_image = im->png_image (); pkl->add_asset (im->id(), optional<string>(), make_digest(png_image), png_image.size(), "image/png"); } } @@ -31,10 +31,11 @@ files in the program, then also delete it here. */ + +#include "array_data.h" #include "j2k.h" #include "exceptions.h" #include "openjpeg_image.h" -#include "data.h" #include "dcp_assert.h" #include "compose.hpp" #include <openjpeg.h> @@ -49,7 +50,7 @@ using boost::shared_array; using namespace dcp; shared_ptr<dcp::OpenJPEGImage> -dcp::decompress_j2k (Data data, int reduce) +dcp::decompress_j2k (ArrayData data, int reduce) { return dcp::decompress_j2k (data.data().get(), data.size(), reduce); } @@ -242,13 +243,13 @@ public: return OPJ_TRUE; } - Data data () const + ArrayData data () const { return _data; } private: - Data _data; + ArrayData _data; OPJ_SIZE_T _offset; }; @@ -273,7 +274,7 @@ seek_function (OPJ_OFF_T nb_bytes, void* data) /** @xyz Picture to compress. Parts of xyz's data WILL BE OVERWRITTEN by libopenjpeg so xyz cannot be re-used * after this call; see opj_j2k_encode where if l_reuse_data is false it will set l_tilec->data = l_img_comp->data. */ -Data +ArrayData dcp::compress_j2k (shared_ptr<const OpenJPEGImage> xyz, int bandwidth, int frames_per_second, bool threed, bool fourk, string comment) { /* get a J2K compressor handle */ @@ -344,7 +345,7 @@ dcp::compress_j2k (shared_ptr<const OpenJPEGImage> xyz, int bandwidth, int frame throw MiscError ("could not end JPEG2000 encoding"); } - Data enc (buffer->data ()); + ArrayData enc (buffer->data ()); opj_stream_destroy (stream); opj_destroy_codec (encoder); @@ -355,7 +356,7 @@ dcp::compress_j2k (shared_ptr<const OpenJPEGImage> xyz, int bandwidth, int frame #endif #ifdef LIBDCP_OPENJPEG1 -Data +ArrayData dcp::compress_j2k (shared_ptr<const OpenJPEGImage> xyz, int bandwidth, int frames_per_second, bool threed, bool fourk) { /* Set the max image and component sizes based on frame_rate */ @@ -462,7 +463,7 @@ dcp::compress_j2k (shared_ptr<const OpenJPEGImage> xyz, int bandwidth, int frame throw MiscError ("JPEG2000 encoding failed"); } - Data enc (cio->buffer, cio_tell (cio)); + ArrayData enc (cio->buffer, cio_tell (cio)); opj_cio_close (cio); free (parameters.cp_comment); @@ -31,7 +31,8 @@ files in the program, then also delete it here. */ -#include "data.h" + +#include "array_data.h" #include <boost/shared_ptr.hpp> #include <stdint.h> @@ -40,7 +41,7 @@ namespace dcp { class OpenJPEGImage; extern boost::shared_ptr<OpenJPEGImage> decompress_j2k (uint8_t* data, int64_t size, int reduce); -extern boost::shared_ptr<OpenJPEGImage> decompress_j2k (Data data, int reduce); -extern Data compress_j2k (boost::shared_ptr<const OpenJPEGImage>, int bandwith, int frames_per_second, bool threed, bool fourk, std::string comment = "libdcp"); +extern boost::shared_ptr<OpenJPEGImage> decompress_j2k (ArrayData data, int reduce); +extern ArrayData compress_j2k (boost::shared_ptr<const OpenJPEGImage>, int bandwith, int frames_per_second, bool threed, bool fourk, std::string comment = "libdcp"); } diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index cf0ed6c0..c9545052 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -227,7 +227,7 @@ SMPTESubtitleAsset::read_mxf_descriptor (shared_ptr<ASDCP::TimedText::MXFReader> } if (j != _load_font_nodes.end ()) { - _fonts.push_back (Font ((*j)->id, (*j)->urn, Data (data, buffer.Size ()))); + _fonts.push_back (Font ((*j)->id, (*j)->urn, ArrayData (data, buffer.Size ()))); } break; } @@ -239,7 +239,7 @@ SMPTESubtitleAsset::read_mxf_descriptor (shared_ptr<ASDCP::TimedText::MXFReader> } if (j != _subtitles.end()) { - dynamic_pointer_cast<SubtitleImage>(*j)->set_png_image (Data(data, buffer.Size())); + dynamic_pointer_cast<SubtitleImage>(*j)->set_png_image (ArrayData(data, buffer.Size())); } break; } diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 02350f00..c6d2e790 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -390,7 +390,7 @@ SubtitleAsset::maybe_add_subtitle (string text, list<ParseState> const & parse_s _subtitles.push_back ( shared_ptr<Subtitle> ( new SubtitleImage ( - Data (), + ArrayData (), standard == INTEROP ? text.substr(0, text.size() - 4) : text, ps.in.get(), ps.out.get(), @@ -647,10 +647,10 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* xml_root, int time_code_rate, S root->write_xml (xml_root, context); } -map<string, Data> +map<string, ArrayData> SubtitleAsset::font_data () const { - map<string, Data> out; + map<string, ArrayData> out; BOOST_FOREACH (Font const & i, _fonts) { out[i.load_id] = i.data; } diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index b66e88b1..063a2dfd 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -34,10 +34,11 @@ #ifndef LIBDCP_SUBTITLE_ASSET_H #define LIBDCP_SUBTITLE_ASSET_H + +#include "array_data.h" #include "asset.h" #include "dcp_time.h" #include "subtitle_string.h" -#include "data.h" #include <libcxml/cxml.h> #include <boost/shared_array.hpp> #include <map> @@ -94,7 +95,7 @@ public: virtual void add (boost::shared_ptr<Subtitle>); virtual void add_font (std::string id, boost::filesystem::path file) = 0; - std::map<std::string, Data> font_data () const; + std::map<std::string, ArrayData> font_data () const; std::map<std::string, boost::filesystem::path> font_filenames () const; virtual void write (boost::filesystem::path) const = 0; @@ -163,7 +164,7 @@ protected: , file (file_) {} - Font (std::string load_id_, std::string uuid_, Data data_) + Font (std::string load_id_, std::string uuid_, ArrayData data_) : load_id (load_id_) , uuid (uuid_) , data (data_) @@ -171,7 +172,7 @@ protected: std::string load_id; std::string uuid; - Data data; + ArrayData data; /** .ttf file that this data was last written to, if applicable */ mutable boost::optional<boost::filesystem::path> file; }; diff --git a/src/subtitle_asset_internal.h b/src/subtitle_asset_internal.h index 366123c5..e5c8e141 100644 --- a/src/subtitle_asset_internal.h +++ b/src/subtitle_asset_internal.h @@ -34,10 +34,11 @@ #ifndef LIBDCP_SUBTITLE_ASSET_INTERNAL_H #define LIBDCP_SUBTITLE_ASSET_INTERNAL_H + +#include "array_data.h" #include "raw_convert.h" #include "types.h" #include "dcp_time.h" -#include "data.h" #include <libxml++/libxml++.h> #include <boost/foreach.hpp> @@ -167,7 +168,7 @@ private: class Image : public Part { public: - Image (boost::shared_ptr<Part> parent, std::string id, Data png_data, HAlign h_align, float h_position, VAlign v_align, float v_position) + Image (boost::shared_ptr<Part> parent, std::string id, ArrayData png_data, HAlign h_align, float h_position, VAlign v_align, float v_position) : Part (parent) , _png_data (png_data) , _id (id) @@ -180,7 +181,7 @@ public: xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const; private: - Data _png_data; + ArrayData _png_data; std::string _id; ///< the ID of this image HAlign _h_align; float _h_position; diff --git a/src/subtitle_image.cc b/src/subtitle_image.cc index e1f123bc..d8215850 100644 --- a/src/subtitle_image.cc +++ b/src/subtitle_image.cc @@ -39,7 +39,7 @@ using std::string; using namespace dcp; SubtitleImage::SubtitleImage ( - Data png_image, + ArrayData png_image, Time in, Time out, float h_position, @@ -57,7 +57,7 @@ SubtitleImage::SubtitleImage ( } SubtitleImage::SubtitleImage ( - Data png_image, + ArrayData png_image, string id, Time in, Time out, @@ -79,7 +79,7 @@ void SubtitleImage::read_png_file (boost::filesystem::path file) { _file = file; - _png_image = Data (file); + _png_image = ArrayData (file); } void diff --git a/src/subtitle_image.h b/src/subtitle_image.h index 3c4b3fe8..76c34765 100644 --- a/src/subtitle_image.h +++ b/src/subtitle_image.h @@ -38,9 +38,10 @@ #ifndef LIBDCP_SUBTITLE_IMAGE_H #define LIBDCP_SUBTITLE_IMAGE_H + +#include "array_data.h" #include "types.h" #include "subtitle.h" -#include "data.h" #include "dcp_time.h" #include <boost/optional.hpp> #include <string> @@ -54,7 +55,7 @@ class SubtitleImage : public Subtitle { public: SubtitleImage ( - Data png_image, + ArrayData png_image, Time in, Time out, float h_position, @@ -66,7 +67,7 @@ public: ); SubtitleImage ( - Data png_image, + ArrayData png_image, std::string id, Time in, Time out, @@ -78,11 +79,11 @@ public: Time fade_down_time ); - Data png_image () const { + ArrayData png_image () const { return _png_image; } - void set_png_image (Data png) { + void set_png_image (ArrayData png) { _png_image = png; } @@ -99,7 +100,7 @@ public: } private: - Data _png_image; + ArrayData _png_image; std::string _id; mutable boost::optional<boost::filesystem::path> _file; }; diff --git a/src/util.cc b/src/util.cc index 211f03f8..b62def07 100644 --- a/src/util.cc +++ b/src/util.cc @@ -98,7 +98,7 @@ dcp::make_uuid () } string -dcp::make_digest (Data data) +dcp::make_digest (ArrayData data) { SHA_CTX sha; SHA1_Init (&sha); @@ -38,8 +38,9 @@ * @brief Utility methods. */ + +#include "array_data.h" #include "types.h" -#include "data.h" #include "local_time.h" #include <asdcp/KM_log.h> #include <boost/shared_ptr.hpp> @@ -64,7 +65,7 @@ class OpenJPEGImage; extern std::string make_uuid (); extern std::string make_digest (boost::filesystem::path filename, boost::function<void (float)>); -extern std::string make_digest (Data data); +extern std::string make_digest (ArrayData data); extern bool empty_or_white_space (std::string s); extern bool ids_equal (std::string a, std::string b); extern std::string remove_urn_uuid (std::string raw); diff --git a/src/verify.cc b/src/verify.cc index aad6952f..55da95b6 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -598,7 +598,7 @@ dcp::verify ( /* Check that the CPL's hash corresponds to the PKL */ BOOST_FOREACH (shared_ptr<PKL> i, dcp->pkls()) { optional<string> h = i->hash(cpl->id()); - if (h && make_digest(Data(*cpl->file())) != *h) { + if (h && make_digest(ArrayData(*cpl->file())) != *h) { notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::CPL_HASH_INCORRECT)); } } diff --git a/src/wscript b/src/wscript index 38aa784c..85d4a6cb 100644 --- a/src/wscript +++ b/src/wscript @@ -1,5 +1,5 @@ # -# Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net> +# Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ from waflib import TaskGen def build(bld): source = """ + array_data.cc asset.cc asset_factory.cc asset_writer.cc @@ -46,7 +47,6 @@ def build(bld): colour_conversion.cc combine.cc cpl.cc - data.cc dcp.cc dcp_time.cc decrypted_kdm.cc @@ -113,6 +113,7 @@ def build(bld): """ headers = """ + array_data.h asset.h asset_reader.h asset_writer.h @@ -131,7 +132,6 @@ def build(bld): dcp.h dcp_assert.h dcp_time.h - data.h decrypted_kdm.h decrypted_kdm_key.h encrypted_kdm.h diff --git a/test/frame_info_hash_test.cc b/test/frame_info_hash_test.cc index ed440af5..3070ecd6 100644 --- a/test/frame_info_hash_test.cc +++ b/test/frame_info_hash_test.cc @@ -50,7 +50,7 @@ check (unsigned int* seed, shared_ptr<dcp::PictureAssetWriter> writer, string ha } } - dcp::Data data = dcp::compress_j2k (xyz, 100000000, 24, false, false); + dcp::ArrayData data = dcp::compress_j2k (xyz, 100000000, 24, false, false); dcp::FrameInfo info = writer->write (data.data().get(), data.size()); BOOST_CHECK_EQUAL (info.hash, hash); diff --git a/test/make_digest_test.cc b/test/make_digest_test.cc index ec54c93c..11c410d0 100644 --- a/test/make_digest_test.cc +++ b/test/make_digest_test.cc @@ -31,7 +31,8 @@ files in the program, then also delete it here. */ -#include "data.h" + +#include "array_data.h" #include "util.h" #include <boost/bind.hpp> #include <boost/test/unit_test.hpp> @@ -48,7 +49,7 @@ BOOST_AUTO_TEST_CASE (make_digest_test) /* Make a big file with some random data */ srand (1); int const N = 256 * 1024 * 1024; - dcp::Data data (N); + dcp::ArrayData data (N); uint8_t* p = data.data().get(); for (int i = 0; i < N; ++i) { *p++ = rand() & 0xff; diff --git a/test/read_interop_subtitle_test.cc b/test/read_interop_subtitle_test.cc index 19d1cad8..2860a725 100644 --- a/test/read_interop_subtitle_test.cc +++ b/test/read_interop_subtitle_test.cc @@ -620,5 +620,5 @@ BOOST_AUTO_TEST_CASE (read_interop_subtitle_test3) BOOST_REQUIRE_EQUAL (subs.subtitles().size(), 1); shared_ptr<dcp::SubtitleImage> si = dynamic_pointer_cast<dcp::SubtitleImage>(subs.subtitles().front()); BOOST_REQUIRE (si); - BOOST_CHECK (si->png_image() == dcp::Data("test/data/sub.png")); + BOOST_CHECK (si->png_image() == dcp::ArrayData("test/data/sub.png")); } diff --git a/test/read_smpte_subtitle_test.cc b/test/read_smpte_subtitle_test.cc index ca08e117..9cf1451d 100644 --- a/test/read_smpte_subtitle_test.cc +++ b/test/read_smpte_subtitle_test.cc @@ -129,5 +129,5 @@ BOOST_AUTO_TEST_CASE (read_smpte_subtitle_test3) BOOST_REQUIRE_EQUAL (subs.subtitles().size(), 1); shared_ptr<dcp::SubtitleImage> si = dynamic_pointer_cast<dcp::SubtitleImage>(subs.subtitles().front()); BOOST_REQUIRE (si); - BOOST_CHECK (si->png_image() == dcp::Data("test/data/sub.png")); + BOOST_CHECK (si->png_image() == dcp::ArrayData("test/data/sub.png")); } diff --git a/test/test.cc b/test/test.cc index 25d7726d..245dd91c 100644 --- a/test/test.cc +++ b/test/test.cc @@ -344,7 +344,7 @@ make_simple_with_interop_subs (boost::filesystem::path path) subs->add (simple_subtitle()); boost::filesystem::create_directory (path / "subs"); - dcp::Data data(4096); + dcp::ArrayData data(4096); data.write (path / "subs" / "font.ttf"); subs->add_font ("afont", path / "subs" / "font.ttf"); subs->write (path / "subs" / "subs.xml"); @@ -364,7 +364,7 @@ make_simple_with_smpte_subs (boost::filesystem::path path) shared_ptr<dcp::SMPTESubtitleAsset> subs(new dcp::SMPTESubtitleAsset()); subs->add (simple_subtitle()); - dcp::Data data(4096); + dcp::ArrayData data(4096); subs->write (path / "subs.mxf"); shared_ptr<dcp::ReelSubtitleAsset> reel_subs(new dcp::ReelSubtitleAsset(subs, dcp::Fraction(24, 1), 240, 0)); @@ -422,7 +422,7 @@ shared_ptr<dcp::ReelAsset> black_picture_asset (boost::filesystem::path dir, int frames) { shared_ptr<dcp::OpenJPEGImage> image = black_image (); - dcp::Data frame = dcp::compress_j2k (image, 100000000, 24, false, false); + dcp::ArrayData frame = dcp::compress_j2k (image, 100000000, 24, false, false); BOOST_REQUIRE (frame.size() < 230000000 / (24 * 8)); shared_ptr<dcp::MonoPictureAsset> asset(new dcp::MonoPictureAsset(dcp::Fraction(24, 1), dcp::SMPTE)); diff --git a/test/test.h b/test/test.h index 9009a58b..ea697e40 100644 --- a/test/test.h +++ b/test/test.h @@ -19,7 +19,6 @@ #include "cpl.h" -#include "data.h" #include "dcp.h" #include "reel.h" #include "reel_subtitle_asset.h" diff --git a/test/verify_test.cc b/test/verify_test.cc index 645393a0..3e2a665f 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -509,7 +509,7 @@ BOOST_AUTO_TEST_CASE (verify_test14) static void -dcp_from_frame (dcp::Data const& frame, boost::filesystem::path dir) +dcp_from_frame (dcp::ArrayData const& frame, boost::filesystem::path dir) { shared_ptr<dcp::MonoPictureAsset> asset(new dcp::MonoPictureAsset(dcp::Fraction(24, 1), dcp::SMPTE)); boost::filesystem::create_directories (dir); @@ -537,11 +537,11 @@ BOOST_AUTO_TEST_CASE (verify_test15) /* Compress a black image */ shared_ptr<dcp::OpenJPEGImage> image = black_image (); - dcp::Data frame = dcp::compress_j2k (image, 100000000, 24, false, false); + dcp::ArrayData frame = dcp::compress_j2k (image, 100000000, 24, false, false); BOOST_REQUIRE (frame.size() < too_big); /* Place it in a bigger block with some zero padding at the end */ - dcp::Data oversized_frame(too_big); + dcp::ArrayData oversized_frame(too_big); memcpy (oversized_frame.data().get(), frame.data().get(), frame.size()); memset (oversized_frame.data().get() + frame.size(), 0, too_big - frame.size()); @@ -564,11 +564,11 @@ BOOST_AUTO_TEST_CASE (verify_test16) /* Compress a black image */ shared_ptr<dcp::OpenJPEGImage> image = black_image (); - dcp::Data frame = dcp::compress_j2k (image, 100000000, 24, false, false); + dcp::ArrayData frame = dcp::compress_j2k (image, 100000000, 24, false, false); BOOST_REQUIRE (frame.size() < nearly_too_big); /* Place it in a bigger block with some zero padding at the end */ - dcp::Data oversized_frame(nearly_too_big); + dcp::ArrayData oversized_frame(nearly_too_big); memcpy (oversized_frame.data().get(), frame.data().get(), frame.size()); memset (oversized_frame.data().get() + frame.size(), 0, nearly_too_big - frame.size()); @@ -589,7 +589,7 @@ BOOST_AUTO_TEST_CASE (verify_test17) { /* Compress a black image */ shared_ptr<dcp::OpenJPEGImage> image = black_image (); - dcp::Data frame = dcp::compress_j2k (image, 100000000, 24, false, false); + dcp::ArrayData frame = dcp::compress_j2k (image, 100000000, 24, false, false); BOOST_REQUIRE (frame.size() < 230000000 / (24 * 8)); boost::filesystem::path const dir("build/test/verify_test17"); @@ -716,7 +716,7 @@ BOOST_AUTO_TEST_CASE (verify_test22) boost::filesystem::create_directories (ov_dir); shared_ptr<dcp::OpenJPEGImage> image = black_image (); - dcp::Data frame = dcp::compress_j2k (image, 100000000, 24, false, false); + dcp::ArrayData frame = dcp::compress_j2k (image, 100000000, 24, false, false); BOOST_REQUIRE (frame.size() < 230000000 / (24 * 8)); dcp_from_frame (frame, ov_dir); diff --git a/test/write_subtitle_test.cc b/test/write_subtitle_test.cc index 4bdc6e9d..1f5ded21 100644 --- a/test/write_subtitle_test.cc +++ b/test/write_subtitle_test.cc @@ -341,7 +341,7 @@ BOOST_AUTO_TEST_CASE (write_interop_subtitle_test3) c->add ( shared_ptr<dcp::Subtitle> ( new dcp::SubtitleImage ( - dcp::Data ("test/data/sub.png"), + dcp::ArrayData ("test/data/sub.png"), dcp::Time (0, 4, 9, 22, 24), dcp::Time (0, 4, 11, 22, 24), 0, @@ -705,7 +705,7 @@ BOOST_AUTO_TEST_CASE (write_smpte_subtitle_test3) c.add ( shared_ptr<dcp::Subtitle> ( new dcp::SubtitleImage ( - dcp::Data ("test/data/sub.png"), + dcp::ArrayData ("test/data/sub.png"), dcp::Time (0, 4, 9, 22, 24), dcp::Time (0, 4, 11, 22, 24), 0, diff --git a/tools/dcpdumpsub.cc b/tools/dcpdumpsub.cc index 6f0c5f6f..026b1a4d 100644 --- a/tools/dcpdumpsub.cc +++ b/tools/dcpdumpsub.cc @@ -130,8 +130,8 @@ main (int argc, char* argv[]) cout << sub.xml_as_string() << "\n"; if (extract_fonts) { - map<string, dcp::Data> fonts = sub.font_data (); - for (map<string, dcp::Data>::const_iterator i = fonts.begin(); i != fonts.end(); ++i) { + map<string, dcp::ArrayData> fonts = sub.font_data (); + for (map<string, dcp::ArrayData>::const_iterator i = fonts.begin(); i != fonts.end(); ++i) { FILE* f = dcp::fopen_boost (i->first + ".ttf", "wb"); if (!f) { cerr << "Could not open font file " << i->first << ".ttf for writing"; |
