Lines Matching refs:cb

111         cb_handle_30_t* cb = cb_handle_30_t::from(raw);  in freeBuffer()  local
112 if (!cb) { in freeBuffer()
116 if (cb->hostHandle) { in freeBuffer()
119 rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle); in freeBuffer()
122 if (cb->mmapedSize > 0) { in freeBuffer()
123 GoldfishAddressSpaceBlock::memoryUnmap(cb->getBufferPtr(), cb->mmapedSize); in freeBuffer()
126 native_handle_close(cb); in freeBuffer()
127 native_handle_delete(cb); in freeBuffer()
190 const cb_handle_30_t* cb = cb_handle_30_t::from(buffer); in validateBufferSize() local
191 if (cb) { in validateBufferSize()
192 return validateBufferSizeImpl(*cb, descriptor, stride); in validateBufferSize()
200 const cb_handle_30_t* cb = cb_handle_30_t::from(buffer); in getTransportSize() local
201 if (cb) { in getTransportSize()
202 hidl_cb(Error3::NONE, cb->numFds, cb->numInts); in getTransportSize()
219 cb_handle_30_t* cb = cb_handle_30_t::from(imported); in importBufferImpl() local
220 if (!cb) { in importBufferImpl()
226 if (cb->mmapedSize > 0) { in importBufferImpl()
229 cb->getBufferPtr(), in importBufferImpl()
230 cb->mmapedSize, in importBufferImpl()
231 cb->bufferFd, in importBufferImpl()
232 cb->getMmapedOffset(), in importBufferImpl()
239 cb->setBufferPtr(ptr); in importBufferImpl()
242 if (cb->hostHandle) { in importBufferImpl()
245 rcEnc->rcOpenColorBuffer2(rcEnc, cb->hostHandle); in importBufferImpl()
262 cb_handle_30_t* cb = cb_handle_30_t::from(raw); in lockImpl() local
263 if (!cb) { in lockImpl()
266 if (!cb->bufferSize) { in lockImpl()
269 char* const bufferBits = static_cast<char*>(cb->getBufferPtr()); in lockImpl()
277 if (cb->hostHandle) { in lockImpl()
278 const Error3 e = lockHostImpl(*cb, cpuUsage, accessRegion, bufferBits); in lockImpl()
285 *pBytesPerPixel = cb->bytesPerPixel; in lockImpl()
286 *pBytesPerStride = cb->bytesPerPixel * cb->stride; in lockImpl()
298 cb_handle_30_t* cb = cb_handle_30_t::from(raw); in lockYCbCrImpl() local
299 if (!cb) { in lockYCbCrImpl()
302 if (!cb->bufferSize) { in lockYCbCrImpl()
305 char* const bufferBits = static_cast<char*>(cb->getBufferPtr()); in lockYCbCrImpl()
318 switch (static_cast<PixelFormat>(cb->format)) { in lockYCbCrImpl()
320 yStride = cb->width; in lockYCbCrImpl()
322 vOffset = yStride * cb->height; in lockYCbCrImpl()
329 yStride = align(cb->width, 16); in lockYCbCrImpl()
331 vOffset = yStride * cb->height; in lockYCbCrImpl()
332 uOffset = vOffset + (cStride * cb->height / 2); in lockYCbCrImpl()
337 yStride = cb->width; in lockYCbCrImpl()
339 uOffset = cb->height * yStride; in lockYCbCrImpl()
340 vOffset = uOffset + cStride * cb->height / 2; in lockYCbCrImpl()
345 ALOGE("%s:%d unexpected format (%d)", __func__, __LINE__, cb->format); in lockYCbCrImpl()
349 if (cb->hostHandle) { in lockYCbCrImpl()
350 const Error3 e = lockHostImpl(*cb, cpuUsage, accessRegion, bufferBits); in lockYCbCrImpl()
357 pYcbcr->cb = bufferBits + uOffset; in lockYCbCrImpl()
366 Error3 lockHostImpl(cb_handle_30_t& cb, in lockHostImpl() argument
379 rcEnc, cb.hostHandle, 0, usageSwRead); in lockHostImpl()
387 if (gralloc_is_yuv_format(cb.format)) { in lockHostImpl()
390 switch (static_cast<PixelFormat>(cb.format)) { in lockHostImpl()
392 get_yv12_offsets(cb.width, cb.height, in lockHostImpl()
396 get_yuv420p_offsets(cb.width, cb.height, in lockHostImpl()
404 rcEnc->rcReadColorBufferYUV(rcEnc, cb.hostHandle, in lockHostImpl()
405 0, 0, cb.width, cb.height, in lockHostImpl()
409 std::vector<char> tmpBuf(cb.width * cb.height * 3); in lockHostImpl()
410 rcEnc->rcReadColorBuffer(rcEnc, cb.hostHandle, in lockHostImpl()
411 0, 0, cb.width, cb.height, in lockHostImpl()
412 cb.glFormat, cb.glType, in lockHostImpl()
414 switch (static_cast<PixelFormat>(cb.format)) { in lockHostImpl()
417 cb.width, cb.height, in lockHostImpl()
425 cb.width, cb.height, in lockHostImpl()
438 cb.hostHandle, in lockHostImpl()
439 0, 0, cb.width, cb.height, in lockHostImpl()
440 cb.glFormat, cb.glType, in lockHostImpl()
446 cb.lockedLeft = accessRegion.left; in lockHostImpl()
447 cb.lockedTop = accessRegion.top; in lockHostImpl()
448 cb.lockedWidth = accessRegion.width; in lockHostImpl()
449 cb.lockedHeight = accessRegion.height; in lockHostImpl()
451 cb.lockedLeft = 0; in lockHostImpl()
452 cb.lockedTop = 0; in lockHostImpl()
453 cb.lockedWidth = cb.width; in lockHostImpl()
454 cb.lockedHeight = cb.height; in lockHostImpl()
464 cb_handle_30_t* cb = cb_handle_30_t::from(raw); in unlockImpl() local
465 if (!cb) { in unlockImpl()
468 if (!cb->bufferSize) { in unlockImpl()
471 char* const bufferBits = static_cast<char*>(cb->getBufferPtr()); in unlockImpl()
476 if (cb->hostHandle) { in unlockImpl()
477 unlockHostImpl(*cb, bufferBits); in unlockImpl()
483 void unlockHostImpl(cb_handle_30_t& cb, char* const bufferBits) { in unlockHostImpl() argument
484 const int bpp = glUtilsPixelBitSize(cb.glFormat, cb.glType) >> 3; in unlockHostImpl()
485 const int left = cb.lockedLeft; in unlockHostImpl()
486 const int top = cb.lockedTop; in unlockHostImpl()
487 const int width = cb.lockedWidth; in unlockHostImpl()
488 const int height = cb.lockedHeight; in unlockHostImpl()
494 if (gralloc_is_yuv_format(cb.format)) { in unlockHostImpl()
496 switch (static_cast<PixelFormat>(cb.format)) { in unlockHostImpl()
511 cb.width, in unlockHostImpl()
521 getMmapedPhysAddr(cb.getMmapedOffset())); in unlockHostImpl()
522 rcEnc->rcUpdateColorBufferDMA(rcEnc, cb.hostHandle, in unlockHostImpl()
524 cb.glFormat, cb.glType, in unlockHostImpl()
528 cb.lockedLeft = 0; in unlockHostImpl()
529 cb.lockedTop = 0; in unlockHostImpl()
530 cb.lockedWidth = 0; in unlockHostImpl()
531 cb.lockedHeight = 0; in unlockHostImpl()