summaryrefslogtreecommitdiffstats
path: root/modules/camera
diff options
context:
space:
mode:
authorAlex Ray <aray@google.com>2013-04-26 14:47:08 -0700
committerAlexander Ray <aray@google.com>2013-05-29 03:38:20 +0000
commit11bbeefaf9ba410916ec03a5c6869fe4eb67d672 (patch)
treea6787f8dc939c5a043a3cdbc7bea6cfa8b0b7f92 /modules/camera
parentbfcbd95a1f1aa41f665da5ce78cd7a0098c58f69 (diff)
downloadhardware_libhardware-11bbeefaf9ba410916ec03a5c6869fe4eb67d672.zip
hardware_libhardware-11bbeefaf9ba410916ec03a5c6869fe4eb67d672.tar.gz
hardware_libhardware-11bbeefaf9ba410916ec03a5c6869fe4eb67d672.tar.bz2
modules: camera: Input buffer reprocessing scaffolding
Change-Id: I158ba833549aee47ca3be5673f6f5d33e455ef59
Diffstat (limited to 'modules/camera')
-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;