diff options
Diffstat (limited to 'src/android/mm/generic_frame_buffer_allocator.cpp')
-rw-r--r-- | src/android/mm/generic_frame_buffer_allocator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/android/mm/generic_frame_buffer_allocator.cpp b/src/android/mm/generic_frame_buffer_allocator.cpp index 3750e1bf..7ecef2c6 100644 --- a/src/android/mm/generic_frame_buffer_allocator.cpp +++ b/src/android/mm/generic_frame_buffer_allocator.cpp @@ -5,6 +5,7 @@ * generic_camera_buffer.cpp - Allocate FrameBuffer using gralloc API */ +#include <dlfcn.h> #include <memory> #include <vector> @@ -72,9 +73,10 @@ class PlatformFrameBufferAllocator::Private : public Extensible::Private public: Private(CameraDevice *const cameraDevice) : cameraDevice_(cameraDevice), - hardwareModule_(cameraDevice->camera3Device()->common.module), + hardwareModule_(nullptr), allocDevice_(nullptr) { + hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &hardwareModule_); ASSERT(hardwareModule_); } @@ -85,7 +87,7 @@ public: private: const CameraDevice *const cameraDevice_; - struct hw_module_t *const hardwareModule_; + const struct hw_module_t *hardwareModule_; struct alloc_device_t *allocDevice_; }; @@ -93,6 +95,7 @@ PlatformFrameBufferAllocator::Private::~Private() { if (allocDevice_) gralloc_close(allocDevice_); + dlclose(hardwareModule_->dso); } std::unique_ptr<HALFrameBuffer> |