本文整理汇总了C++中AudioStream::endOfData方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioStream::endOfData方法的具体用法?C++ AudioStream::endOfData怎么用?C++ AudioStream::endOfData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioStream
的用法示例。
在下文中一共展示了AudioStream::endOfData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readBuffer
size_t ASFStream::readBuffer(int16 *buffer, const size_t numSamples) {
size_t samplesDecoded = 0;
for (;;) {
if (_curAudioStream) {
const size_t n = _curAudioStream->readBuffer(buffer + samplesDecoded, numSamples - samplesDecoded);
if (n == kSizeInvalid)
return kSizeInvalid;
samplesDecoded += n;
if (_curAudioStream->endOfData()) {
delete _curAudioStream;
_curAudioStream = 0;
}
}
if (samplesDecoded == numSamples || endOfData())
break;
if (!_curAudioStream) {
_curAudioStream = createAudioStream();
}
}
return samplesDecoded;
}
示例2: readBuffer
int QueuingAudioStreamImpl::readBuffer(int16 *buffer, const int numSamples) {
Common::StackLock lock(_mutex);
int samplesDecoded = 0;
while (samplesDecoded < numSamples && !_queue.empty()) {
AudioStream *stream = _queue.front()._stream;
samplesDecoded += stream->readBuffer(buffer + samplesDecoded, numSamples - samplesDecoded);
if (stream->endOfData()) {
StreamHolder tmp = _queue.pop();
if (tmp._disposeAfterUse == DisposeAfterUse::YES)
delete stream;
}
}
return samplesDecoded;
}
示例3: readBuffer
size_t QueuingAudioStreamImpl::readBuffer(int16 *buffer, const size_t numSamples) {
Common::StackLock lock(_mutex);
size_t samplesDecoded = 0;
while (samplesDecoded < numSamples && !_queue.empty()) {
AudioStream *stream = _queue.front()._stream;
const size_t n = stream->readBuffer(buffer + samplesDecoded, numSamples - samplesDecoded);
if (n == kSizeInvalid)
return kSizeInvalid;
samplesDecoded += n;
if (stream->endOfData()) {
StreamHolder tmp = _queue.front();
_queue.pop();
if (tmp._disposeAfterUse)
delete stream;
}
}
return samplesDecoded;
}
示例4: readBuffer
int QueuingAudioStreamImpl::readBuffer(int16 *buffer, const int numSamples) {
Common::StackLock lock(_mutex);
int samplesDecoded = 0;
while (samplesDecoded < numSamples && !_queue.empty()) {
AudioStream *stream = _queue.front()._stream;
samplesDecoded += stream->readBuffer(buffer + samplesDecoded, numSamples - samplesDecoded);
// Done with the stream completely
if (stream->endOfStream()) {
StreamHolder tmp = _queue.pop();
if (tmp._disposeAfterUse == DisposeAfterUse::YES)
delete stream;
continue;
}
// Done with data but not the stream, bail out
if (stream->endOfData())
break;
}
return samplesDecoded;
}
示例5: readBuffer
int ASFStream::readBuffer(int16 *buffer, const int numSamples) {
int samplesDecoded = 0;
for (;;) {
if (_curAudioStream) {
samplesDecoded += _curAudioStream->readBuffer(buffer + samplesDecoded, numSamples - samplesDecoded);
if (_curAudioStream->endOfData()) {
delete _curAudioStream;
_curAudioStream = 0;
}
}
if (samplesDecoded == numSamples || endOfData())
break;
if (!_curAudioStream) {
_curAudioStream = createAudioStream();
}
}
return samplesDecoded;
}