Lines Matching refs:cblk

61 Proxy::Proxy(audio_track_cblk_t* cblk, void *buffers, size_t frameCount, size_t frameSize,  in Proxy()  argument
63 : mCblk(cblk), mBuffers(buffers), mFrameCount(frameCount), mFrameSize(frameSize), in Proxy()
71 ClientProxy::ClientProxy(audio_track_cblk_t* cblk, void *buffers, size_t frameCount, in ClientProxy() argument
73 : Proxy(cblk, buffers, frameCount, frameSize, isOut, clientInServer) in ClientProxy()
75 , mTimestampObserver(&cblk->mExtendedTimestampQueue) in ClientProxy()
144 audio_track_cblk_t* cblk = mCblk; in obtainBuffer() local
152 int32_t flags = android_atomic_and(~CBLK_INTERRUPT, &cblk->mFlags); in obtainBuffer()
182 front = android_atomic_acquire_load(&cblk->u.mStreaming.mFront); in obtainBuffer()
183 rear = cblk->u.mStreaming.mRear; in obtainBuffer()
186 rear = android_atomic_acquire_load(&cblk->u.mStreaming.mRear); in obtainBuffer()
187 front = cblk->u.mStreaming.mFront; in obtainBuffer()
202 cblk->u.mStreaming.mFront = rear; in obtainBuffer()
203 (void) android_atomic_or(CBLK_OVERRUN, &cblk->mFlags); in obtainBuffer()
276 int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); in obtainBuffer()
283 (void) syscall(__NR_futex, &cblk->mFutex, in obtainBuffer()
357 audio_track_cblk_t* cblk = mCblk; in releaseBuffer() local
360 int32_t rear = cblk->u.mStreaming.mRear; in releaseBuffer()
361 android_atomic_release_store(stepCount + rear, &cblk->u.mStreaming.mRear); in releaseBuffer()
363 int32_t front = cblk->u.mStreaming.mFront; in releaseBuffer()
364 android_atomic_release_store(stepCount + front, &cblk->u.mStreaming.mFront); in releaseBuffer()
370 audio_track_cblk_t* cblk = mCblk; in binderDied() local
371 if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) { in binderDied()
372 android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); in binderDied()
374 (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, in binderDied()
381 audio_track_cblk_t* cblk = mCblk; in interrupt() local
382 if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) & CBLK_INTERRUPT)) { in interrupt()
383 android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); in interrupt()
384 (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, in interrupt()
392 audio_track_cblk_t* cblk = mCblk; in getMisalignment() local
393 return (mFrameCountP2 - (mIsOut ? cblk->u.mStreaming.mRear : cblk->u.mStreaming.mFront)) & in getMisalignment()
458 audio_track_cblk_t* cblk = mCblk; in waitStreamEndDone() local
476 int32_t flags = android_atomic_and(~(CBLK_INTERRUPT|CBLK_STREAM_END_DONE), &cblk->mFlags); in waitStreamEndDone()
534 int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex); in waitStreamEndDone()
537 (void) syscall(__NR_futex, &cblk->mFutex, in waitStreamEndDone()
562 StaticAudioTrackClientProxy::StaticAudioTrackClientProxy(audio_track_cblk_t* cblk, void *buffers, in StaticAudioTrackClientProxy() argument
564 : AudioTrackClientProxy(cblk, buffers, frameCount, frameSize), in StaticAudioTrackClientProxy()
565 mMutator(&cblk->u.mStatic.mSingleStateQueue), in StaticAudioTrackClientProxy()
566 mPosLoopObserver(&cblk->u.mStatic.mPosLoopQueue) in StaticAudioTrackClientProxy()
659 ServerProxy::ServerProxy(audio_track_cblk_t* cblk, void *buffers, size_t frameCount, in ServerProxy() argument
661 : Proxy(cblk, buffers, frameCount, frameSize, isOut, clientInServer), in ServerProxy()
663 , mTimestampMutator(&cblk->mExtendedTimestampQueue) in ServerProxy()
665 cblk->mBufferSizeInFrames = frameCount; in ServerProxy()
671 audio_track_cblk_t* cblk = mCblk; in flushBufferIfNeeded() local
676 int32_t flush = android_atomic_acquire_load(&cblk->u.mStreaming.mFlush); in flushBufferIfNeeded()
681 int32_t rear = android_atomic_acquire_load(&cblk->u.mStreaming.mRear); in flushBufferIfNeeded()
682 int32_t front = cblk->u.mStreaming.mFront; in flushBufferIfNeeded()
706 android_atomic_release_store(newFront, &cblk->u.mStreaming.mFront); in flushBufferIfNeeded()
709 int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); in flushBufferIfNeeded()
711 (void) syscall(__NR_futex, &cblk->mFutex, in flushBufferIfNeeded()
768 audio_track_cblk_t* cblk = mCblk; in obtainBuffer() local
777 front = cblk->u.mStreaming.mFront; in obtainBuffer()
779 front = android_atomic_acquire_load(&cblk->u.mStreaming.mFront); in obtainBuffer()
780 rear = cblk->u.mStreaming.mRear; in obtainBuffer()
854 audio_track_cblk_t* cblk = mCblk; in releaseBuffer() local
856 int32_t front = cblk->u.mStreaming.mFront; in releaseBuffer()
857 android_atomic_release_store(stepCount + front, &cblk->u.mStreaming.mFront); in releaseBuffer()
859 int32_t rear = cblk->u.mStreaming.mRear; in releaseBuffer()
860 android_atomic_release_store(stepCount + rear, &cblk->u.mStreaming.mRear); in releaseBuffer()
863 cblk->mServer += stepCount; in releaseBuffer()
870 size_t minimum = (size_t) cblk->mMinimum; in releaseBuffer()
879 int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex); in releaseBuffer()
881 (void) syscall(__NR_futex, &cblk->mFutex, in releaseBuffer()
901 audio_track_cblk_t* cblk = mCblk; in framesReady() local
903 int32_t flush = cblk->u.mStreaming.mFlush; in framesReady()
909 ssize_t filled = audio_utils::safe_sub_overflow(rear, cblk->u.mStreaming.mFront); in framesReady()
929 const audio_track_cblk_t* cblk = mCblk; in framesReadySafe() local
930 const int32_t flush = android_atomic_acquire_load(&cblk->u.mStreaming.mFlush); in framesReadySafe()
935 const ssize_t filled = audio_utils::safe_sub_overflow(rear, cblk->u.mStreaming.mFront); in framesReadySafe()
943 audio_track_cblk_t* cblk = mCblk; in setStreamEndDone() local
945 (android_atomic_or(CBLK_STREAM_END_DONE, &cblk->mFlags) & CBLK_STREAM_END_DONE) != 0; in setStreamEndDone()
947 (void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE, in setStreamEndDone()
956 audio_track_cblk_t* cblk = mCblk; in tallyUnderrunFrames() local
958 cblk->u.mStreaming.mUnderrunFrames += frameCount; in tallyUnderrunFrames()
962 cblk->u.mStreaming.mUnderrunCount = mUnderrunCount; in tallyUnderrunFrames()
965 frameCount, cblk->u.mStreaming.mUnderrunFrames, mUnderrunCount); in tallyUnderrunFrames()
969 (void) android_atomic_or(CBLK_UNDERRUN, &cblk->mFlags); in tallyUnderrunFrames()
973 frameCount, cblk->u.mStreaming.mUnderrunFrames); in tallyUnderrunFrames()
986 StaticAudioTrackServerProxy::StaticAudioTrackServerProxy(audio_track_cblk_t* cblk, void *buffers, in StaticAudioTrackServerProxy() argument
988 : AudioTrackServerProxy(cblk, buffers, frameCount, frameSize), in StaticAudioTrackServerProxy()
989 mObserver(&cblk->u.mStatic.mSingleStateQueue), in StaticAudioTrackServerProxy()
990 mPosLoopMutator(&cblk->u.mStatic.mPosLoopQueue), in StaticAudioTrackServerProxy()
1175 audio_track_cblk_t* cblk = mCblk; in releaseBuffer() local
1200 cblk->mServer += stepCount; in releaseBuffer()
1209 (void) android_atomic_or(setFlags, &cblk->mFlags); in releaseBuffer()