Lines Matching refs:nh

118     native_handle_t* nh = native_handle_create(1, 0);
119 if (nh == nullptr) {
122 nh->data[0] = fd;
123 return nh;
129 * \param[in] nh The source `native_handle_t*`.
130 * \param[in] index The index of the file descriptor in \p nh to read from. This
132 * \return The `index`-th file descriptor in \p nh. If \p nh does not have
137 inline int native_handle_read_fd(native_handle_t const* nh, int index = 0) {
138 return ((nh == nullptr) || (nh->numFds == 0) ||
139 (nh->numFds <= index) || (index < 0)) ?
140 -1 : nh->data[index];
299 * \param[in] nh The source `native_handle_t*`.
300 * \return The `hidl_handle` that points to \p nh.
303 inline hidl_handle inHidlHandle(native_handle_t const* nh) {
304 return hidl_handle(nh);
311 * \param[out] nh The native_handle_t referred to by `t->fence`.
315 * Upon success, \p nh will be created to hold the file descriptor stored in
316 * `l.fenceFd`, and `t->fence` will point to \p nh. \p nh will need to be
319 * Upon failure, \p nh will not be created and will not need to be deleted. \p t
323 inline bool wrapAs(Message* t, native_handle_t** nh, omx_message const& l) {
324 *nh = native_handle_create_from_fd(l.fenceFd);
325 if (!*nh) {
328 t->fence = *nh;
359 native_handle_delete(*nh);
438 * \param[out] nh The native handle created to hold the file descriptor inside
442 * \return `true` if \p t and \p nh are successfully created to wrap around \p
445 * On success, \p nh needs to be deleted by the caller with
446 * `native_handle_delete()` after \p t and \p nh are no longer needed.
448 * On failure, \p nh will not need to be deleted, and \p t will hold an invalid
452 inline bool wrapAs(hidl_handle* t, native_handle_t** nh,
454 *nh = native_handle_create_from_fd(l.get());
455 if (!*nh) {
458 *t = *nh;