fixup! [WebRTC][Camera] Support partial view in camera 63/320463/2
authorMichal Jurkiewicz <m.jurkiewicz@samsung.com>
Wed, 13 Nov 2024 16:56:38 +0000 (17:56 +0100)
committerBot Blink <blinkbot@samsung.com>
Fri, 15 Nov 2024 13:07:16 +0000 (13:07 +0000)
[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>
media/capture/video/tizen/video_capture_device_tizen_tv.cc

index e39c55cc3fbcb221082899c9cba9f6f9aa0ee5a8..3e5613f4ca65f3c3f607fde80146284534a9974d 100644 (file)
@@ -733,6 +733,10 @@ suspend_resume::State VideoCaptureDeviceTizenTv::Impl::ComputeState() {
 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) {
@@ -742,6 +746,10 @@ void VideoCaptureDeviceTizenTv::Impl::UpdateCameraState() {
   }
   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.