summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2021-07-05 19:39:16 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2021-08-02 18:07:35 +0900
commit719ac763388a44685855562039226823681c1f57 (patch)
tree5eaf56891877a803233d8988a91090b2b65cc96c
parent822d9e61fa3a23e3a9e6d45355c2324143e4b7d4 (diff)
android: Add skeletal still and manual request templates
Add skeletal still and manual request templates so that we can expand them for FULL support. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/android/camera_capabilities.cpp18
-rw-r--r--src/android/camera_capabilities.h2
-rw-r--r--src/android/camera_device.cpp7
3 files changed, 25 insertions, 2 deletions
diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
index 8e91037a..4f764402 100644
--- a/src/android/camera_capabilities.cpp
+++ b/src/android/camera_capabilities.cpp
@@ -1322,6 +1322,15 @@ PixelFormat CameraCapabilities::toPixelFormat(int format) const
return it->second;
}
+std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplateManual() const
+{
+ std::unique_ptr<CameraMetadata> manualTemplate = requestTemplatePreview();
+ if (!manualTemplate)
+ return nullptr;
+
+ return manualTemplate;
+}
+
std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() const
{
/*
@@ -1411,6 +1420,15 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con
return requestTemplate;
}
+std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplateStill() const
+{
+ std::unique_ptr<CameraMetadata> stillTemplate = requestTemplatePreview();
+ if (!stillTemplate)
+ return nullptr;
+
+ return stillTemplate;
+}
+
std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplateVideo() const
{
std::unique_ptr<CameraMetadata> previewTemplate = requestTemplatePreview();
diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h
index dc5339c1..576f1e7c 100644
--- a/src/android/camera_capabilities.h
+++ b/src/android/camera_capabilities.h
@@ -32,7 +32,9 @@ public:
libcamera::PixelFormat toPixelFormat(int format) const;
unsigned int maxJpegBufferSize() const { return maxJpegBufferSize_; }
+ std::unique_ptr<CameraMetadata> requestTemplateManual() const;
std::unique_ptr<CameraMetadata> requestTemplatePreview() const;
+ std::unique_ptr<CameraMetadata> requestTemplateStill() const;
std::unique_ptr<CameraMetadata> requestTemplateVideo() const;
private:
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 678cde23..692d0a5b 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -487,7 +487,7 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type)
* for the torch mode we currently do not support.
*/
captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE;
- requestTemplate = capabilities_.requestTemplatePreview();
+ requestTemplate = capabilities_.requestTemplateStill();
break;
case CAMERA3_TEMPLATE_VIDEO_RECORD:
captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD;
@@ -497,9 +497,12 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type)
captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT;
requestTemplate = capabilities_.requestTemplateVideo();
break;
+ case CAMERA3_TEMPLATE_MANUAL:
+ captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_MANUAL;
+ requestTemplate = capabilities_.requestTemplateManual();
+ break;
/* \todo Implement templates generation for the remaining use cases. */
case CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG:
- case CAMERA3_TEMPLATE_MANUAL:
default:
LOG(HAL, Error) << "Unsupported template request type: " << type;
return nullptr;