xoreos
0.0.5
|
Classes | |
struct | Packet |
Public Member Functions | |
ASFStream (Common::SeekableReadStream *stream, bool dispose) | |
~ASFStream () | |
size_t | readBuffer (int16 *buffer, const size_t numSamples) |
Fill the given buffer with up to numSamples samples. More... | |
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. More... | |
int | getChannels () const |
Return the number channels in this stream. More... | |
int | getRate () const |
Sample rate of the stream. More... | |
uint64 | getLength () const |
Estimate the total number of samples per channel in this stream. More... | |
uint64 | getDuration () const |
Estimate the total duration of the stream in milliseconds. More... | |
bool | rewind () |
Rewinds the stream to its start. More... | |
Public Member Functions inherited from Sound::AudioStream | |
virtual | ~AudioStream () |
virtual 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. More... | |
Private Member Functions | |
void | load () |
void | parseStreamHeader () |
void | parseFileHeader () |
Packet * | readPacket () |
PacketizedAudioStream * | createAudioStream () |
void | feedAudioData () |
bool | allDataLoaded () const |
Additional Inherited Members | |
Static Public Attributes inherited from Sound::RewindableAudioStream | |
static const uint64 | kInvalidLength = UINT64_C(0xFFFFFFFFFFFFFFFF) |
Static Public Attributes inherited from Sound::AudioStream | |
static const size_t | kSizeInvalid = SIZE_MAX |
Sound::ASFStream::ASFStream | ( | Common::SeekableReadStream * | stream, |
bool | dispose | ||
) |
Definition at line 184 of file asf.cpp.
References _curPacket, _curSequenceNumber, and load().
|
private |
Definition at line 473 of file asf.cpp.
References _curPacket, and _packetCount.
Referenced by endOfData(), and readBuffer().
|
private |
Definition at line 409 of file asf.cpp.
References _bitRate, _blockAlign, _channels, _compression, _extraData, _sampleRate, Sound::kWaveWMAv2, and Sound::makeWMAStream().
Referenced by parseStreamHeader(), and rewind().
|
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 Sound::AudioStream.
Definition at line 477 of file asf.cpp.
References _curAudioStream, and allDataLoaded().
|
private |
Definition at line 420 of file asf.cpp.
References _curAudioStream, _curSequenceNumber, _streamID, Sound::ASFStream::Packet::Segment::data, readPacket(), Sound::ASFStream::Packet::Segment::sequenceNumber, and Sound::ASFStream::Packet::Segment::streamID.
Referenced by readBuffer().
|
inlinevirtual |
Return the number channels in this stream.
Implements Sound::AudioStream.
Definition at line 114 of file asf.cpp.
References _channels.
|
virtual |
Estimate the total duration of the stream in milliseconds.
If this value is not calculable, return kInvalidLength.
Reimplemented from Sound::RewindableAudioStream.
Definition at line 301 of file asf.cpp.
References _duration.
|
virtual |
Estimate the total number of samples per channel in this stream.
If this value is not calculatable, return kInvalidLength.
Reimplemented from Sound::RewindableAudioStream.
Definition at line 297 of file asf.cpp.
References _duration, and getRate().
|
inlinevirtual |
Sample rate of the stream.
Implements Sound::AudioStream.
Definition at line 115 of file asf.cpp.
References _sampleRate.
Referenced by getLength().
|
private |
Definition at line 194 of file asf.cpp.
References _rewindPos, _stream, Common::UString::c_str(), parseFileHeader(), parseStreamHeader(), Sound::s_asfCodecComment, Sound::s_asfComment, Sound::s_asfDataHeader, Sound::s_asfExtendedHeader, Sound::s_asfFileHeader, Sound::s_asfHead1, Sound::s_asfHeader, Sound::s_asfStreamBitRate, Sound::s_asfStreamHeader, Sound::ASFGUID::toString(), and warning().
Referenced by ASFStream().
|
private |
Definition at line 241 of file asf.cpp.
References _duration, _maxPacketSize, _minPacketSize, _packetCount, and _stream.
Referenced by load().
|
private |
Definition at line 264 of file asf.cpp.
References _bitRate, _bitsPerCodedSample, _blockAlign, _channels, _compression, _curAudioStream, _extraData, _sampleRate, _stream, _streamID, createAudioStream(), Common::ScopedPtrBase< T, Deallocator >::reset(), and Sound::s_asfAudioStream.
Referenced by load().
|
virtual |
Fill the given buffer with up to numSamples samples.
Returns the actual number of samples read, or kSizeInvalid 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 endianness, 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.
The same holds true for more channels. Channel configurations recognized:
Implements Sound::AudioStream.
Definition at line 450 of file asf.cpp.
References _curAudioStream, allDataLoaded(), feedAudioData(), and Sound::AudioStream::kSizeInvalid.
|
private |
Definition at line 321 of file asf.cpp.
References _curPacket, _maxPacketSize, _packetCount, _stream, Sound::ASFStream::Packet::Segment::data, Sound::ASFStream::Packet::duration, Sound::ASFStream::Packet::flags, Sound::ASFStream::Packet::Segment::isKeyframe, Sound::ASFStream::Packet::packetSize, Sound::ASFStream::Packet::segments, Sound::ASFStream::Packet::segmentType, Sound::ASFStream::Packet::sendTime, Sound::ASFStream::Packet::Segment::sequenceNumber, and Sound::ASFStream::Packet::Segment::streamID.
Referenced by feedAudioData().
|
virtual |
Rewinds the stream to its start.
Implements Sound::RewindableAudioStream.
Definition at line 305 of file asf.cpp.
References _curAudioStream, _curPacket, _curSequenceNumber, _rewindPos, _stream, and createAudioStream().
|
private |
Definition at line 169 of file asf.cpp.
Referenced by createAudioStream(), and parseStreamHeader().
|
private |
Definition at line 171 of file asf.cpp.
Referenced by parseStreamHeader().
|
private |
Definition at line 170 of file asf.cpp.
Referenced by createAudioStream(), and parseStreamHeader().
|
private |
Definition at line 167 of file asf.cpp.
Referenced by createAudioStream(), getChannels(), and parseStreamHeader().
|
private |
Definition at line 166 of file asf.cpp.
Referenced by createAudioStream(), and parseStreamHeader().
|
private |
Definition at line 156 of file asf.cpp.
Referenced by endOfData(), feedAudioData(), parseStreamHeader(), readBuffer(), and rewind().
|
private |
Definition at line 155 of file asf.cpp.
Referenced by allDataLoaded(), ASFStream(), readPacket(), and rewind().
|
private |
Definition at line 157 of file asf.cpp.
Referenced by ASFStream(), feedAudioData(), and rewind().
|
private |
Definition at line 161 of file asf.cpp.
Referenced by getDuration(), getLength(), and parseFileHeader().
|
private |
Definition at line 172 of file asf.cpp.
Referenced by createAudioStream(), and parseStreamHeader().
|
private |
Definition at line 162 of file asf.cpp.
Referenced by parseFileHeader(), and readPacket().
|
private |
Definition at line 162 of file asf.cpp.
Referenced by parseFileHeader().
|
private |
Definition at line 160 of file asf.cpp.
Referenced by allDataLoaded(), parseFileHeader(), and readPacket().
|
private |
|
private |
Definition at line 168 of file asf.cpp.
Referenced by createAudioStream(), getRate(), and parseStreamHeader().
|
private |
Definition at line 143 of file asf.cpp.
Referenced by load(), parseFileHeader(), parseStreamHeader(), readPacket(), and rewind().
|
private |
Definition at line 165 of file asf.cpp.
Referenced by feedAudioData(), and parseStreamHeader().