Home | History | Annotate | Download | only in 1.0

Lines Matching refs:nh

61     native_handle_t* nh = native_handle_create(1, 0);
62 if (nh == nullptr) {
65 nh->data[0] = fd;
66 return nh;
72 * \param[in] nh The source `native_handle_t*`.
73 * \param[in] index The index of the file descriptor in \p nh to read from. This
75 * \return The `index`-th file descriptor in \p nh. If \p nh does not have
80 inline int native_handle_read_fd(native_handle_t const* nh, int index = 0) {
81 return ((nh == nullptr) || (nh->numFds == 0) ||
82 (nh->numFds <= index) || (index < 0)) ?
83 -1 : nh->data[index];
219 * \param[out] nh The underlying native handle.
226 * If the return value is `NO_ERROR`, \p nh will point to a newly created
230 inline status_t unflattenFence(hidl_handle* fence, native_handle_t** nh,
248 *nh = native_handle_create_from_fd(*fds);
249 if (*nh == nullptr) {
252 *fence = *nh;
256 *nh = nullptr;
296 * \param[out] nh The native handle pointed to by \p t.
299 * On success, \p nh will hold a newly created native handle, which must be
303 inline bool wrapAs(hidl_handle* t, native_handle_t** nh, Fence const& l) {
330 if (unflattenFence(t, nh, constBuffer, size, constFds, numFds)
356 native_handle_t* nh = native_handle_create_from_fd(fd);
357 if (nh == nullptr) {
368 native_handle_delete(nh);
376 native_handle_delete(nh);
384 if (flattenFence(hidl_handle(nh), buffer, size, fds, numFds) != NO_ERROR) {
385 native_handle_delete(nh);
388 native_handle_delete(nh);
468 * \param[out] nh The underlying native handle for `t->fence`.
476 * descriptor, \p nh will be a newly created native handle holding that file
477 * descriptor. \p nh needs to be deleted with `native_handle_delete()`
481 HGraphicBufferProducer::QueueBufferInput* t, native_handle_t** nh,
508 status_t status = unflattenFence(&(t->fence), nh,
522 * \param[out] nh The underlying native handle for `t->fence`.
526 * descriptor, \p nh will be a newly created native handle holding that file
527 * descriptor. \p nh needs to be deleted with `native_handle_delete()`
532 native_handle_t** nh,
561 if (unflatten(t, nh, constBuffer, size, constFds, numFds) != NO_ERROR) {
610 * \param[out] nh The cloned native handle, if necessary.
618 * FENCE`, in which case \p nh will be returned.
621 native_handle_t** nh,
627 *nh = nullptr;
636 *nh = t.fence.getNativeHandle() == nullptr ?
638 return flattenFence(hidl_handle(*nh), buffer, size, fds, numFds);
706 * \param[out] nh The array of native handles that are cloned.
714 * The cloned native handles will be stored in \p nh. These native handles will
720 std::vector<native_handle_t*>* nh,
752 nh->resize(4);
756 &((*nh)[snapshotIndex]),
761 native_handle_close((*nh)[snapshotIndex]);
762 native_handle_delete((*nh)[snapshotIndex]);
763 (*nh)[snapshotIndex] = nullptr;
810 * \param[out] nh The array of arrays of cloned native handles.
818 * The cloned native handles will be stored in \p nh. Before making the call, \p
819 * nh should have enough space to store `n` pointers to arrays of native
820 * handles, where `n` is the length of `t.deltas`, and each `nh[i]` should have
825 std::vector<std::vector<native_handle_t*> >* nh,
837 nh->resize(t.deltas.size());
840 t.deltas[deltaIndex], &((*nh)[deltaIndex]),
847 native_handle_close((*nh)[deltaIndex][snapshotIndex]);
848 native_handle_delete((*nh)[deltaIndex][snapshotIndex]);
849 (*nh)[deltaIndex][snapshotIndex] = nullptr;
900 for (auto nh : nhA) {
901 if (nh != nullptr) {
902 native_handle_close(nh);
903 native_handle_delete(nh);
911 for (auto nh : nhA) {
912 if (nh != nullptr) {
913 native_handle_delete(nh);
1075 native_handle_t* nh;
1076 if (!wrapAs(&tInput, &nh, input)) {
1093 native_handle_delete(nh);
1099 native_handle_t* nh = nullptr;
1100 if ((fence == nullptr) || !wrapAs(&tFence, &nh, *fence)) {
1108 native_handle_delete(nh);