summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2017-07-11 18:52:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-07-11 18:52:57 +0000
commitd96dd1bfbc88c7d17b6011fea39207db04ff2029 (patch)
treeb70a8909181c40c4e96fddecddfeea4ed0cc480d
parentce52c9f940a170145c737f4dcd96ebf5915ac63b (diff)
parentacd7b6df604b58a2074dbab75332808ac8485963 (diff)
downloadeasel-d96dd1bfbc88c7d17b6011fea39207db04ff2029.tar.gz
Merge "libhdrplusclient: Support crop region"
-rw-r--r--camera/include/HdrPlusTypes.h22
-rw-r--r--camera/libhdrplusclient/include/HdrPlusClient.h6
2 files changed, 27 insertions, 1 deletions
diff --git a/camera/include/HdrPlusTypes.h b/camera/include/HdrPlusTypes.h
index 034ef6c..3f61964 100644
--- a/camera/include/HdrPlusTypes.h
+++ b/camera/include/HdrPlusTypes.h
@@ -397,6 +397,28 @@ struct FrameMetadata {
};
/*
+ * RequestMetadata defines the properties for a capture request.
+ *
+ * If this structure is changed, serialization in MessengerToHdrPlusClient and deserialization in
+ * MessengerListenerFromHdrPlusService should also be updated.
+ */
+struct RequestMetadata {
+ std::array<int32_t, 4> cropRegion; // android.scaler.cropRegion (x_min, y_min, width, height)
+
+ // Check if the contents of lhs and rhs are equal. For vector and array variables, two are
+ // equal if their elements are equal at the same position.
+ bool operator==(const RequestMetadata& rhs) const {
+ return cropRegion == rhs.cropRegion;
+ }
+
+ // Convert this static metadata to a string and append it to the specified string.
+ void appendToString(std::string *strOut) const {
+ if (strOut == nullptr) return;
+ metadatautils::appendVectorOrArrayToString(strOut, "cropRegion", cropRegion);
+ }
+};
+
+/*
* ResultMetadata defines a process frame's properties that have been modified due to processing.
*
* If this structure is changed, serialization in MessengerToHdrPlusClient and deserialization in
diff --git a/camera/libhdrplusclient/include/HdrPlusClient.h b/camera/libhdrplusclient/include/HdrPlusClient.h
index 962a5e8..7896c89 100644
--- a/camera/libhdrplusclient/include/HdrPlusClient.h
+++ b/camera/libhdrplusclient/include/HdrPlusClient.h
@@ -17,10 +17,12 @@
#ifndef HDR_PLUS_CLIENT_H
#define HDR_PLUS_CLIENT_H
+#include "CameraMetadata.h"
#include "hardware/camera3.h"
#include "HdrPlusClientListener.h"
#include "HdrPlusTypes.h"
+using ::android::hardware::camera::common::V1_0::helper::CameraMetadata;
namespace android {
/**
@@ -111,12 +113,14 @@ public:
* buffer will be returned in CaptureResult only once.
*
* request is a CaptureRequest containing output buffers to be filled by HDR+ service.
+ * requestMetadata is the metadata for this request.
*
* Returns:
* 0: on success.
* -EINVAL: if the request is invalid such as containing invalid stream IDs.
*/
- virtual status_t submitCaptureRequest(pbcamera::CaptureRequest *request) = 0;
+ virtual status_t submitCaptureRequest(pbcamera::CaptureRequest *request,
+ const CameraMetadata &requestMetadata) = 0;
/*
* Send an input buffer to HDR+ service. This is used when HDR+ service's input buffers come