Loading services/camera/libcameraservice/Android.bp +4 −37 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ cc_library_shared { "common/CameraDeviceBase.cpp", "common/CameraOfflineSessionBase.cpp", "common/CameraProviderManager.cpp", "common/DepthPhotoProcessor.cpp", "common/FrameProcessorBase.cpp", "api1/CameraClient.cpp", "api1/Camera2Client.cpp", Loading Loading @@ -91,10 +92,12 @@ cc_library_shared { "libmediautils", "libcamera_client", "libcamera_metadata", "libdynamic_depth", "libfmq", "libgui", "libhardware", "libhidlbase", "libimage_io", "libjpeg", "libmedia_codeclist", "libmedia_omx", Loading @@ -102,6 +105,7 @@ cc_library_shared { "libsensorprivacy", "libstagefright", "libstagefright_foundation", "libxml2", "libyuv", "android.frameworks.cameraservice.common@2.0", "android.frameworks.cameraservice.service@2.0", Loading Loading @@ -143,40 +147,3 @@ cc_library_shared { } cc_library_shared { name: "libdepthphoto", srcs: [ "utils/ExifUtils.cpp", "common/DepthPhotoProcessor.cpp", ], shared_libs: [ "libimage_io", "libdynamic_depth", "libxml2", "liblog", "libutilscallstack", "libutils", "libcutils", "libjpeg", "libmemunreachable", "libexif", "libcamera_client", ], include_dirs: [ "external/dynamic_depth/includes", "external/dynamic_depth/internal", ], export_include_dirs: ["."], cflags: [ "-Wall", "-Wextra", "-Werror", "-Wno-ignored-qualifiers", ], } services/camera/libcameraservice/api2/DepthCompositeStream.cpp +2 −28 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ #include "api1/client2/JpegProcessor.h" #include "common/CameraProviderManager.h" #include "dlfcn.h" #include <gui/Surface.h> #include <utils/Log.h> #include <utils/Trace.h> Loading @@ -43,9 +42,7 @@ DepthCompositeStream::DepthCompositeStream(wp<CameraDeviceBase> device, mBlobBufferAcquired(false), mProducerListener(new ProducerListener()), mMaxJpegSize(-1), mIsLogicalCamera(false), mDepthPhotoLibHandle(nullptr), mDepthPhotoProcess(nullptr) { mIsLogicalCamera(false) { sp<CameraDeviceBase> cameraDevice = device.promote(); if (cameraDevice.get() != nullptr) { CameraMetadata staticInfo = cameraDevice->info(); Loading Loading @@ -83,19 +80,6 @@ DepthCompositeStream::DepthCompositeStream(wp<CameraDeviceBase> device, } getSupportedDepthSizes(staticInfo, &mSupportedDepthSizes); mDepthPhotoLibHandle = dlopen(camera3::kDepthPhotoLibrary, RTLD_NOW | RTLD_LOCAL); if (mDepthPhotoLibHandle != nullptr) { mDepthPhotoProcess = reinterpret_cast<camera3::process_depth_photo_frame> ( dlsym(mDepthPhotoLibHandle, camera3::kDepthPhotoProcessFunction)); if (mDepthPhotoProcess == nullptr) { ALOGE("%s: Failed to link to depth photo process function: %s", __FUNCTION__, dlerror()); } } else { ALOGE("%s: Failed to link to depth photo library: %s", __FUNCTION__, dlerror()); } } } Loading @@ -108,11 +92,6 @@ DepthCompositeStream::~DepthCompositeStream() { mDepthSurface.clear(); mDepthConsumer = nullptr; mDepthSurface = nullptr; if (mDepthPhotoLibHandle != nullptr) { dlclose(mDepthPhotoLibHandle); mDepthPhotoLibHandle = nullptr; } mDepthPhotoProcess = nullptr; } void DepthCompositeStream::compilePendingInputLocked() { Loading Loading @@ -356,7 +335,7 @@ status_t DepthCompositeStream::processInputFrame(nsecs_t ts, const InputFrame &i } size_t actualJpegSize = 0; res = mDepthPhotoProcess(depthPhoto, finalJpegBufferSize, dstBuffer, &actualJpegSize); res = processDepthPhotoFrame(depthPhoto, finalJpegBufferSize, dstBuffer, &actualJpegSize); if (res != 0) { ALOGE("%s: Depth photo processing failed: %s (%d)", __FUNCTION__, strerror(-res), res); outputANW->cancelBuffer(mOutputSurface.get(), anb, /*fence*/ -1); Loading Loading @@ -583,11 +562,6 @@ status_t DepthCompositeStream::configureStream() { return NO_ERROR; } if ((mDepthPhotoLibHandle == nullptr) || (mDepthPhotoProcess == nullptr)) { ALOGE("%s: Depth photo library is not present!", __FUNCTION__); return NO_INIT; } if (mOutputSurface.get() == nullptr) { ALOGE("%s: No valid output surface set!", __FUNCTION__); return NO_INIT; Loading services/camera/libcameraservice/api2/DepthCompositeStream.h +0 −2 Original line number Diff line number Diff line Loading @@ -126,8 +126,6 @@ private: std::vector<std::tuple<size_t, size_t>> mSupportedDepthSizes; std::vector<float> mIntrinsicCalibration, mLensDistortion; bool mIsLogicalCamera; void* mDepthPhotoLibHandle; process_depth_photo_frame mDepthPhotoProcess; // Keep all incoming Depth buffer timestamps pending further processing. std::vector<int64_t> mInputDepthBuffers; Loading services/camera/libcameraservice/common/CameraProviderManager.cpp +0 −30 Original line number Diff line number Diff line Loading @@ -716,31 +716,6 @@ void CameraProviderManager::ProviderInfo::DeviceInfo3::getSupportedDynamicDepthS } } bool CameraProviderManager::ProviderInfo::DeviceInfo3::isDepthPhotoLibraryPresent() { static bool libraryPresent = false; static bool initialized = false; if (initialized) { return libraryPresent; } else { initialized = true; } void* depthLibHandle = dlopen(camera3::kDepthPhotoLibrary, RTLD_NOW | RTLD_LOCAL); if (depthLibHandle == nullptr) { return false; } auto processFunc = dlsym(depthLibHandle, camera3::kDepthPhotoProcessFunction); if (processFunc != nullptr) { libraryPresent = true; } else { libraryPresent = false; } dlclose(depthLibHandle); return libraryPresent; } status_t CameraProviderManager::ProviderInfo::DeviceInfo3::addDynamicDepthTags() { uint32_t depthExclTag = ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE; uint32_t depthSizesTag = ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS; Loading Loading @@ -788,11 +763,6 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo3::addDynamicDepthTags() return OK; } if(!isDepthPhotoLibraryPresent()) { // Depth photo processing library is not present, nothing more to do. return OK; } std::vector<int32_t> dynamicDepthEntries; for (const auto& it : supportedDynamicDepthSizes) { int32_t entry[4] = {HAL_PIXEL_FORMAT_BLOB, static_cast<int32_t> (std::get<0>(it)), Loading services/camera/libcameraservice/common/CameraProviderManager.h +0 −1 Original line number Diff line number Diff line Loading @@ -545,7 +545,6 @@ private: void getSupportedDynamicDepthDurations(const std::vector<int64_t>& depthDurations, const std::vector<int64_t>& blobDurations, std::vector<int64_t> *dynamicDepthDurations /*out*/); static bool isDepthPhotoLibraryPresent(); static void getSupportedDynamicDepthSizes( const std::vector<std::tuple<size_t, size_t>>& blobSizes, const std::vector<std::tuple<size_t, size_t>>& depthSizes, Loading Loading
services/camera/libcameraservice/Android.bp +4 −37 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ cc_library_shared { "common/CameraDeviceBase.cpp", "common/CameraOfflineSessionBase.cpp", "common/CameraProviderManager.cpp", "common/DepthPhotoProcessor.cpp", "common/FrameProcessorBase.cpp", "api1/CameraClient.cpp", "api1/Camera2Client.cpp", Loading Loading @@ -91,10 +92,12 @@ cc_library_shared { "libmediautils", "libcamera_client", "libcamera_metadata", "libdynamic_depth", "libfmq", "libgui", "libhardware", "libhidlbase", "libimage_io", "libjpeg", "libmedia_codeclist", "libmedia_omx", Loading @@ -102,6 +105,7 @@ cc_library_shared { "libsensorprivacy", "libstagefright", "libstagefright_foundation", "libxml2", "libyuv", "android.frameworks.cameraservice.common@2.0", "android.frameworks.cameraservice.service@2.0", Loading Loading @@ -143,40 +147,3 @@ cc_library_shared { } cc_library_shared { name: "libdepthphoto", srcs: [ "utils/ExifUtils.cpp", "common/DepthPhotoProcessor.cpp", ], shared_libs: [ "libimage_io", "libdynamic_depth", "libxml2", "liblog", "libutilscallstack", "libutils", "libcutils", "libjpeg", "libmemunreachable", "libexif", "libcamera_client", ], include_dirs: [ "external/dynamic_depth/includes", "external/dynamic_depth/internal", ], export_include_dirs: ["."], cflags: [ "-Wall", "-Wextra", "-Werror", "-Wno-ignored-qualifiers", ], }
services/camera/libcameraservice/api2/DepthCompositeStream.cpp +2 −28 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ #include "api1/client2/JpegProcessor.h" #include "common/CameraProviderManager.h" #include "dlfcn.h" #include <gui/Surface.h> #include <utils/Log.h> #include <utils/Trace.h> Loading @@ -43,9 +42,7 @@ DepthCompositeStream::DepthCompositeStream(wp<CameraDeviceBase> device, mBlobBufferAcquired(false), mProducerListener(new ProducerListener()), mMaxJpegSize(-1), mIsLogicalCamera(false), mDepthPhotoLibHandle(nullptr), mDepthPhotoProcess(nullptr) { mIsLogicalCamera(false) { sp<CameraDeviceBase> cameraDevice = device.promote(); if (cameraDevice.get() != nullptr) { CameraMetadata staticInfo = cameraDevice->info(); Loading Loading @@ -83,19 +80,6 @@ DepthCompositeStream::DepthCompositeStream(wp<CameraDeviceBase> device, } getSupportedDepthSizes(staticInfo, &mSupportedDepthSizes); mDepthPhotoLibHandle = dlopen(camera3::kDepthPhotoLibrary, RTLD_NOW | RTLD_LOCAL); if (mDepthPhotoLibHandle != nullptr) { mDepthPhotoProcess = reinterpret_cast<camera3::process_depth_photo_frame> ( dlsym(mDepthPhotoLibHandle, camera3::kDepthPhotoProcessFunction)); if (mDepthPhotoProcess == nullptr) { ALOGE("%s: Failed to link to depth photo process function: %s", __FUNCTION__, dlerror()); } } else { ALOGE("%s: Failed to link to depth photo library: %s", __FUNCTION__, dlerror()); } } } Loading @@ -108,11 +92,6 @@ DepthCompositeStream::~DepthCompositeStream() { mDepthSurface.clear(); mDepthConsumer = nullptr; mDepthSurface = nullptr; if (mDepthPhotoLibHandle != nullptr) { dlclose(mDepthPhotoLibHandle); mDepthPhotoLibHandle = nullptr; } mDepthPhotoProcess = nullptr; } void DepthCompositeStream::compilePendingInputLocked() { Loading Loading @@ -356,7 +335,7 @@ status_t DepthCompositeStream::processInputFrame(nsecs_t ts, const InputFrame &i } size_t actualJpegSize = 0; res = mDepthPhotoProcess(depthPhoto, finalJpegBufferSize, dstBuffer, &actualJpegSize); res = processDepthPhotoFrame(depthPhoto, finalJpegBufferSize, dstBuffer, &actualJpegSize); if (res != 0) { ALOGE("%s: Depth photo processing failed: %s (%d)", __FUNCTION__, strerror(-res), res); outputANW->cancelBuffer(mOutputSurface.get(), anb, /*fence*/ -1); Loading Loading @@ -583,11 +562,6 @@ status_t DepthCompositeStream::configureStream() { return NO_ERROR; } if ((mDepthPhotoLibHandle == nullptr) || (mDepthPhotoProcess == nullptr)) { ALOGE("%s: Depth photo library is not present!", __FUNCTION__); return NO_INIT; } if (mOutputSurface.get() == nullptr) { ALOGE("%s: No valid output surface set!", __FUNCTION__); return NO_INIT; Loading
services/camera/libcameraservice/api2/DepthCompositeStream.h +0 −2 Original line number Diff line number Diff line Loading @@ -126,8 +126,6 @@ private: std::vector<std::tuple<size_t, size_t>> mSupportedDepthSizes; std::vector<float> mIntrinsicCalibration, mLensDistortion; bool mIsLogicalCamera; void* mDepthPhotoLibHandle; process_depth_photo_frame mDepthPhotoProcess; // Keep all incoming Depth buffer timestamps pending further processing. std::vector<int64_t> mInputDepthBuffers; Loading
services/camera/libcameraservice/common/CameraProviderManager.cpp +0 −30 Original line number Diff line number Diff line Loading @@ -716,31 +716,6 @@ void CameraProviderManager::ProviderInfo::DeviceInfo3::getSupportedDynamicDepthS } } bool CameraProviderManager::ProviderInfo::DeviceInfo3::isDepthPhotoLibraryPresent() { static bool libraryPresent = false; static bool initialized = false; if (initialized) { return libraryPresent; } else { initialized = true; } void* depthLibHandle = dlopen(camera3::kDepthPhotoLibrary, RTLD_NOW | RTLD_LOCAL); if (depthLibHandle == nullptr) { return false; } auto processFunc = dlsym(depthLibHandle, camera3::kDepthPhotoProcessFunction); if (processFunc != nullptr) { libraryPresent = true; } else { libraryPresent = false; } dlclose(depthLibHandle); return libraryPresent; } status_t CameraProviderManager::ProviderInfo::DeviceInfo3::addDynamicDepthTags() { uint32_t depthExclTag = ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE; uint32_t depthSizesTag = ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS; Loading Loading @@ -788,11 +763,6 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo3::addDynamicDepthTags() return OK; } if(!isDepthPhotoLibraryPresent()) { // Depth photo processing library is not present, nothing more to do. return OK; } std::vector<int32_t> dynamicDepthEntries; for (const auto& it : supportedDynamicDepthSizes) { int32_t entry[4] = {HAL_PIXEL_FORMAT_BLOB, static_cast<int32_t> (std::get<0>(it)), Loading
services/camera/libcameraservice/common/CameraProviderManager.h +0 −1 Original line number Diff line number Diff line Loading @@ -545,7 +545,6 @@ private: void getSupportedDynamicDepthDurations(const std::vector<int64_t>& depthDurations, const std::vector<int64_t>& blobDurations, std::vector<int64_t> *dynamicDepthDurations /*out*/); static bool isDepthPhotoLibraryPresent(); static void getSupportedDynamicDepthSizes( const std::vector<std::tuple<size_t, size_t>>& blobSizes, const std::vector<std::tuple<size_t, size_t>>& depthSizes, Loading