Lines Matching refs:buffer
48 status_t SourceAudioBufferProvider::getNextBuffer(Buffer *buffer) in getNextBuffer() argument
50 ALOG_ASSERT(buffer != NULL && buffer->frameCount > 0 && mGetCount == 0); in getNextBuffer()
54 if (mRemaining < buffer->frameCount) { in getNextBuffer()
55 buffer->frameCount = mRemaining; in getNextBuffer()
57 buffer->raw = (char *) mAllocated + (mOffset * mFrameSize); in getNextBuffer()
58 mGetCount = buffer->frameCount; in getNextBuffer()
62 if (buffer->frameCount > mSize) { in getNextBuffer()
67 mAllocated = calloc(buffer->frameCount, mFrameSize); in getNextBuffer()
72 mSize = buffer->frameCount; in getNextBuffer()
76 ssize_t actual = mSource->read(mAllocated, buffer->frameCount); in getNextBuffer()
78 ALOG_ASSERT((size_t) actual <= buffer->frameCount); in getNextBuffer()
81 buffer->raw = mAllocated; in getNextBuffer()
82 buffer->frameCount = actual; in getNextBuffer()
88 buffer->raw = NULL; in getNextBuffer()
89 buffer->frameCount = 0; in getNextBuffer()
94 void SourceAudioBufferProvider::releaseBuffer(Buffer *buffer) in releaseBuffer() argument
96 ALOG_ASSERT((buffer != NULL) && in releaseBuffer()
97 (buffer->raw == (char *) mAllocated + (mOffset * mFrameSize)) && in releaseBuffer()
98 (buffer->frameCount <= mGetCount) && in releaseBuffer()
101 mOffset += buffer->frameCount; in releaseBuffer()
102 mRemaining -= buffer->frameCount; in releaseBuffer()
103 mFramesReleased += buffer->frameCount; in releaseBuffer()
104 buffer->raw = NULL; in releaseBuffer()
105 buffer->frameCount = 0; in releaseBuffer()