Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Issue 2721003002: Remove usage of VoEVolumeControl from WVoE and Audio[Send|Receive]Stream. (Closed)

Created:
3 years, 9 months ago by the sun
Modified:
3 years, 9 months ago
Reviewers:
kwiberg-webrtc
CC:
webrtc-reviews_webrtc.org, AleBzk, Andrew MacDonald, henrika_webrtc, stefan-webrtc, tlegrand-webrtc, tterriberry_mozilla.com, audio-team_agora.io, hlundin-webrtc, peah-webrtc, minyue-webrtc, mflodman
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Remove usage of VoEVolumeControl from WVoE and Audio[Send|Receive]Stream. BUG=webrtc:4690 Review-Url: https://codereview.webrtc.org/2721003002 Cr-Commit-Position: refs/heads/master@{#16956} Committed: https://chromium.googlesource.com/external/webrtc/+/796b8f9d71ffa733097d95f31efe5d9a8e4d6b8e

Patch Set 1 #

Total comments: 10

Patch Set 2 : rebase+comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -82 lines) Patch
M webrtc/audio/audio_receive_stream.h View 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/audio/audio_receive_stream.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M webrtc/audio/audio_send_stream.cc View 2 chunks +5 lines, -10 lines 0 comments Download
M webrtc/audio/audio_send_stream_unittest.cc View 1 5 chunks +13 lines, -3 lines 0 comments Download
M webrtc/call/audio_receive_stream.h View 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/media/engine/fakewebrtccall.h View 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/media/engine/fakewebrtcvoiceengine.h View 2 chunks +1 line, -18 lines 0 comments Download
M webrtc/media/engine/webrtcvoe.h View 3 chunks +3 lines, -9 lines 0 comments Download
M webrtc/media/engine/webrtcvoiceengine.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/media/engine/webrtcvoiceengine.cc View 1 5 chunks +14 lines, -11 lines 0 comments Download
M webrtc/media/engine/webrtcvoiceengine_unittest.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M webrtc/test/mock_voe_channel_proxy.h View 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/test/mock_voice_engine.h View 3 chunks +5 lines, -17 lines 0 comments Download
M webrtc/voice_engine/channel.h View 1 3 chunks +0 lines, -3 lines 0 comments Download
M webrtc/voice_engine/channel.cc View 1 4 chunks +0 lines, -4 lines 0 comments Download
M webrtc/voice_engine/channel_proxy.h View 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/voice_engine/channel_proxy.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M webrtc/voice_engine/transmit_mixer.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/voice_engine/voe_base_impl.cc View 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 18 (9 generated)
the sun
3 years, 9 months ago (2017-02-28 10:57:03 UTC) #4
kwiberg-webrtc
lgtm, with some comments https://codereview.webrtc.org/2721003002/diff/1/webrtc/audio/audio_send_stream_unittest.cc File webrtc/audio/audio_send_stream_unittest.cc (right): https://codereview.webrtc.org/2721003002/diff/1/webrtc/audio/audio_send_stream_unittest.cc#newcode70 webrtc/audio/audio_send_stream_unittest.cc:70: virtual ~MockTransmitMixer() = default; Do ...
3 years, 9 months ago (2017-02-28 13:59:19 UTC) #7
the sun
https://codereview.webrtc.org/2721003002/diff/1/webrtc/audio/audio_send_stream_unittest.cc File webrtc/audio/audio_send_stream_unittest.cc (right): https://codereview.webrtc.org/2721003002/diff/1/webrtc/audio/audio_send_stream_unittest.cc#newcode70 webrtc/audio/audio_send_stream_unittest.cc:70: virtual ~MockTransmitMixer() = default; On 2017/02/28 13:59:18, kwiberg-webrtc wrote: ...
3 years, 9 months ago (2017-03-02 00:36:25 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2721003002/20001
3 years, 9 months ago (2017-03-02 00:37:12 UTC) #11
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/external/webrtc/+/796b8f9d71ffa733097d95f31efe5d9a8e4d6b8e
3 years, 9 months ago (2017-03-02 01:02:28 UTC) #14
kwiberg-webrtc
https://codereview.webrtc.org/2721003002/diff/1/webrtc/media/engine/webrtcvoiceengine.cc File webrtc/media/engine/webrtcvoiceengine.cc (right): https://codereview.webrtc.org/2721003002/diff/1/webrtc/media/engine/webrtcvoiceengine.cc#newcode965 webrtc/media/engine/webrtcvoiceengine.cc:965: int8_t currentLevel = transmit_mixer()->AudioLevel(); On 2017/03/02 00:36:25, the sun ...
3 years, 9 months ago (2017-03-02 02:37:37 UTC) #15
the sun
On 2017/03/02 02:37:37, kwiberg-webrtc wrote: > https://codereview.webrtc.org/2721003002/diff/1/webrtc/media/engine/webrtcvoiceengine.cc > File webrtc/media/engine/webrtcvoiceengine.cc (right): > > https://codereview.webrtc.org/2721003002/diff/1/webrtc/media/engine/webrtcvoiceengine.cc#newcode965 > ...
3 years, 9 months ago (2017-03-02 04:57:16 UTC) #16
kwiberg-webrtc
On 2017/03/02 04:57:16, the sun wrote: > On 2017/03/02 02:37:37, kwiberg-webrtc wrote: > > > ...
3 years, 9 months ago (2017-03-02 08:30:02 UTC) #17
the sun
3 years, 9 months ago (2017-03-02 14:07:22 UTC) #18
Message was sent while issue was closed.
On 2017/03/02 08:30:02, kwiberg-webrtc wrote:
> On 2017/03/02 04:57:16, the sun wrote:
> > On 2017/03/02 02:37:37, kwiberg-webrtc wrote:
> > >
> >
>
https://codereview.webrtc.org/2721003002/diff/1/webrtc/media/engine/webrtcvoi...
> > > File webrtc/media/engine/webrtcvoiceengine.cc (right):
> > > 
> > >
> >
>
https://codereview.webrtc.org/2721003002/diff/1/webrtc/media/engine/webrtcvoi...
> > > webrtc/media/engine/webrtcvoiceengine.cc:965: int8_t currentLevel =
> > > transmit_mixer()->AudioLevel();
> > > On 2017/03/02 00:36:25, the sun wrote:
> > > > On 2017/02/28 13:59:18, kwiberg-webrtc wrote:
> > > > > const? Also, why camelCase?
> > > > 
> > > > a) Do you mean currentLevel (sic) should be const? I don't usually do
that
> > > with
> > > > local variables that are set from a function call. Does the style guide
> > > mention
> > > > that as good practice?
> > > 
> > > It just says "Use const whenever it makes sense." Beyond that it gives no
> > > explicit guidelines for local variables that I can find. Personally, I've
> > found
> > > it a good habit to make locals const whenever possible, which is why I
> > recommend
> > > it to others. The real payoff comes in places where the variable in
question
> > has
> > > a scope of more than just three lines, though, so I don't feel strongly
> about
> > it
> > > for this particular case.
> > > 
> > >
> >
>
https://codereview.webrtc.org/2721003002/diff/1/webrtc/voice_engine/channel_p...
> > > File webrtc/voice_engine/channel_proxy.cc (right):
> > > 
> > >
> >
>
https://codereview.webrtc.org/2721003002/diff/1/webrtc/voice_engine/channel_p...
> > > webrtc/voice_engine/channel_proxy.cc:133: uint32_t level = 0;
> > > On 2017/03/02 00:36:25, the sun wrote:
> > > > On 2017/02/28 13:59:18, kwiberg-webrtc wrote:
> > > > > Why initialize?
> > > > 
> > > > Variables should always be initialized, unless there is a particular
> > > performance
> > > > reason why not to. In particular with an interface like the below
> function,
> > > it's
> > > > not evident that it may always be set without looking closely at the
> > > underlying
> > > > code.
> > > 
> > > On the contrary, I'd argue that the call below is expected to *always* set
> > level
> > > unless it signals an error (this is the usual contract for output
> parameters).
> > > By not initializing level, you give MemorySanitizer a chance to verify
this,
> > and
> > > you tell the reader of the code that you expect level to always be filled
in
> > > with a real value.
> > >
> > > Initializing to a default value you're sure won't be needed is akin to
> having
> > a
> > > default case in a switch that you don't think you need. It can hide bugs,
> and
> > > readers may be fooled into thinking the default value is actually needed.
> > 
> > I agree with half of what you say. :) In this case I should have initialized
> the
> > variable to something which is *known* to be illegal, to make sure
downstream
> > tests/assertions fail consistently. Yes, tests *should* catch such a
condition
> > (not saying we have enough coverage). Relying on an external tool to find
this
> > class of bug, to me is less favorable than a programming style which
prevents
> > them.
> 
> Initializing to a known-bad value doesn't prevent the bug either---it's just
> another way to enable tests and tooling to detect the bug. Or are you
suggesting
> there should be an error path after the call that tests for the illegal value
> and deals with the problem?

No, that's not what I suggest. Asserting valid ranges and having appropriate
tests should be enough. The point is to make it deterministically detectable.
Without relying on tools that may not be available on all platforms.

Powered by Google App Engine
This is Rietveld 408576698