Lines Matching refs:cameraId
103 status_t CameraService::getCameraInfo(int cameraId,
105 if (cameraId < 0 || cameraId >= mNumberOfCameras) {
109 HAL_getCameraInfo(cameraId, cameraInfo);
114 const sp<ICameraClient>& cameraClient, int cameraId) {
116 LOG1("CameraService::connect E (pid %d, id %d)", callingPid, cameraId);
119 if (cameraId < 0 || cameraId >= mNumberOfCameras) {
120 LOGE("CameraService::connect X (pid %d) rejected (invalid cameraId %d).",
121 callingPid, cameraId);
126 if (mClient[cameraId] != 0) {
127 client = mClient[cameraId].promote();
139 mClient[cameraId].clear();
142 if (mBusy[cameraId]) {
144 " (camera %d is still busy).", callingPid, cameraId);
148 sp<CameraHardwareInterface> hardware = HAL_openCameraHardware(cameraId);
150 LOGE("Fail to open camera hardware (id=%d)", cameraId);
154 HAL_getCameraInfo(cameraId, &info);
155 client = new Client(this, cameraClient, hardware, cameraId, info.facing,
157 mClient[cameraId] = client;
197 sp<CameraService::Client> CameraService::getClientById(int cameraId) {
198 if (cameraId < 0 || cameraId >= mNumberOfCameras) return NULL;
199 return mClient[cameraId].promote();
231 void CameraService::setCameraBusy(int cameraId) {
232 android_atomic_write(1, &mBusy[cameraId]);
235 void CameraService::setCameraFree(int cameraId) {
236 android_atomic_write(0, &mBusy[cameraId]);
298 int cameraId, int cameraFacing, int clientPid) {
305 mCameraId = cameraId;
314 (void *)cameraId);
327 cameraService->setCameraBusy(cameraId);