#include "sound_asset.h"
#include "sound_asset_writer.h"
#include "reel.h"
-#include "file.h"
#include "reel_mono_picture_asset.h"
#include "reel_sound_asset.h"
#include <cmath>
std::shared_ptr<dcp::PictureAssetWriter> picture_writer = picture_asset->start_write ("DCP/picture.mxf", false);
/* Write 24 frames of the same JPEG2000 file */
- dcp::File picture ("examples/help.j2c");
+ dcp::ArrayData picture ("examples/help.j2c");
for (int i = 0; i < 24; ++i) {
picture_writer->write (picture.data(), picture.size());
}
+++ /dev/null
-/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
-
- This file is part of libdcp.
-
- libdcp is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- libdcp is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with libdcp. If not, see <http://www.gnu.org/licenses/>.
-
- In addition, as a special exception, the copyright holders give
- permission to link the code of portions of this program with the
- OpenSSL library under certain conditions as described in each
- individual source file, and distribute linked combinations
- including the two.
-
- You must obey the GNU General Public License in all respects
- for all of the code used other than OpenSSL. If you modify
- file(s) with this exception, you may extend this exception to your
- version of the file(s), but you are not obligated to do so. If you
- do not wish to do so, delete this exception statement from your
- version. If you delete this exception statement from all source
- files in the program, then also delete it here.
-*/
-
-/** @file src/file.cc
- * @brief File class.
- */
-
-#include "file.h"
-#include "util.h"
-#include "dcp_assert.h"
-#include "compose.hpp"
-#include <stdio.h>
-
-using namespace dcp;
-
-/** Read a file into memory.
- * @param file to read.
- */
-File::File (boost::filesystem::path file)
-{
- _size = boost::filesystem::file_size (file);
- _data = new uint8_t[_size];
- FILE* f = dcp::fopen_boost (file, "rb");
- DCP_ASSERT (f);
- int const N = fread (_data, 1, _size, f);
- if (N != _size) {
- if (ferror(f)) {
- fclose (f);
- throw FileError (String::compose("fread error %1", errno), file, errno);
- } else {
- fclose (f);
- throw FileError ("unexpected short read", file, -1);
- }
- }
- fclose (f);
-}
-
-/** File destructor */
-File::~File ()
-{
- delete[] _data;
-}
+++ /dev/null
-/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
-
- This file is part of libdcp.
-
- libdcp is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- libdcp is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with libdcp. If not, see <http://www.gnu.org/licenses/>.
-
- In addition, as a special exception, the copyright holders give
- permission to link the code of portions of this program with the
- OpenSSL library under certain conditions as described in each
- individual source file, and distribute linked combinations
- including the two.
-
- You must obey the GNU General Public License in all respects
- for all of the code used other than OpenSSL. If you modify
- file(s) with this exception, you may extend this exception to your
- version of the file(s), but you are not obligated to do so. If you
- do not wish to do so, delete this exception statement from your
- version. If you delete this exception statement from all source
- files in the program, then also delete it here.
-*/
-
-/** @file src/file.h
- * @brief File class.
- */
-
-#ifndef LIBDCP_FILE_H
-#define LIBDCP_FILE_H
-
-#include <boost/filesystem.hpp>
-#include <boost/noncopyable.hpp>
-
-namespace dcp {
-
-/** @class File
- * @brief Helper class which loads a file into memory.
- */
-class File : public boost::noncopyable
-{
-public:
- explicit File (boost::filesystem::path file);
- ~File ();
-
- uint8_t* data () const {
- return _data;
- }
-
- int64_t size () const {
- return _size;
- }
-
-private:
- uint8_t* _data; ///< file's data
- int64_t _size; ///< data size in bytes
-};
-
-}
-
-#endif
decrypted_kdm_key.cc
encrypted_kdm.cc
exceptions.cc
- file.cc
font_asset.cc
fsk.cc
gamma_transfer_function.cc
#include "atmos_asset.h"
#include "reel.h"
#include "test.h"
-#include "file.h"
#include "reel_mono_picture_asset.h"
#include "reel_stereo_picture_asset.h"
#include "reel_sound_asset.h"
shared_ptr<dcp::StereoPictureAsset> mp (new dcp::StereoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE));
mp->set_metadata (mxf_meta);
shared_ptr<dcp::PictureAssetWriter> picture_writer = mp->start_write ("build/test/DCP/dcp_test2/video.mxf", false);
- dcp::File j2c ("test/data/flat_red.j2c");
+ dcp::ArrayData j2c ("test/data/flat_red.j2c");
for (int i = 0; i < 24; ++i) {
/* Left */
picture_writer->write (j2c.data (), j2c.size ());
shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE));
mp->set_metadata (mxf_meta);
shared_ptr<dcp::PictureAssetWriter> picture_writer = mp->start_write ("build/test/DCP/dcp_test5/video.mxf", false);
- dcp::File j2c ("test/data/flat_red.j2c");
+ dcp::ArrayData j2c ("test/data/flat_red.j2c");
for (int i = 0; i < 24; ++i) {
picture_writer->write (j2c.data (), j2c.size ());
}
#include "sound_asset.h"
#include "reel.h"
#include "test.h"
-#include "file.h"
#include "subtitle_asset.h"
#include "reel_mono_picture_asset.h"
#include "reel_sound_asset.h"
mp->set_key (key);
shared_ptr<dcp::PictureAssetWriter> writer = mp->start_write ("build/test/DCP/encryption_test/video.mxf", false);
- dcp::File j2c ("test/data/flat_red.j2c");
+ dcp::ArrayData j2c ("test/data/flat_red.j2c");
for (int i = 0; i < 24; ++i) {
writer->write (j2c.data (), j2c.size ());
}
#include "mono_picture_asset.h"
#include "reel_mono_picture_asset.h"
#include "reel.h"
-#include "file.h"
#include "types.h"
#include "picture_asset_writer.h"
#include <libcxml/cxml.h>
auto asset = make_shared<dcp::MonoPictureAsset>(dcp::Fraction(24, 1), dcp::SMPTE);
asset->set_key (dcp::Key());
auto writer = asset->start_write ("build/test/validity_period_test1.mxf", false);
- dcp::File frame ("test/data/flat_red.j2c");
+ dcp::ArrayData frame ("test/data/flat_red.j2c");
writer->write (frame.data(), frame.size());
auto reel = make_shared<dcp::Reel>();
reel->add(make_shared<dcp::ReelMonoPictureAsset>(asset, 0));
#include "mono_picture_asset_reader.h"
#include "reel_picture_asset.h"
#include "reel_mono_picture_asset.h"
-#include "file.h"
#include "openjpeg_image.h"
#include "rgb_xyz.h"
#include "colour_conversion.h"
shared_ptr<dcp::MonoPictureAsset> asset_A (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE));
shared_ptr<dcp::PictureAssetWriter> writer = asset_A->start_write (work_dir / "video.mxf", false);
- dcp::File j2c ("test/data/flat_red.j2c");
+ dcp::ArrayData j2c ("test/data/flat_red.j2c");
for (int i = 0; i < 24; ++i) {
writer->write (j2c.data (), j2c.size ());
}
#include "compose.hpp"
#include "cpl.h"
#include "dcp.h"
-#include "file.h"
#include "interop_subtitle_asset.h"
#include "mono_picture_asset.h"
#include "picture_asset_writer.h"
shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE));
mp->set_metadata (mxf_meta);
shared_ptr<dcp::PictureAssetWriter> picture_writer = mp->start_write (path / dcp::String::compose("video%1.mxf", suffix), false);
- dcp::File j2c ("test/data/flat_red.j2c");
+ dcp::ArrayData j2c ("test/data/flat_red.j2c");
for (int i = 0; i < 24; ++i) {
picture_writer->write (j2c.data (), j2c.size ());
}