summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-12-09 18:16:11 +0100
committerJacopo Mondi <jacopo@jmondi.org>2020-12-18 17:48:49 +0100
commiteec6c541341c4d6d8e3654773e94c0d93ff3a1bf (patch)
tree0246a7f1f8c59d883117ae013b1ee96676a24e6d /src
parent3535e0c10424e70df6feb1cbe2003695d61c0dfd (diff)
android: camera_device: Report number of out streams
Report the number of supported output streams through the ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS static metadata. The camera HAL currently supports: - 1 optional RAW stream - 2 YUV streams - 1 JPEG stream Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src')
-rw-r--r--src/android/camera_device.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 26aa3bc4..b4618a68 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -675,10 +675,10 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize()
{
/*
* \todo Keep this in sync with the actual number of entries.
- * Currently: 52 entries, 698 bytes of static metadata
+ * Currently: 53 entries, 714 bytes of static metadata
*/
- uint32_t numEntries = 52;
- uint32_t byteSize = 698;
+ uint32_t numEntries = 53;
+ uint32_t byteSize = 714;
/*
* Calculate space occupation in bytes for dynamically built metadata
@@ -1090,15 +1090,23 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
};
/* Report if camera supports RAW. */
+ bool rawStreamAvailable = false;
std::unique_ptr<CameraConfiguration> cameraConfig =
camera_->generateConfiguration({ StreamRole::Raw });
if (cameraConfig && !cameraConfig->empty()) {
const PixelFormatInfo &info =
PixelFormatInfo::info(cameraConfig->at(0).pixelFormat);
- if (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW)
+ if (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) {
+ rawStreamAvailable = true;
availableCapabilities.push_back(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW);
+ }
}
+ /* Number of { RAW, YUV, JPEG } supported output streams */
+ int32_t numOutStreams[] = { rawStreamAvailable, 2, 1 };
+ staticMetadata_->addEntry(ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS,
+ &numOutStreams, 3);
+
staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CAPABILITIES,
availableCapabilities.data(),
availableCapabilities.size());
@@ -1150,6 +1158,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL,
ANDROID_REQUEST_PARTIAL_RESULT_COUNT,
ANDROID_REQUEST_PIPELINE_MAX_DEPTH,
+ ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS,
ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS,
ANDROID_REQUEST_AVAILABLE_CAPABILITIES,
};