Lines Matching refs:mCore
24 #define VALIDATE_CONSISTENCY() do { mCore->validateConsistencyLocked(); } while (0)
42 mCore(core),
55 Mutex::Autolock lock(mCore->mMutex);
62 for (int s : mCore->mActiveBuffers) {
67 if (numAcquiredBuffers >= mCore->mMaxAcquiredBufferCount + 1) {
69 numAcquiredBuffers, mCore->mMaxAcquiredBufferCount);
73 bool sharedBufferAvailable = mCore->mSharedBufferMode &&
74 mCore->mAutoRefresh && mCore->mSharedBufferSlot !=
79 if (mCore->mQueue.empty() && !sharedBufferAvailable) {
83 BufferQueueCore::Fifo::iterator front(mCore->mQueue.begin());
90 if (expectedPresent != 0 && !mCore->mQueue.empty()) {
111 while (mCore->mQueue.size() > 1 && !mCore->mQueue[0].mIsAutoTimestamp) {
112 const BufferItem& bufferItem(mCore->mQueue[1]);
145 desiredPresent, expectedPresent, mCore->mQueue.size());
154 if (!mCore->mSharedBufferMode &&
161 mCore->mActiveBuffers.erase(front->mSlot);
162 mCore->mFreeBuffers.push_back(front->mSlot);
165 listener = mCore->mConnectedProducerListener;
169 mCore->mQueue.erase(front);
170 front = mCore->mQueue.begin();
198 if (sharedBufferAvailable && mCore->mQueue.empty()) {
200 mCore->waitWhileAllocatingLocked();
202 slot = mCore->mSharedBufferSlot;
208 outBuffer->mCrop = mCore->mSharedBufferCache.crop;
209 outBuffer->mTransform = mCore->mSharedBufferCache.transform &
212 outBuffer->mScalingMode = mCore->mSharedBufferCache.scalingMode;
213 outBuffer->mDataSpace = mCore->mSharedBufferCache.dataspace;
214 outBuffer->mFrameNumber = mCore->mFrameCounter;
218 (mCore->mSharedBufferCache.transform &
223 outBuffer->mAutoRefresh = mCore->mSharedBufferMode &&
224 mCore->mAutoRefresh;
240 if (mCore->mQueue.empty()) {
255 mCore->mQueue.erase(front);
260 mCore->mDequeueCondition.broadcast();
262 ATRACE_INT(mCore->mConsumerName.string(), mCore->mQueue.size());
263 mCore->mOccupancyTracker.registerOccupancyChange(mCore->mQueue.size());
281 Mutex::Autolock lock(mCore->mMutex);
283 if (mCore->mIsAbandoned) {
288 if (mCore->mSharedBufferMode || slot == mCore->mSharedBufferSlot) {
304 mCore->mActiveBuffers.erase(slot);
305 mCore->mFreeSlots.insert(slot);
306 mCore->clearBufferSlotLocked(slot);
307 mCore->mDequeueCondition.broadcast();
325 Mutex::Autolock lock(mCore->mMutex);
327 if (mCore->mSharedBufferMode) {
334 for (int s : mCore->mActiveBuffers) {
340 if (numAcquiredBuffers >= mCore->mMaxAcquiredBufferCount + 1) {
343 mCore->mMaxAcquiredBufferCount);
347 if (buffer->getGenerationNumber() != mCore->mGenerationNumber) {
350 mCore->mGenerationNumber);
356 if (!mCore->mFreeSlots.empty()) {
357 auto slot = mCore->mFreeSlots.begin();
359 mCore->mFreeSlots.erase(slot);
360 } else if (!mCore->mFreeBuffers.empty()) {
361 found = mCore->mFreeBuffers.front();
362 mCore->mFreeBuffers.remove(found);
369 mCore->mActiveBuffers.insert(found);
417 Mutex::Autolock lock(mCore->mMutex);
444 if (!mCore->mSharedBufferMode && mSlots[slot].mBufferState.isFree()) {
449 mCore->mActiveBuffers.erase(slot);
450 mCore->mFreeBuffers.push_back(slot);
453 listener = mCore->mConnectedProducerListener;
456 mCore->mDequeueCondition.broadcast();
480 Mutex::Autolock lock(mCore->mMutex);
482 if (mCore->mIsAbandoned) {
487 mCore->mConsumerListener = consumerListener;
488 mCore->mConsumerControlledByApp = controlledByApp;
498 Mutex::Autolock lock(mCore->mMutex);
500 if (mCore->mConsumerListener == NULL) {
505 mCore->mIsAbandoned = true;
506 mCore->mConsumerListener = NULL;
507 mCore->mQueue.clear();
508 mCore->freeAllBuffersLocked();
509 mCore->mSharedBufferSlot = BufferQueueCore::INVALID_BUFFER_SLOT;
510 mCore->mDequeueCondition.broadcast();
522 Mutex::Autolock lock(mCore->mMutex);
524 if (mCore->mIsAbandoned) {
539 BufferQueueCore::Fifo::iterator current(mCore->mQueue.begin());
540 while (current != mCore->mQueue.end()) {
564 Mutex::Autolock lock(mCore->mMutex);
565 mCore->mDefaultWidth = width;
566 mCore->mDefaultHeight = height;
578 Mutex::Autolock lock(mCore->mMutex);
580 if (mCore->mConnectedApi != BufferQueueCore::NO_CONNECTED_API) {
585 if (bufferCount < mCore->mMaxAcquiredBufferCount) {
588 mCore->mMaxAcquiredBufferCount);
592 int delta = mCore->getMaxBufferCountLocked(mCore->mAsyncMode,
593 mCore->mDequeueBufferCannotBlock, bufferCount) -
594 mCore->getMaxBufferCountLocked();
595 if (!mCore->adjustAvailableSlotsLocked(delta)) {
601 mCore->mMaxBufferCount = bufferCount;
618 Mutex::Autolock lock(mCore->mMutex);
619 mCore->waitWhileAllocatingLocked();
621 if (mCore->mIsAbandoned) {
626 if (maxAcquiredBuffers == mCore->mMaxAcquiredBufferCount) {
633 for (int slot : mCore->mActiveBuffers) {
645 if ((maxAcquiredBuffers + mCore->mMaxDequeuedBufferCount +
646 (mCore->mAsyncMode || mCore->mDequeueBufferCannotBlock ? 1 : 0))
647 > mCore->mMaxBufferCount) {
650 maxAcquiredBuffers, mCore->mMaxBufferCount,
651 mCore->mMaxDequeuedBufferCount, mCore->mAsyncMode ||
652 mCore->mDequeueBufferCannotBlock);
656 int delta = maxAcquiredBuffers - mCore->mMaxAcquiredBufferCount;
657 if (!mCore->adjustAvailableSlotsLocked(delta)) {
662 mCore->mMaxAcquiredBufferCount = maxAcquiredBuffers;
665 listener = mCore->mConsumerListener;
679 Mutex::Autolock lock(mCore->mMutex);
680 mCore->mConsumerName = name;
687 Mutex::Autolock lock(mCore->mMutex);
688 mCore->mDefaultBufferFormat = defaultFormat;
696 Mutex::Autolock lock(mCore->mMutex);
697 mCore->mDefaultBufferDataSpace = defaultDataSpace;
704 Mutex::Autolock lock(mCore->mMutex);
705 mCore->mConsumerUsageBits = usage;
712 Mutex::Autolock lock(mCore->mMutex);
713 mCore->mTransformHint = hint;
718 return mCore->mSidebandStream;
723 Mutex::Autolock lock(mCore->mMutex);
724 *outHistory = mCore->mOccupancyTracker.getSegmentHistory(forceFlush);
729 Mutex::Autolock lock(mCore->mMutex);
730 mCore->discardFreeBuffersLocked();
745 mCore->dump(result, prefix);