Don't return fail if the denoising is already enabled/disabled.
BUG= TEST= Review URL: https://webrtc-codereview.appspot.com/488001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1994 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
231f5d0d25
commit
78075451ed
@ -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));
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user