2 Copyright (C) 2012 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.
21 #include <boost/shared_ptr.hpp>
22 #include <boost/thread.hpp>
23 #include <boost/thread/condition.hpp>
30 class MonoPictureAsset;
31 class MonoPictureAssetWriter;
33 class SoundAssetWriter;
39 Writer (boost::shared_ptr<Film>);
41 void write (boost::shared_ptr<const EncodedData>, int);
42 void write (boost::shared_ptr<const AudioBuffers>);
49 void check_existing_picture_mxf ();
51 boost::shared_ptr<Film> _film;
52 int _first_nonexistant_frame;
54 boost::thread* _thread;
56 std::list<std::pair<boost::shared_ptr<const EncodedData>, int> > _queue;
57 mutable boost::mutex _mutex;
58 boost::condition _condition;
59 boost::shared_ptr<const EncodedData> _last_written;
60 std::list<int> _pending;
61 int _last_written_frame;
62 static const unsigned int _maximum_frames_in_memory;
64 boost::shared_ptr<libdcp::MonoPictureAsset> _picture_asset;
65 boost::shared_ptr<libdcp::MonoPictureAssetWriter> _picture_asset_writer;
66 boost::shared_ptr<libdcp::SoundAsset> _sound_asset;
67 boost::shared_ptr<libdcp::SoundAssetWriter> _sound_asset_writer;