3#ifndef QQNXCAMERAHANDLE_P_H
4#define QQNXCAMERAHANDLE_P_H
17#include <camera/camera_api.h>
30 : m_handle(
other.m_handle)
31 , m_lastError(
other.m_lastError)
40 m_handle =
other.m_handle;
41 m_lastError =
other.m_lastError;
56 m_lastError = CAMERA_EALREADY;
60 return cacheError(camera_open, unit,
mode, &m_handle);
68 const bool success = cacheError(camera_close, m_handle);
69 m_handle = CAMERA_HANDLE_INVALID;
74 camera_handle_t
get()
const
81 return m_handle != CAMERA_HANDLE_INVALID;
90 template <
typename Func,
typename ...Args>
91 bool cacheError(Func
f, Args &&...
args)
93 m_lastError =
f(std::forward<Args>(
args)...);
95 return m_lastError == CAMERA_EOK;
98 camera_handle_t m_handle = CAMERA_HANDLE_INVALID;
99 camera_error_t m_lastError = CAMERA_EOK;
bool open(camera_unit_t unit, uint32_t mode)
QQnxCameraHandle(const QQnxCameraHandle &)=delete
camera_handle_t get() const
QQnxCameraHandle()=default
camera_error_t lastError() const
QQnxCameraHandle(QQnxCameraHandle &&other)
QQnxCameraHandle & operator=(QQnxCameraHandle &&other)
QQnxCameraHandle(camera_handle_t h)
GLfloat GLfloat GLfloat GLfloat h