2 Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <boost/noncopyable.hpp>
21 #include <boost/filesystem.hpp>
22 #include <dcp/picture_mxf_writer.h>
28 /** @class EncodedData
29 * @brief Container for J2K-encoded data.
31 class EncodedData : public boost::noncopyable
34 /** @param s Size of data, in bytes */
37 EncodedData (boost::filesystem::path);
39 virtual ~EncodedData ();
41 void send (boost::shared_ptr<Socket> socket);
42 void write (boost::shared_ptr<const Film>, int, Eyes) const;
43 void write_info (boost::shared_ptr<const Film>, int, Eyes, dcp::FrameInfo) const;
46 uint8_t* data () const {
50 /** @return data size, in bytes */
56 uint8_t* _data; ///< data
57 int _size; ///< data size in bytes
60 /** @class LocallyEncodedData
61 * @brief EncodedData that was encoded locally; this class
62 * just keeps a pointer to the data, but does no memory
65 class LocallyEncodedData : public EncodedData
68 /** @param d Data (which will be copied by this class)
69 * @param s Size of data, in bytes.
71 LocallyEncodedData (uint8_t* d, int s);
74 /** @class RemotelyEncodedData
75 * @brief EncodedData that is being read from a remote server;
76 * this class allocates and manages memory for the data.
78 class RemotelyEncodedData : public EncodedData
81 RemotelyEncodedData (int s);