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 4ac6b64aef848cfcd2c9055b96871bd8a22163fb..ac68415da700e9a4f336467bb886dd105b521739 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 7801758d3e0cbd661173ecceefc4920008bd7163..2d6d39e38f7a15ca1218ec45c28ae56618e56a74 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 83696c539654ac3ad47e9fa901ad79d57da890f0..8e552421c0787e4f937adf3e9f34dc35f9e704cf 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/slow_motion_session.cpp b/frameworks/native/camera/extension/src/session/slow_motion_session.cpp index 3ead0fa33fe1527c7e7bb9fac3003ed1b6f09e67..04807b6cebdebe7092a3fb5635073383c4f6b1dc 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,