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

Audio::AC3Stream Class Reference

Inheritance diagram for Audio::AC3Stream:
Collaboration diagram for Audio::AC3Stream:

List of all members.

Public Member Functions

 AC3Stream ()
 ~AC3Stream ()
bool init (Common::SeekableReadStream &firstPacket)
void deinit ()
int readBuffer (int16 *buffer, const int numSamples)
 Fill the given buffer with up to numSamples samples.
bool isStereo () const
 Is this a stereo stream?
int getRate () const
 Sample rate of the stream.
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 *data)
 Queue the next packet to be decoded.
void finish ()
 Mark this stream as finished.

Private Attributes

Common::ScopedPtr
< QueuingAudioStream
_audStream
a52_state_t * _a52State
uint32 _frameSize
byte _inBuf [4096]
byte_inBufPtr
int _flags
int _sampleRate

Detailed Description

Definition at line 38 of file ac3.cpp.


Constructor & Destructor Documentation

Audio::AC3Stream::AC3Stream (  ) 

Definition at line 67 of file ac3.cpp.

Audio::AC3Stream::~AC3Stream (  ) 

Definition at line 70 of file ac3.cpp.


Member Function Documentation

void Audio::AC3Stream::deinit (  ) 

Definition at line 111 of file ac3.cpp.

bool Audio::AC3Stream::endOfData (  )  const [inline, 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 50 of file ac3.cpp.

bool Audio::AC3Stream::endOfStream (  )  const [inline, 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 51 of file ac3.cpp.

void Audio::AC3Stream::finish (  )  [inline, 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 55 of file ac3.cpp.

int Audio::AC3Stream::getRate (  )  const [inline, virtual]

Sample rate of the stream.

Implements Audio::AudioStream.

Definition at line 49 of file ac3.cpp.

bool Audio::AC3Stream::init ( Common::SeekableReadStream firstPacket  ) 

Definition at line 78 of file ac3.cpp.

bool Audio::AC3Stream::isStereo (  )  const [inline, virtual]

Is this a stereo stream?

Implements Audio::AudioStream.

Definition at line 48 of file ac3.cpp.

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

Queue the next packet to be decoded.

Implements Audio::PacketizedAudioStream.

Definition at line 120 of file ac3.cpp.

int Audio::AC3Stream::readBuffer ( int16 buffer,
const int  numSamples 
) [inline, 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 47 of file ac3.cpp.


Member Data Documentation

a52_state_t* Audio::AC3Stream::_a52State [private]

Definition at line 59 of file ac3.cpp.

int Audio::AC3Stream::_flags [private]

Definition at line 63 of file ac3.cpp.

Definition at line 60 of file ac3.cpp.

byte Audio::AC3Stream::_inBuf[4096] [private]

Definition at line 61 of file ac3.cpp.

Definition at line 62 of file ac3.cpp.

Definition at line 64 of file ac3.cpp.


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


Generated on Sat Feb 16 2019 05:04:04 for ResidualVM by doxygen 1.7.1
curved edge   curved edge