From ccd8dbf4baba33bda41d1d8aa7657ef7d1400463 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 9 Aug 2015 20:04:25 -0400 Subject: AUDIO: Add an AudioStream subclass for packetized audio --- audio/audiostream.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'audio') diff --git a/audio/audiostream.h b/audio/audiostream.h index 840a25abda..c3dbdcf736 100644 --- a/audio/audiostream.h +++ b/audio/audiostream.h @@ -30,6 +30,10 @@ #include "audio/timestamp.h" +namespace Common { +class SeekableReadStream; +} + namespace Audio { /** @@ -367,6 +371,30 @@ Timestamp convertTimeToStreamPos(const Timestamp &where, int rate, bool isStereo */ AudioStream *makeLimitingAudioStream(AudioStream *parentStream, const Timestamp &length, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES); +/** + * An AudioStream designed to work in terms of packets. + * + * It is similar in concept to QueuingAudioStream, but does not + * necessarily rely on the data from each queued AudioStream + * being separate. + */ +class PacketizedAudioStream : public virtual AudioStream { +public: + virtual ~PacketizedAudioStream() {} + + /** + * Queue the next packet to be decoded. + */ + virtual void queuePacket(Common::SeekableReadStream *data) = 0; + + /** + * Mark this stream as finished. That is, signal that no further data + * will be queued to it. Only after this has been done can this + * stream ever 'end'. + */ + virtual void finish() = 0; +}; + } // End of namespace Audio #endif -- cgit v1.2.3