From 488dd9ff4f94ef34094cae134fccfaa5a3739473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E9=81=93=E6=98=A5?= Date: Thu, 11 Sep 2025 11:53:22 +0800 Subject: [PATCH 1/2] fix icsl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卢道春 --- .../moving_photo/include/avcodec/audio_deferred_process.h | 2 +- .../moving_photo/include/avcodec/avcodec_task_manager.h | 4 ++-- .../extension/include/session/time_lapse_photo_session.h | 2 +- .../camera/extension/src/session/aperture_video_session.cpp | 1 + .../camera/extension/src/session/slow_motion_session.cpp | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dynamic_libs/moving_photo/include/avcodec/audio_deferred_process.h b/dynamic_libs/moving_photo/include/avcodec/audio_deferred_process.h index 4ac6b64ae..ac68415da 100644 --- a/dynamic_libs/moving_photo/include/avcodec/audio_deferred_process.h +++ b/dynamic_libs/moving_photo/include/avcodec/audio_deferred_process.h @@ -59,7 +59,7 @@ private: std::unique_ptr offlineEffectChain_ = nullptr; AudioStreamInfo inputOptions_; AudioStreamInfo outputOptions_; - uint32_t oneUnprocessedSize_ = 0; + std::atomic oneUnprocessedSize_ = 0; uint32_t oneProcessedSize_ = 0; }; } // CameraStandard diff --git a/dynamic_libs/moving_photo/include/avcodec/avcodec_task_manager.h b/dynamic_libs/moving_photo/include/avcodec/avcodec_task_manager.h index 7801758d3..2d6d39e38 100644 --- a/dynamic_libs/moving_photo/include/avcodec/avcodec_task_manager.h +++ b/dynamic_libs/moving_photo/include/avcodec/avcodec_task_manager.h @@ -101,8 +101,8 @@ private: std::atomic isActive_ { true }; map>> videoFdMap_; VideoCodecType videoCodecType_ = VideoCodecType::VIDEO_ENCODE_TYPE_AVC; - int64_t preBufferDuration_ = NANOSEC_RANGE; - int64_t postBufferDuration_ = NANOSEC_RANGE; + std::atomic preBufferDuration_ = NANOSEC_RANGE; + std::atomic postBufferDuration_ = NANOSEC_RANGE; uint32_t timerId_ = 0; shared_ptr audioDeferredProcess_ = nullptr; ColorSpace colorSpace_ = ColorSpace::COLOR_SPACE_UNKNOWN; diff --git a/frameworks/native/camera/extension/include/session/time_lapse_photo_session.h b/frameworks/native/camera/extension/include/session/time_lapse_photo_session.h index 83696c539..8e552421c 100644 --- a/frameworks/native/camera/extension/include/session/time_lapse_photo_session.h +++ b/frameworks/native/camera/extension/include/session/time_lapse_photo_session.h @@ -131,7 +131,7 @@ private: mutex cbMtx_; float luminationValue_; TryAEInfo info_; - uint32_t iso_; + std::atomic iso_; }; } // namespace CameraStandard diff --git a/frameworks/native/camera/extension/src/session/aperture_video_session.cpp b/frameworks/native/camera/extension/src/session/aperture_video_session.cpp index 3f892551e..254198f76 100644 --- a/frameworks/native/camera/extension/src/session/aperture_video_session.cpp +++ b/frameworks/native/camera/extension/src/session/aperture_video_session.cpp @@ -44,6 +44,7 @@ int32_t ApertureVideoSession::CommitConfig() CHECK_RETURN_RET(ret != CameraErrorCode::SUCCESS, ret); auto ability = GetMetadata(); + CHECK_RETURN_RET(!ability, CameraErrorCode::SUCCESS); auto item = GetMetadataItem(ability->get(), OHOS_ABILITY_VIDEO_STABILIZATION_MODES); // Not support stabilization, return success. CHECK_RETURN_RET(item == nullptr || item->count == 0, CameraErrorCode::SUCCESS); diff --git a/frameworks/native/camera/extension/src/session/slow_motion_session.cpp b/frameworks/native/camera/extension/src/session/slow_motion_session.cpp index 3ead0fa33..04807b6ce 100644 --- a/frameworks/native/camera/extension/src/session/slow_motion_session.cpp +++ b/frameworks/native/camera/extension/src/session/slow_motion_session.cpp @@ -69,6 +69,7 @@ bool SlowMotionSession::IsSlowMotionDetectionSupported() CHECK_RETURN_RET_ELOG(!inputDeviceInfo, false, "IsSlowMotionDetectionSupported camera deviceInfo is null"); std::shared_ptr metadata = inputDeviceInfo->GetCachedMetadata(); + CHECK_RETURN_RET(!metadata, false); camera_metadata_item_t item; int ret = Camera::FindCameraMetadataItem(metadata->get(), OHOS_ABILITY_MOTION_DETECTION_SUPPORT, &item); CHECK_RETURN_RET_ELOG(ret != CAM_META_SUCCESS, false, -- Gitee From 5e60419f8ade70326214deddfc38a02a1cd32a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E9=81=93=E6=98=A5?= Date: Thu, 11 Sep 2025 04:02:36 +0000 Subject: [PATCH 2/2] update frameworks/native/camera/extension/src/session/aperture_video_session.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卢道春 --- .../camera/extension/src/session/aperture_video_session.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/frameworks/native/camera/extension/src/session/aperture_video_session.cpp b/frameworks/native/camera/extension/src/session/aperture_video_session.cpp index 254198f76..3f892551e 100644 --- a/frameworks/native/camera/extension/src/session/aperture_video_session.cpp +++ b/frameworks/native/camera/extension/src/session/aperture_video_session.cpp @@ -44,7 +44,6 @@ int32_t ApertureVideoSession::CommitConfig() CHECK_RETURN_RET(ret != CameraErrorCode::SUCCESS, ret); auto ability = GetMetadata(); - CHECK_RETURN_RET(!ability, CameraErrorCode::SUCCESS); auto item = GetMetadataItem(ability->get(), OHOS_ABILITY_VIDEO_STABILIZATION_MODES); // Not support stabilization, return success. CHECK_RETURN_RET(item == nullptr || item->count == 0, CameraErrorCode::SUCCESS); -- Gitee