Lines Matching refs:buffer
48 status_t SourceAudioBufferProvider::getNextBuffer(Buffer *buffer, int64_t pts)
50 ALOG_ASSERT(buffer != NULL && buffer->frameCount > 0 && mGetCount == 0);
54 if (mRemaining < buffer->frameCount) {
55 buffer->frameCount = mRemaining;
57 buffer->raw = (char *) mAllocated + (mOffset << mFrameBitShift);
58 mGetCount = buffer->frameCount;
62 if (buffer->frameCount > mSize) {
64 mAllocated = malloc(buffer->frameCount << mFrameBitShift);
65 mSize = buffer->frameCount;
68 ssize_t actual = mSource->read(mAllocated, buffer->frameCount, pts);
70 ALOG_ASSERT((size_t) actual <= buffer->frameCount);
73 buffer->raw = mAllocated;
74 buffer->frameCount = actual;
78 buffer->raw = NULL;
79 buffer->frameCount = 0;
84 void SourceAudioBufferProvider::releaseBuffer(Buffer *buffer)
86 ALOG_ASSERT((buffer != NULL) &&
87 (buffer->raw == (char *) mAllocated + (mOffset << mFrameBitShift)) &&
88 (buffer->frameCount <= mGetCount) &&
91 mOffset += buffer->frameCount;
92 mRemaining -= buffer->frameCount;
93 buffer->raw = NULL;
94 buffer->frameCount = 0;