Loading services/camera/libcameraservice/CameraService.cpp +10 −4 Original line number Original line Diff line number Diff line Loading @@ -240,7 +240,13 @@ status_t CameraService::enumerateProviders() { // Derive primary rear/front cameras, and filter their charactierstics. // Derive primary rear/front cameras, and filter their charactierstics. // This needs to be done after all cameras are enumerated and camera ids are sorted. // This needs to be done after all cameras are enumerated and camera ids are sorted. if (SessionConfigurationUtils::IS_PERF_CLASS) { if (SessionConfigurationUtils::IS_PERF_CLASS) { filterSPerfClassCharacteristics(); // Assume internal cameras are advertised from the same // provider. If multiple providers are registered at different time, // and each provider contains multiple internal color cameras, the current // logic may filter the characteristics of more than one front/rear color // cameras. Mutex::Autolock l(mServiceLock); filterSPerfClassCharacteristicsLocked(); } } return OK; return OK; Loading Loading @@ -313,7 +319,7 @@ void CameraService::updateCameraNumAndIds() { filterAPI1SystemCameraLocked(mNormalDeviceIds); filterAPI1SystemCameraLocked(mNormalDeviceIds); } } void CameraService::filterSPerfClassCharacteristics() { void CameraService::filterSPerfClassCharacteristicsLocked() { // To claim to be S Performance primary cameras, the cameras must be // To claim to be S Performance primary cameras, the cameras must be // backward compatible. So performance class primary camera Ids must be API1 // backward compatible. So performance class primary camera Ids must be API1 // compatible. // compatible. Loading services/camera/libcameraservice/CameraService.h +3 −2 Original line number Original line Diff line number Diff line Loading @@ -945,9 +945,10 @@ private: void updateCameraNumAndIds(); void updateCameraNumAndIds(); /** /** * Filter camera characteristics for S Performance class primary cameras * Filter camera characteristics for S Performance class primary cameras. * mServiceLock should be locked. */ */ void filterSPerfClassCharacteristics(); void filterSPerfClassCharacteristicsLocked(); // File descriptor to temp file used for caching previous open // File descriptor to temp file used for caching previous open // session dumpsys info. // session dumpsys info. Loading services/camera/libcameraservice/common/CameraProviderManager.cpp +3 −2 Original line number Original line Diff line number Diff line Loading @@ -476,15 +476,16 @@ hardware::Return<void> CameraProviderManager::onRegistration( const hardware::hidl_string& /*fqName*/, const hardware::hidl_string& /*fqName*/, const hardware::hidl_string& name, const hardware::hidl_string& name, bool preexisting) { bool preexisting) { status_t res = OK; std::lock_guard<std::mutex> providerLock(mProviderLifecycleLock); std::lock_guard<std::mutex> providerLock(mProviderLifecycleLock); { { std::lock_guard<std::mutex> lock(mInterfaceMutex); std::lock_guard<std::mutex> lock(mInterfaceMutex); addProviderLocked(name, preexisting); res = addProviderLocked(name, preexisting); } } sp<StatusListener> listener = getStatusListener(); sp<StatusListener> listener = getStatusListener(); if (nullptr != listener.get()) { if (nullptr != listener.get() && res == OK) { listener->onNewProviderRegistered(); listener->onNewProviderRegistered(); } } Loading Loading
services/camera/libcameraservice/CameraService.cpp +10 −4 Original line number Original line Diff line number Diff line Loading @@ -240,7 +240,13 @@ status_t CameraService::enumerateProviders() { // Derive primary rear/front cameras, and filter their charactierstics. // Derive primary rear/front cameras, and filter their charactierstics. // This needs to be done after all cameras are enumerated and camera ids are sorted. // This needs to be done after all cameras are enumerated and camera ids are sorted. if (SessionConfigurationUtils::IS_PERF_CLASS) { if (SessionConfigurationUtils::IS_PERF_CLASS) { filterSPerfClassCharacteristics(); // Assume internal cameras are advertised from the same // provider. If multiple providers are registered at different time, // and each provider contains multiple internal color cameras, the current // logic may filter the characteristics of more than one front/rear color // cameras. Mutex::Autolock l(mServiceLock); filterSPerfClassCharacteristicsLocked(); } } return OK; return OK; Loading Loading @@ -313,7 +319,7 @@ void CameraService::updateCameraNumAndIds() { filterAPI1SystemCameraLocked(mNormalDeviceIds); filterAPI1SystemCameraLocked(mNormalDeviceIds); } } void CameraService::filterSPerfClassCharacteristics() { void CameraService::filterSPerfClassCharacteristicsLocked() { // To claim to be S Performance primary cameras, the cameras must be // To claim to be S Performance primary cameras, the cameras must be // backward compatible. So performance class primary camera Ids must be API1 // backward compatible. So performance class primary camera Ids must be API1 // compatible. // compatible. Loading
services/camera/libcameraservice/CameraService.h +3 −2 Original line number Original line Diff line number Diff line Loading @@ -945,9 +945,10 @@ private: void updateCameraNumAndIds(); void updateCameraNumAndIds(); /** /** * Filter camera characteristics for S Performance class primary cameras * Filter camera characteristics for S Performance class primary cameras. * mServiceLock should be locked. */ */ void filterSPerfClassCharacteristics(); void filterSPerfClassCharacteristicsLocked(); // File descriptor to temp file used for caching previous open // File descriptor to temp file used for caching previous open // session dumpsys info. // session dumpsys info. Loading
services/camera/libcameraservice/common/CameraProviderManager.cpp +3 −2 Original line number Original line Diff line number Diff line Loading @@ -476,15 +476,16 @@ hardware::Return<void> CameraProviderManager::onRegistration( const hardware::hidl_string& /*fqName*/, const hardware::hidl_string& /*fqName*/, const hardware::hidl_string& name, const hardware::hidl_string& name, bool preexisting) { bool preexisting) { status_t res = OK; std::lock_guard<std::mutex> providerLock(mProviderLifecycleLock); std::lock_guard<std::mutex> providerLock(mProviderLifecycleLock); { { std::lock_guard<std::mutex> lock(mInterfaceMutex); std::lock_guard<std::mutex> lock(mInterfaceMutex); addProviderLocked(name, preexisting); res = addProviderLocked(name, preexisting); } } sp<StatusListener> listener = getStatusListener(); sp<StatusListener> listener = getStatusListener(); if (nullptr != listener.get()) { if (nullptr != listener.get() && res == OK) { listener->onNewProviderRegistered(); listener->onNewProviderRegistered(); } } Loading