summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/camera/Camera.cpp33
-rw-r--r--modules/camera/Camera.h4
2 files changed, 37 insertions, 0 deletions
diff --git a/modules/camera/Camera.cpp b/modules/camera/Camera.cpp
index 7f53c2e..4a45a2e 100644
--- a/modules/camera/Camera.cpp
+++ b/modules/camera/Camera.cpp
@@ -310,6 +310,25 @@ int Camera::processCaptureRequest(camera3_capture_request_t *request)
setSettings(request->settings);
}
+ if (request->input_buffer != NULL) {
+ ALOGV("%s:%d: Reprocessing input buffer %p", __func__, mId,
+ request->input_buffer);
+
+ if (!isValidReprocessSettings(request->settings)) {
+ ALOGE("%s:%d: Invalid settings for reprocess request: %p",
+ __func__, mId, request->settings);
+ return -EINVAL;
+ }
+ } else {
+ ALOGV("%s:%d: Capturing new frame.", __func__, mId);
+
+ if (!isValidCaptureSettings(request->settings)) {
+ ALOGE("%s:%d: Invalid settings for capture request: %p",
+ __func__, mId, request->settings);
+ return -EINVAL;
+ }
+ }
+
// TODO: verify request; submit request to hardware
return 0;
}
@@ -325,6 +344,20 @@ void Camera::setSettings(const camera_metadata_t *new_settings)
mSettings = clone_camera_metadata(new_settings);
}
+bool Camera::isValidCaptureSettings(const camera_metadata_t *settings)
+{
+ // TODO: reject settings that cannot be captured
+ return true;
+}
+
+bool Camera::isValidReprocessSettings(const camera_metadata_t *settings)
+{
+ // TODO: reject settings that cannot be reprocessed
+ // input buffers unimplemented, use this to reject reprocessing requests
+ ALOGE("%s:%d: Input buffer reprocessing not implemented", __func__, mId);
+ return false;
+}
+
void Camera::getMetadataVendorTagOps(vendor_tag_query_ops_t *ops)
{
ALOGV("%s:%d: ops=%p", __func__, mId, ops);
diff --git a/modules/camera/Camera.h b/modules/camera/Camera.h
index 1d88cf3..39e47f7 100644
--- a/modules/camera/Camera.h
+++ b/modules/camera/Camera.h
@@ -61,6 +61,10 @@ class Camera {
void setupStreams(Stream **array, int count);
// Copy new settings for re-use and clean up old settings.
void setSettings(const camera_metadata_t *new_settings);
+ // Verify settings are valid for a capture
+ bool isValidCaptureSettings(const camera_metadata_t *settings);
+ // Verify settings are valid for reprocessing an input buffer
+ bool isValidReprocessSettings(const camera_metadata_t *settings);
// Identifier used by framework to distinguish cameras
const int mId;