diff options
author | vincechiu <vincechiu@google.com> | 2020-06-23 05:02:45 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-23 05:02:45 +0000 |
commit | 80d66134a22a78091235bd6e40e01fefdb18b8ab (patch) | |
tree | b246a3b977947a92aecf467d052046713edee8ce | |
parent | ee0f536c8a276950fea36de6fb0780b6b321764b (diff) | |
parent | ddbeab7bd55c1f884ea81f794b9d21b85261fcf6 (diff) | |
download | camera-80d66134a22a78091235bd6e40e01fefdb18b8ab.tar.gz |
camera: Fix halConfiguration parameters back to frameworks am: ddbeab7bd5
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/camera/+/11949284
Change-Id: Icffe363670c1248b1a579df0a256b624e8a3d8ef
-rw-r--r-- | common/hal/google_camera_hal/hdrplus_capture_session.cc | 32 | ||||
-rw-r--r-- | common/hal/google_camera_hal/hdrplus_capture_session.h | 5 |
2 files changed, 37 insertions, 0 deletions
diff --git a/common/hal/google_camera_hal/hdrplus_capture_session.cc b/common/hal/google_camera_hal/hdrplus_capture_session.cc index 1502fb0..aede085 100644 --- a/common/hal/google_camera_hal/hdrplus_capture_session.cc +++ b/common/hal/google_camera_hal/hdrplus_capture_session.cc @@ -22,6 +22,7 @@ #include <utils/Trace.h> #include <inttypes.h> +#include <set> #include "hal_utils.h" #include "hdrplus_capture_session.h" @@ -529,6 +530,13 @@ status_t HdrplusCaptureSession::Initialize( return res; } + res = PurgeHalConfiguredStream(stream_config, hal_configured_streams); + if (res != OK) { + ALOGE("%s: Removing internal streams from configured stream failed: %s(%d)", + __FUNCTION__, strerror(-res), res); + return res; + } + // Connect realtime process chain res = ConnectProcessChain(request_processor_.get(), std::move(realtime_process_block), @@ -609,6 +617,30 @@ void HdrplusCaptureSession::ProcessCaptureResult( } } +status_t HdrplusCaptureSession::PurgeHalConfiguredStream( + const StreamConfiguration& stream_config, + std::vector<HalStream>* hal_configured_streams) { + if (hal_configured_streams == nullptr) { + ALOGE("%s: HAL configured stream list is null.", __FUNCTION__); + return BAD_VALUE; + } + + std::set<int32_t> framework_stream_id_set; + for (auto& stream : stream_config.streams) { + framework_stream_id_set.insert(stream.id); + } + + std::vector<HalStream> configured_streams; + for (auto& hal_stream : *hal_configured_streams) { + if (framework_stream_id_set.find(hal_stream.id) != + framework_stream_id_set.end()) { + configured_streams.push_back(hal_stream); + } + } + *hal_configured_streams = configured_streams; + return OK; +} + void HdrplusCaptureSession::NotifyHalMessage(const NotifyMessage& message) { ATRACE_CALL(); std::lock_guard<std::mutex> lock(callback_lock_); diff --git a/common/hal/google_camera_hal/hdrplus_capture_session.h b/common/hal/google_camera_hal/hdrplus_capture_session.h index 6944129..d346c3b 100644 --- a/common/hal/google_camera_hal/hdrplus_capture_session.h +++ b/common/hal/google_camera_hal/hdrplus_capture_session.h @@ -121,6 +121,11 @@ class HdrplusCaptureSession : public CaptureSession { std::unique_ptr<ProcessBlock> process_block, std::unique_ptr<ResultProcessor> result_processor); + // Purge the hal_configured_streams such that only framework streams are left + status_t PurgeHalConfiguredStream( + const StreamConfiguration& stream_config, + std::vector<HalStream>* hal_configured_streams); + // Invoked when receiving a result from result processor. void ProcessCaptureResult(std::unique_ptr<CaptureResult> result); |