Lines Matching refs:idx
90 media_status_t GrallocConsumer::lockNextBuffer(uint32_t idx) { in lockNextBuffer() argument
93 if (idx >= mNumAlloc) { in lockNextBuffer()
94 ALOGE("Invalid buffer index: %d", idx); in lockNextBuffer()
98 if (mAcquiredBuffer[idx].mImg != nullptr) { in lockNextBuffer()
99 ret = unlockBuffer(idx); in lockNextBuffer()
105 ret = AImageReader_acquireNextImage(mImgReader, &(mAcquiredBuffer[idx].mImg)); in lockNextBuffer()
106 if (ret != AMEDIA_OK || mAcquiredBuffer[idx].mImg == nullptr) { in lockNextBuffer()
108 __FUNCTION__, mImgReader, ret, mAcquiredBuffer[idx].mImg); in lockNextBuffer()
112 AImage *img = mAcquiredBuffer[idx].mImg; in lockNextBuffer()
159 mAcquiredBuffer[idx].mBufferPointer = data; in lockNextBuffer()
161 mAlloc[idx]->mHal.drvState.lod[0].mallocPtr = data; in lockNextBuffer()
162 mAlloc[idx]->mHal.drvState.lod[0].stride = rowstride; in lockNextBuffer()
163 mAlloc[idx]->mHal.state.nativeBuffer = hardwareBuffer; in lockNextBuffer()
164 mAlloc[idx]->mHal.state.timestamp = timestamp; in lockNextBuffer()
167 const int yWidth = mAlloc[idx]->mHal.drvState.lod[0].dimX; in lockNextBuffer()
168 const int yHeight = mAlloc[idx]->mHal.drvState.lod[0].dimY; in lockNextBuffer()
215 mAlloc[idx]->mHal.drvState.lod[1].dimX = cWidth; in lockNextBuffer()
216 mAlloc[idx]->mHal.drvState.lod[1].dimY = cHeight; in lockNextBuffer()
217 mAlloc[idx]->mHal.drvState.lod[2].dimX = cWidth; in lockNextBuffer()
218 mAlloc[idx]->mHal.drvState.lod[2].dimY = cHeight; in lockNextBuffer()
220 mAlloc[idx]->mHal.drvState.lod[1].mallocPtr = uData; in lockNextBuffer()
221 mAlloc[idx]->mHal.drvState.lod[2].mallocPtr = vData; in lockNextBuffer()
223 mAlloc[idx]->mHal.drvState.lod[1].stride = uRowStride; in lockNextBuffer()
224 mAlloc[idx]->mHal.drvState.lod[2].stride = vRowStride; in lockNextBuffer()
226 mAlloc[idx]->mHal.drvState.yuv.shift = 1; in lockNextBuffer()
227 mAlloc[idx]->mHal.drvState.yuv.step = uPixStride; in lockNextBuffer()
228 mAlloc[idx]->mHal.drvState.lodCount = 3; in lockNextBuffer()
234 media_status_t GrallocConsumer::unlockBuffer(uint32_t idx) { in unlockBuffer() argument
237 if (idx >= mNumAlloc) { in unlockBuffer()
238 ALOGE("Invalid buffer index: %d", idx); in unlockBuffer()
241 if (mAcquiredBuffer[idx].mImg == nullptr) { in unlockBuffer()
245 AImage_delete(mAcquiredBuffer[idx].mImg); in unlockBuffer()
246 mAcquiredBuffer[idx].mImg = nullptr; in unlockBuffer()
261 bool GrallocConsumer::releaseIdx(uint32_t idx) { in releaseIdx() argument
262 if (idx >= mNumAlloc) { in releaseIdx()
263 ALOGE("Invalid buffer index: %d", idx); in releaseIdx()
266 if (isIdxUsed[idx] == false) { in releaseIdx()
267 ALOGV("Buffer index already released: %d", idx); in releaseIdx()
271 ret = unlockBuffer(idx); in releaseIdx()
276 mAlloc[idx] = nullptr; in releaseIdx()
277 isIdxUsed[idx] = false; in releaseIdx()