2 Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
3 Taken from code Copyright (C) 2010-2011 Terrence Meiczinger
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "server_description.h"
24 #include <libcxml/cxml.h>
26 /** @file src/dcp_video_frame.h
27 * @brief A single frame of video destined for a DCP.
34 * @brief A single frame of video destined for a DCP.
36 * Given an Image and some settings, this class knows how to encode
37 * the image to J2K either on the local host or on a remote server.
39 * Objects of this class are used for the queue that we keep
40 * of images that require encoding.
42 class DCPVideo : public boost::noncopyable
45 DCPVideo (boost::shared_ptr<const PlayerVideo>, int, int, int, Resolution, boost::shared_ptr<Log>);
46 DCPVideo (boost::shared_ptr<const PlayerVideo>, cxml::ConstNodePtr, boost::shared_ptr<Log>);
48 Data encode_locally (dcp::NoteHandler note);
49 Data encode_remotely (ServerDescription);
57 bool same (boost::shared_ptr<const DCPVideo> other) const;
59 static boost::shared_ptr<dcp::OpenJPEGImage> convert_to_xyz (boost::shared_ptr<const PlayerVideo> frame, dcp::NoteHandler note);
63 void add_metadata (xmlpp::Element *) const;
65 boost::shared_ptr<const PlayerVideo> _frame;
66 int _index; ///< frame index within the DCP's intrinsic duration
67 int _frames_per_second; ///< Frames per second that we will use for the DCP
68 int _j2k_bandwidth; ///< J2K bandwidth to use
69 Resolution _resolution; ///< Resolution (2K or 4K)
71 boost::shared_ptr<Log> _log; ///< log