summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinghui Tan <mhtan@google.com>2021-07-13 14:39:15 -0700
committerMinghui Tan <mhtan@google.com>2021-07-20 20:35:53 +0000
commitd616205ea4ece7a4b31f66f2d24ecd087aeebeac (patch)
tree1e8c8904d62dbbd6b122a62155c0122ca8ecd8b2
parente3451b87d4da7467390383800c59eb607df123ee (diff)
downloadcamera-d616205ea4ece7a4b31f66f2d24ecd087aeebeac.tar.gz
Enable software denoise for YUV + Preview only streams.
Bug: 193432440 Fix: 193432440 Test: IG Change-Id: I2b1c8c75025c9c19837e7fd104481a61c2924f18
-rw-r--r--common/hal/google_camera_hal/realtime_zsl_request_processor.cc5
-rw-r--r--common/hal/google_camera_hal/zsl_snapshot_capture_session.cc12
2 files changed, 11 insertions, 6 deletions
diff --git a/common/hal/google_camera_hal/realtime_zsl_request_processor.cc b/common/hal/google_camera_hal/realtime_zsl_request_processor.cc
index 33fde51..5a0805c 100644
--- a/common/hal/google_camera_hal/realtime_zsl_request_processor.cc
+++ b/common/hal/google_camera_hal/realtime_zsl_request_processor.cc
@@ -194,7 +194,8 @@ status_t RealtimeZslRequestProcessor::ConfigureStreams(
// checked the size is supported in capture session.
if (pixel_format_ == android_pixel_format_t::HAL_PIXEL_FORMAT_YCBCR_420_888) {
for (const auto& stream : stream_config.streams) {
- if (utils::IsJPEGSnapshotStream(stream)) {
+ if (utils::IsJPEGSnapshotStream(stream) ||
+ utils::IsYUVSnapshotStream(stream)) {
if (SelectWidthAndHeight(stream.width, stream.height,
*device_session_hwl_, active_array_width_,
active_array_height_) != OK) {
@@ -202,7 +203,7 @@ status_t RealtimeZslRequestProcessor::ConfigureStreams(
__FUNCTION__);
return BAD_VALUE;
}
- ALOGI("%s, JPEG size is (%d x %d), selected size is (%d x %d)",
+ ALOGI("%s, Snapshot size is (%d x %d), selected size is (%d x %d)",
__FUNCTION__, stream.width, stream.height, active_array_width_,
active_array_height_);
break;
diff --git a/common/hal/google_camera_hal/zsl_snapshot_capture_session.cc b/common/hal/google_camera_hal/zsl_snapshot_capture_session.cc
index a7c0fd8..077a880 100644
--- a/common/hal/google_camera_hal/zsl_snapshot_capture_session.cc
+++ b/common/hal/google_camera_hal/zsl_snapshot_capture_session.cc
@@ -165,6 +165,7 @@ bool ZslSnapshotCaptureSession::IsStreamConfigurationSupported(
bool has_jpeg_stream = false;
bool has_preview_stream = false;
+ bool has_yuv_stream = false;
for (const auto& stream : stream_config.streams) {
if (stream.is_physical_camera_stream) {
ALOGE("%s: support logical camera only", __FUNCTION__);
@@ -174,13 +175,16 @@ bool ZslSnapshotCaptureSession::IsStreamConfigurationSupported(
has_jpeg_stream = true;
} else if (utils::IsPreviewStream(stream)) {
has_preview_stream = true;
- } else if (!utils::IsYUVSnapshotStream(stream)) {
- ALOGE("%s: only support preview + snapshot (+ YUV) streams", __FUNCTION__);
+ } else if (utils::IsYUVSnapshotStream(stream)) {
+ has_yuv_stream = true;
+ } else {
+ ALOGE("%s: only support preview + (snapshot and/or YUV) streams",
+ __FUNCTION__);
return false;
}
}
- if (!has_jpeg_stream) {
- ALOGE("%s: no JPEG stream", __FUNCTION__);
+ if (!has_jpeg_stream && !has_yuv_stream) {
+ ALOGE("%s: no JPEG or YUV stream", __FUNCTION__);
return false;
}