diff --git a/src/video_engine/test/auto_test/source/vie_autotest_image_process.cc b/src/video_engine/test/auto_test/source/vie_autotest_image_process.cc index 887fe6ea9..745f35dc9 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_image_process.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_image_process.cc @@ -200,10 +200,12 @@ void ViEAutoTest::ViEImageProcessAPITest() // Denoising // EXPECT_EQ(0, ViE.image_process->EnableDenoising(tbCapture.captureId, true)); - EXPECT_NE(0, ViE.image_process->EnableDenoising(tbCapture.captureId, true)); + // If the denoising is already enabled, it will just reuturn 0. + EXPECT_EQ(0, ViE.image_process->EnableDenoising(tbCapture.captureId, true)); EXPECT_EQ(0, ViE.image_process->EnableDenoising( tbCapture.captureId, false)); - EXPECT_NE(0, ViE.image_process->EnableDenoising( + // If the denoising is already disabled, it will just reuturn 0. + EXPECT_EQ(0, ViE.image_process->EnableDenoising( tbCapture.captureId, false)); EXPECT_NE(0, ViE.image_process->EnableDenoising( tbChannel.videoChannel, true)); diff --git a/src/video_engine/vie_capturer.cc b/src/video_engine/vie_capturer.cc index 6da16eb4b..23793fd25 100644 --- a/src/video_engine/vie_capturer.cc +++ b/src/video_engine/vie_capturer.cc @@ -448,9 +448,8 @@ WebRtc_Word32 ViECapturer::EnableDenoising(bool enable) { CriticalSectionScoped cs(deliver_cs_.get()); if (enable) { if (denoising_enabled_) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, capture_id_), - "%s: denoising already enabled", __FUNCTION__); - return -1; + // Already enabled, nothing need to be done. + return 0; } denoising_enabled_ = true; if (IncImageProcRefCount() != 0) { @@ -458,9 +457,8 @@ WebRtc_Word32 ViECapturer::EnableDenoising(bool enable) { } } else { if (denoising_enabled_ == false) { - WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, capture_id_), - "%s: denoising not enabled", __FUNCTION__); - return -1; + // Already disabled, nothing need to be done. + return 0; } denoising_enabled_ = false; DecImageProcRefCount();