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