Home | History | Annotate | Download | only in libbufferhub

Lines Matching refs:handle

26 IonBuffer::IonBuffer(buffer_handle_t handle, uint32_t width, uint32_t height,
28 : IonBuffer(handle, width, height, kDefaultGraphicBufferLayerCount, stride,
31 IonBuffer::IonBuffer(buffer_handle_t handle, uint32_t width, uint32_t height,
36 "IonBuffer::IonBuffer: handle=%p width=%u height=%u layer_count=%u "
38 handle, width, height, layer_count, stride, format, usage);
39 if (handle != 0) {
40 Import(handle, width, height, layer_count, stride, format, usage);
46 "IonBuffer::~IonBuffer: handle=%p width=%u height=%u stride=%u "
48 handle(), width(), height(), stride(), format(), usage());
57 ALOGD_IF(TRACE, "IonBuffer::operator=: handle_=%p other.handle_=%p", handle(),
58 other.handle());
69 // GraphicBuffer unregisters and cleans up the handle if needed
91 void IonBuffer::Reset(buffer_handle_t handle, uint32_t width, uint32_t height,
95 "IonBuffer::Reset: handle=%p width=%u height=%u layer_count=%u "
97 handle, width, height, layer_count, stride, format, usage);
98 Import(handle, width, height, layer_count, stride, format, usage);
101 int IonBuffer::Import(buffer_handle_t handle, uint32_t width, uint32_t height,
106 "IonBuffer::Import: handle=%p width=%u height=%u layer_count=%u "
108 handle, width, height, layer_count, stride, format, usage);
111 new GraphicBuffer(handle, GraphicBuffer::TAKE_UNREGISTERED_HANDLE, width,
138 native_handle_t* handle = native_handle_create(fd_count, int_count);
139 if (!handle) {
140 ALOGE("IonBuffer::Import: failed to create new native handle.");
144 // Copy fd_array into the first part of handle->data and int_array right
146 memcpy(handle->data, fd_array, sizeof(int) * fd_count);
147 memcpy(handle->data + fd_count, int_array, sizeof(int) * int_count);
150 Import(handle, width, height, layer_count, stride, format, usage);
152 ALOGE("IonBuffer::Import: failed to import raw native handle: %s",
154 native_handle_close(handle);
155 native_handle_delete(handle);
162 if (!other->handle())
165 const int fd_count = other->handle()->numFds;
166 const int int_count = other->handle()->numInts;
171 native_handle_t* handle = native_handle_create(fd_count, int_count);
172 if (!handle) {
173 ALOGE("IonBuffer::Duplicate: Failed to create new native handle.");
177 // Duplicate the file descriptors from the other native handle.
179 handle->data[i] = dup(other->handle()->data[i]);
182 memcpy(handle->data + fd_count, other->handle()->data + fd_count,
186 Import(handle, other->width(), other->height(), other->layer_count(),
189 ALOGE("IonBuffer::Duplicate: Failed to import duplicate native handle: %s",
191 native_handle_close(handle);
192 native_handle_delete(handle);
202 "IonBuffer::Lock: handle=%p usage=%d x=%d y=%d width=%d height=%d "
204 handle(), usage, x, y, width, height, address);
218 "IonBuffer::Lock: handle=%p usage=%d x=%d y=%d width=%d height=%d",
219 handle(), usage, x, y, width, height);
231 ALOGD_IF(TRACE, "IonBuffer::Unlock: handle=%p", handle());