[Problem]
Prepare of SW Decoder is performed when application state changes
from `RESUMED` to `SUSPENDED`.
[Cause]
No condition to prevent decoder preparation during suspend.
[Solution]
Add required guard.
Bug: https://jira-eu.sec.samsung.net/browse/VDWASM-1921
Change-Id: Ic3ee21a70a7a4038065394e139ec080c6d01502c
Signed-off-by: Michal Jurkiewicz <m.jurkiewicz@samsung.com>
void VideoCaptureDeviceTizenTv::Impl::UpdateCameraState() {
const auto new_state = ComputeState();
+ if (new_state == last_state_) {
+ return;
+ }
+
const bool was_suspended = last_state_ == suspend_resume::State::SUSPENDED;
const bool is_suspended = new_state == suspend_resume::State::SUSPENDED;
if (!was_suspended && is_suspended) {
}
last_state_ = new_state;
+ if (is_suspended) {
+ return;
+ }
+
if (!IsEncodedCameraFormat(camera_format_)) {
if (was_suspended && !is_suspended) {
// For non-encoded formats, start camera preview immediately.