Revert "Revert "Convert from HIDL mapper to libui GraphicBufferM..."
Revert submission 24913374-revert-24747509-camera_fail2-OVHUVTAXRP
Reason for revert: 32-bit TV build is fixed with `%zu` instead of `%lu` for size_t argument.
Reverted changes: /q/submissionid:24913374-revert-24747509-camera_fail2-OVHUVTAXRP
Change-Id: I16287ce2dbea034db41450a3a5e9c3f729e76335
diff --git a/camera/common/default/include/HandleImporter.h b/camera/common/default/include/HandleImporter.h
index 5408ba9..df01202 100644
--- a/camera/common/default/include/HandleImporter.h
+++ b/camera/common/default/include/HandleImporter.h
@@ -17,15 +17,11 @@
#ifndef CAMERA_COMMON_1_0_HANDLEIMPORTED_H
#define CAMERA_COMMON_1_0_HANDLEIMPORTED_H
-#include <android/hardware/graphics/mapper/2.0/IMapper.h>
-#include <android/hardware/graphics/mapper/3.0/IMapper.h>
-#include <android/hardware/graphics/mapper/4.0/IMapper.h>
#include <cutils/native_handle.h>
+#include <system/graphics.h>
+#include <ui/Rect.h>
#include <utils/Mutex.h>
-using android::hardware::graphics::mapper::V2_0::IMapper;
-using android::hardware::graphics::mapper::V2_0::YCbCrLayout;
-
namespace android {
namespace hardware {
namespace camera {
@@ -49,11 +45,11 @@
void* lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size);
// Locks 2-D buffer. Assumes caller has waited for acquire fences.
- void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const IMapper::Rect& accessRegion);
+ void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const android::Rect& accessRegion);
// Assumes caller has waited for acquire fences.
- YCbCrLayout lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage,
- const IMapper::Rect& accessRegion);
+ android_ycbcr lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage,
+ const android::Rect& accessRegion);
// Query the stride of the first plane in bytes.
status_t getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/);
@@ -69,19 +65,11 @@
void initializeLocked();
void cleanup();
- template <class M, class E>
- bool importBufferInternal(const sp<M> mapper, buffer_handle_t& handle);
- template <class M, class E>
- YCbCrLayout lockYCbCrInternal(const sp<M> mapper, buffer_handle_t& buf, uint64_t cpuUsage,
- const IMapper::Rect& accessRegion);
- template <class M, class E>
- int unlockInternal(const sp<M> mapper, buffer_handle_t& buf);
+ bool importBufferInternal(buffer_handle_t& handle);
+ int unlockInternal(buffer_handle_t& buf);
Mutex mLock;
bool mInitialized;
- sp<IMapper> mMapperV2;
- sp<graphics::mapper::V3_0::IMapper> mMapperV3;
- sp<graphics::mapper::V4_0::IMapper> mMapperV4;
};
} // namespace helper