2 Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef DCPOMATIC_AUDIO_DECODER_STREAM_H
22 #define DCPOMATIC_AUDIO_DECODER_STREAM_H
24 #include "audio_stream.h"
25 #include "content_audio.h"
26 #include "dcpomatic_time.h"
27 #include <boost/shared_ptr.hpp>
35 class AudioDecoderStream
38 AudioDecoderStream (boost::shared_ptr<const AudioContent>, AudioStreamPtr, Decoder* decoder, boost::shared_ptr<Log> log);
40 ContentAudio get (Frame time, Frame length, bool accurate);
41 void audio (boost::shared_ptr<const AudioBuffers>, ContentTime);
43 void seek (ContentTime time, bool accurate);
48 void reset_decoded ();
49 void add (boost::shared_ptr<const AudioBuffers>);
51 boost::shared_ptr<const AudioContent> _content;
52 AudioStreamPtr _stream;
54 boost::shared_ptr<Log> _log;
55 boost::shared_ptr<Resampler> _resampler;
56 boost::optional<Frame> _position;
57 /** Currently-available decoded audio data */
58 ContentAudio _decoded;
59 /** The time of an accurate seek after which we have not yet received any actual
60 data at the seek time.
62 boost::optional<ContentTime> _seek_reference;