ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Audio::PacketizedMP3Stream Class Reference

Inheritance diagram for Audio::PacketizedMP3Stream:
Collaboration diagram for Audio::PacketizedMP3Stream:

List of all members.

Public Member Functions

 PacketizedMP3Stream (Common::SeekableReadStream &firstPacket)
 PacketizedMP3Stream (uint channels, uint rate)
 ~PacketizedMP3Stream ()
int readBuffer (int16 *buffer, const int numSamples)
 Fill the given buffer with up to numSamples samples.
bool endOfData () const
 End of data reached? If this returns true, it means that at this time there is no data available in the stream.
bool endOfStream () const
 End of stream reached? If this returns true, it means that all data in this stream is used up and no additional data will appear in it in the future.
void queuePacket (Common::SeekableReadStream *packet)
 Queue the next packet to be decoded.
void finish ()
 Mark this stream as finished.

Private Attributes

Common::Mutex _mutex
Common::Queue
< Common::SeekableReadStream * > 
_queue
bool _finished

Detailed Description

Definition at line 114 of file mp3.cpp.


Constructor & Destructor Documentation

Audio::PacketizedMP3Stream::PacketizedMP3Stream ( Common::SeekableReadStream firstPacket  ) 

Definition at line 418 of file mp3.cpp.

Audio::PacketizedMP3Stream::PacketizedMP3Stream ( uint  channels,
uint  rate 
)

Definition at line 434 of file mp3.cpp.

Audio::PacketizedMP3Stream::~PacketizedMP3Stream (  ) 

Definition at line 441 of file mp3.cpp.


Member Function Documentation

bool Audio::PacketizedMP3Stream::endOfData (  )  const [virtual]

End of data reached? If this returns true, it means that at this time there is no data available in the stream.

However there may be more data in the future. This is used by e.g. a rate converter to decide whether to keep on converting data or stop.

Implements Audio::AudioStream.

Definition at line 491 of file mp3.cpp.

bool Audio::PacketizedMP3Stream::endOfStream (  )  const [virtual]

End of stream reached? If this returns true, it means that all data in this stream is used up and no additional data will appear in it in the future.

This is used by the mixer to decide whether a given stream shall be removed from the list of active streams (and thus be destroyed). By default this maps to endOfData()

Reimplemented from Audio::AudioStream.

Definition at line 496 of file mp3.cpp.

void Audio::PacketizedMP3Stream::finish (  )  [virtual]

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'.

Implements Audio::PacketizedAudioStream.

Definition at line 520 of file mp3.cpp.

void Audio::PacketizedMP3Stream::queuePacket ( Common::SeekableReadStream data  )  [virtual]

Queue the next packet to be decoded.

Implements Audio::PacketizedAudioStream.

Definition at line 508 of file mp3.cpp.

int Audio::PacketizedMP3Stream::readBuffer ( int16 buffer,
const int  numSamples 
) [virtual]

Fill the given buffer with up to numSamples samples.

Returns the actual number of samples read, or -1 if a critical error occurred (note: you *must* check if this value is less than what you requested, this can happen when the stream is fully used up).

Data has to be in native endianess, 16 bit per sample, signed. For stereo stream, buffer will be filled with interleaved left and right channel samples, starting with a left sample. Furthermore, the samples in the left and right are summed up. So if you request 4 samples from a stereo stream, you will get a total of two left channel and two right channel samples.

Implements Audio::AudioStream.

Definition at line 449 of file mp3.cpp.


Member Data Documentation

Definition at line 132 of file mp3.cpp.

Definition at line 130 of file mp3.cpp.


The documentation for this class was generated from the following file:


Generated on Sat Sep 21 2019 05:03:15 for ResidualVM by doxygen 1.7.1
curved edge   curved edge