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 */
36 EncodedData (uint8_t const * d, int s);
38 EncodedData (boost::filesystem::path);
40 virtual ~EncodedData ();
42 void send (boost::shared_ptr<Socket> socket);
43 void write (boost::shared_ptr<const Film>, int, Eyes) const;
44 void write_info (boost::shared_ptr<const Film>, int, Eyes, dcp::FrameInfo) const;
47 uint8_t* data () const {
51 /** @return data size, in bytes */
57 uint8_t* _data; ///< data
58 int _size; ///< data size in bytes
61 /** @class LocallyEncodedData
62 * @brief EncodedData that was encoded locally; this class
63 * just keeps a pointer to the data, but does no memory
66 class LocallyEncodedData : public EncodedData
69 /** @param d Data (which will be copied by this class)
70 * @param s Size of data, in bytes.
72 LocallyEncodedData (uint8_t* d, int s);
75 /** @class RemotelyEncodedData
76 * @brief EncodedData that is being read from a remote server;
77 * this class allocates and manages memory for the data.
79 class RemotelyEncodedData : public EncodedData
82 RemotelyEncodedData (int s);