Lines Matching refs:camera_id
138 int32_t QCameraFlash::initFlash(const int camera_id) in initFlash() argument
145 if (camera_id < 0 || camera_id >= MM_CAMERA_MAX_NUM_SENSORS) { in initFlash()
146 LOGE("Invalid camera id: %d", camera_id); in initFlash()
150 QCamera3HardwareInterface::getFlashInfo(camera_id, in initFlash()
160 camera_id); in initFlash()
162 } else if (m_cameraOpen[camera_id]) { in initFlash()
164 camera_id); in initFlash()
166 } else if (m_flashFds[camera_id] >= 0) { in initFlash()
168 camera_id); in initFlash()
170 m_flashFds[camera_id] = open(flashPath, O_RDWR | O_NONBLOCK); in initFlash()
172 if (m_flashFds[camera_id] < 0) { in initFlash()
184 retVal = ioctl(m_flashFds[camera_id], in initFlash()
189 camera_id); in initFlash()
190 close(m_flashFds[camera_id]); in initFlash()
191 m_flashFds[camera_id] = -1; in initFlash()
219 int32_t QCameraFlash::setFlashMode(const int camera_id, const bool mode) in setFlashMode() argument
224 if (camera_id < 0 || camera_id >= MM_CAMERA_MAX_NUM_SENSORS) { in setFlashMode()
225 LOGE("Invalid camera id: %d", camera_id); in setFlashMode()
227 } else if (mode == m_flashOn[camera_id]) { in setFlashMode()
229 camera_id, in setFlashMode()
232 } else if (m_flashFds[camera_id] < 0) { in setFlashMode()
233 LOGE("called for uninited flash: %d", camera_id); in setFlashMode()
241 retVal = ioctl(m_flashFds[camera_id], in setFlashMode()
246 mode, camera_id); in setFlashMode()
249 m_flashOn[camera_id] = mode; in setFlashMode()
269 int32_t QCameraFlash::deinitFlash(const int camera_id) in deinitFlash() argument
273 if (camera_id < 0 || camera_id >= MM_CAMERA_MAX_NUM_SENSORS) { in deinitFlash()
274 LOGE("Invalid camera id: %d", camera_id); in deinitFlash()
276 } else if (m_flashFds[camera_id] < 0) { in deinitFlash()
280 setFlashMode(camera_id, false); in deinitFlash()
284 retVal = ioctl(m_flashFds[camera_id], in deinitFlash()
289 camera_id); in deinitFlash()
292 close(m_flashFds[camera_id]); in deinitFlash()
293 m_flashFds[camera_id] = -1; in deinitFlash()
313 int32_t QCameraFlash::reserveFlashForCamera(const int camera_id) in reserveFlashForCamera() argument
317 if (camera_id < 0 || camera_id >= MM_CAMERA_MAX_NUM_SENSORS) { in reserveFlashForCamera()
318 LOGE("Invalid camera id: %d", camera_id); in reserveFlashForCamera()
320 } else if (m_cameraOpen[camera_id]) { in reserveFlashForCamera()
322 camera_id); in reserveFlashForCamera()
324 if (m_flashOn[camera_id]) { in reserveFlashForCamera()
325 setFlashMode(camera_id, false); in reserveFlashForCamera()
326 deinitFlash(camera_id); in reserveFlashForCamera()
328 m_cameraOpen[camera_id] = true; in reserveFlashForCamera()
333 QCamera3HardwareInterface::getFlashInfo(camera_id, in reserveFlashForCamera()
344 camera_id); in reserveFlashForCamera()
348 "%d", camera_id); in reserveFlashForCamera()
372 int32_t QCameraFlash::releaseFlashFromCamera(const int camera_id) in releaseFlashFromCamera() argument
376 if (camera_id < 0 || camera_id >= MM_CAMERA_MAX_NUM_SENSORS) { in releaseFlashFromCamera()
377 LOGE("Invalid camera id: %d", camera_id); in releaseFlashFromCamera()
379 } else if (!m_cameraOpen[camera_id]) { in releaseFlashFromCamera()
381 camera_id); in releaseFlashFromCamera()
383 m_cameraOpen[camera_id] = false; in releaseFlashFromCamera()
388 QCamera3HardwareInterface::getFlashInfo(camera_id, in releaseFlashFromCamera()
399 camera_id); in releaseFlashFromCamera()
403 "%d", camera_id); in releaseFlashFromCamera()