Lines Matching refs:handle
95 bool native_handle_is_invalid(const native_handle_t *const handle) { in native_handle_is_invalid() argument
97 if (handle == nullptr) { in native_handle_is_invalid()
101 return ((size_t)handle->version != sizeof(native_handle_t) || in native_handle_is_invalid()
102 handle->numFds < 0 || in native_handle_is_invalid()
103 handle->numInts < 0 || in native_handle_is_invalid()
105 handle->numFds > int((INT_MAX - handle->version) / sizeof(int)) - handle->numInts); in native_handle_is_invalid()
130 const ExtraData* getExtraData(const C2Handle *const handle) { in getExtraData() argument
131 if (handle == nullptr in getExtraData()
132 || native_handle_is_invalid(handle) in getExtraData()
133 || handle->numInts < NUM_INTS) { in getExtraData()
137 &handle->data[handle->numFds + handle->numInts - NUM_INTS]); in getExtraData()
141 ExtraData *getExtraData(C2Handle *const handle) { in getExtraData() argument
142 return const_cast<ExtraData *>(getExtraData(const_cast<const C2Handle *const>(handle))); in getExtraData()
163 const native_handle_t *const handle, in WrapAndMoveNativeHandle() argument
167 if (native_handle_is_invalid(handle) || in WrapAndMoveNativeHandle()
168 … handle->numInts > int((INT_MAX - handle->version) / sizeof(int)) - NUM_INTS - handle->numFds) { in WrapAndMoveNativeHandle()
176 native_handle_t *res = native_handle_create(handle->numFds, handle->numInts + NUM_INTS); in WrapAndMoveNativeHandle()
178 memcpy(&res->data, &handle->data, sizeof(int) * (handle->numFds + handle->numInts)); in WrapAndMoveNativeHandle()
185 const native_handle_t *const handle, in WrapNativeHandle() argument
188 if (handle == nullptr) { in WrapNativeHandle()
191 native_handle_t *clone = native_handle_clone(handle); in WrapNativeHandle()
205 const C2Handle *const handle) { in UnwrapNativeHandle() argument
206 const ExtraData *xd = getExtraData(handle); in UnwrapNativeHandle()
210 native_handle_t *res = native_handle_create(handle->numFds, handle->numInts - NUM_INTS); in UnwrapNativeHandle()
212 memcpy(&res->data, &handle->data, sizeof(int) * (res->numFds + res->numInts)); in UnwrapNativeHandle()
218 const C2Handle *const handle, in UnwrapNativeHandle() argument
220 const ExtraData *xd = getExtraData(handle); in UnwrapNativeHandle()
227 native_handle_t *res = native_handle_create(handle->numFds, handle->numInts - NUM_INTS); in UnwrapNativeHandle()
229 memcpy(&res->data, &handle->data, sizeof(int) * (res->numFds + res->numInts)); in UnwrapNativeHandle()
235 const C2Handle *const handle, in Import() argument
239 const ExtraData *xd = getExtraData(handle); in Import()
251 return reinterpret_cast<const C2HandleGralloc *>(handle); in Import()
255 native_handle_t *UnwrapNativeCodec2GrallocHandle(const C2Handle *const handle) { in UnwrapNativeCodec2GrallocHandle() argument
256 return C2HandleGralloc::UnwrapNativeHandle(handle); in UnwrapNativeCodec2GrallocHandle()
260 const C2Handle *const handle, in UnwrapNativeCodec2GrallocHandle() argument
262 return C2HandleGralloc::UnwrapNativeHandle(handle, generation, igbp_id, igbp_slot); in UnwrapNativeCodec2GrallocHandle()
266 const native_handle_t *const handle, in WrapNativeCodec2GrallocHandle() argument
269 return C2HandleGralloc::WrapNativeHandle(handle, width, height, format, usage, stride, in WrapNativeCodec2GrallocHandle()
283 virtual const C2Handle *handle() const override { return mLockedHandle ? : mHandle; } in handle() function in android::C2AllocationGralloc
292 const C2HandleGralloc *const handle,
313 const C2HandleGralloc *const handle, in C2AllocationGralloc() argument
319 mHandle(handle), in C2AllocationGralloc()
584 return other && other->handle() == handle(); in equals()
609 const C2Handle *handle,
623 const C2Handle *const handle, in _UnwrapNativeCodec2GrallocMetadata() argument
626 (void)C2HandleGralloc::Import(handle, width, height, format, usage, stride, in _UnwrapNativeCodec2GrallocMetadata()
709 const C2Handle *handle, in priorGraphicAllocation() argument
717 handle, in priorGraphicAllocation()
756 const C2Handle *handle, in priorGraphicAllocation() argument
758 return mImpl->priorGraphicAllocation(handle, allocation); in priorGraphicAllocation()