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

Issue 2750783004: Add mute state field to AudioFrame. (Closed)

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

Description

Add mute state field to AudioFrame and switch some callers to use it. Also make AudioFrame::data_ private and instead provide: const int16_t* data() const; int16_t* mutable_data(); - data() returns a zeroed static buffer on muted frames (to avoid unnecessary zeroing of the member buffer) and directly returns AudioFrame::data_ on unmuted frames. - mutable_data(), lazily zeroes AudioFrame::data_ if the frame is currently muted, sets muted=false, and returns AudioFrame::data_. These accessors serve to "force" callers to be aware of the mute state field, i.e. lazy zeroing is not the primary motivation. This change only optimizes handling of muted frames where it is somewhat trivial to do so. Other improvements requiring more significant structural changes will come later. BUG=webrtc:7343 TBR=henrika Review-Url: https://codereview.webrtc.org/2750783004 Cr-Commit-Position: refs/heads/master@{#18543} Committed: https://chromium.googlesource.com/external/webrtc/+/36b1a5fcec6270ec4a5bea87b33a49b418a3cb29

Patch Set 1 #

Patch Set 2 : Add missing AudioFrameOperations dependency #

Patch Set 3 : Update tests #

Patch Set 4 : don't return from Add() too early #

Total comments: 25

Patch Set 5 : Address review comments #

Total comments: 12

Patch Set 6 : second round of comments #

Patch Set 7 : Add AudioFrameOperations tests and AudioFrame tests; fix AudioFrame bug found in testing #

Patch Set 8 : fix windows compile issue #

Patch Set 9 : Fix num_channels check in UpMix() #

Total comments: 12

Patch Set 10 : Third round of comments #

Total comments: 16

Patch Set 11 : Address Fredrik's comments #

Patch Set 12 : Undo DCHECK #

Patch Set 13 : DCHECK #

Patch Set 14 : Sync latest #

Patch Set 15 : Undo some frame_combiner.cc changes; they may not work with the new limiter #

Patch Set 16 : Sync latest #

Patch Set 17 : Pass data(), not mutable_data() to AudioSinkInterface now that it takes a const int16_t* #

Patch Set 18 : Sync #

Patch Set 19 : Update new usages of AudioFrame::data_ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+658 lines, -316 lines) Patch
M webrtc/audio/audio_transport_proxy.cc View 1 2 3 4 3 chunks +6 lines, -4 lines 0 comments Download
M webrtc/audio/utility/audio_frame_operations.cc View 1 2 3 10 chunks +59 lines, -42 lines 0 comments Download
M webrtc/audio/utility/audio_frame_operations_unittest.cc View 1 2 3 4 5 6 7 8 9 16 chunks +134 lines, -22 lines 0 comments Download
M webrtc/modules/audio_coding/acm2/acm_receiver.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +4 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/acm2/acm_receiver_unittest.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M webrtc/modules/audio_coding/acm2/acm_send_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/acm2/audio_coding_module.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +32 lines, -18 lines 0 comments Download
M webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +5 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_stereo_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +10 lines, -6 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 10 chunks +26 lines, -29 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/sync_buffer.cc View 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/sync_buffer_unittest.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/audio_sink.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/neteq_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/test/EncodeDecodeTest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/test/PCMFile.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/test/PCMFile.cc View 1 2 4 chunks +12 lines, -8 lines 0 comments Download
M webrtc/modules/audio_coding/test/TestAllCodecs.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/test/TestRedFec.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/test/TestStereo.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/test/delay_test.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/test/insert_packet_with_timing.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_coding/test/opus_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc View 1 2 3 4 5 2 chunks +15 lines, -7 lines 0 comments Download
M webrtc/modules/audio_conference_mixer/test/audio_conference_mixer_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_mixer/audio_frame_manipulator.cc View 1 2 3 4 5 3 chunks +9 lines, -3 lines 0 comments Download
M webrtc/modules/audio_mixer/audio_frame_manipulator_unittest.cc View 1 2 3 chunks +7 lines, -4 lines 0 comments Download
M webrtc/modules/audio_mixer/audio_mixer_impl_unittest.cc View 1 2 6 chunks +10 lines, -6 lines 0 comments Download
M webrtc/modules/audio_mixer/frame_combiner.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +9 lines, -6 lines 0 comments Download
M webrtc/modules/audio_mixer/frame_combiner_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +12 lines, -8 lines 0 comments Download
M webrtc/modules/audio_mixer/sine_wave_generator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/audio_processing/aec_dump/aec_dump_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_processing/aec_dump/capture_stream_info.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/modules/audio_processing/audio_buffer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -4 lines 0 comments Download
M webrtc/modules/audio_processing/audio_processing_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/audio_processing/audio_processing_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 12 chunks +25 lines, -18 lines 0 comments Download
M webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +9 lines, -6 lines 0 comments Download
M webrtc/modules/audio_processing/test/audio_processing_simulator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -2 lines 0 comments Download
M webrtc/modules/include/module_common_types.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 11 chunks +59 lines, -29 lines 0 comments Download
M webrtc/modules/module_common_types_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +101 lines, -0 lines 0 comments Download
M webrtc/tools/agc/activity_metric.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +7 lines, -5 lines 0 comments Download
M webrtc/voice_engine/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/voice_engine/audio_level.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M webrtc/voice_engine/channel.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +7 lines, -7 lines 0 comments Download
M webrtc/voice_engine/file_player.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -3 lines 0 comments Download
M webrtc/voice_engine/file_recorder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +11 lines, -11 lines 0 comments Download
M webrtc/voice_engine/transmit_mixer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M webrtc/voice_engine/utility.cc View 2 chunks +8 lines, -3 lines 0 comments Download
M webrtc/voice_engine/utility_unittest.cc View 1 2 5 chunks +20 lines, -13 lines 0 comments Download
M webrtc/voice_engine/voe_base_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 87 (65 generated)
yujo
Hi - this is the change we were discussing last week. Not fully finished, but ...
3 years, 9 months ago (2017-03-16 08:25:13 UTC) #21
hlundin-webrtc
First of all, thanks for your effort! I started reviewing from the top, but half-way ...
3 years, 9 months ago (2017-03-16 14:47:48 UTC) #23
hlundin-webrtc
I'll come back to reviewing the rest of the files tomorrow. https://codereview.webrtc.org/2750783004/diff/60001/webrtc/modules/include/module_common_types.h File webrtc/modules/include/module_common_types.h (right): ...
3 years, 9 months ago (2017-03-16 14:58:23 UTC) #24
yujo
Thanks for the quick review! Still need to do the tests, decide what we want ...
3 years, 9 months ago (2017-03-16 23:37:21 UTC) #25
hlundin-webrtc
This is a very good change. Thanks! All I have is a few minor comments. ...
3 years, 9 months ago (2017-03-17 14:29:39 UTC) #26
yujo
https://codereview.webrtc.org/2750783004/diff/60001/webrtc/audio/utility/audio_frame_operations_unittest.cc File webrtc/audio/utility/audio_frame_operations_unittest.cc (right): https://codereview.webrtc.org/2750783004/diff/60001/webrtc/audio/utility/audio_frame_operations_unittest.cc#newcode520 webrtc/audio/utility/audio_frame_operations_unittest.cc:520: } On 2017/03/16 23:37:21, yujo wrote: > On 2017/03/16 ...
3 years, 9 months ago (2017-03-17 23:55:55 UTC) #27
yujo
There is still a bug being caught by tests; I'll take a look on Monday.
3 years, 9 months ago (2017-03-19 19:07:10 UTC) #36
yujo
On 2017/03/19 19:07:10, yujo wrote: > There is still a bug being caught by tests; ...
3 years, 9 months ago (2017-03-21 00:15:02 UTC) #41
hlundin-webrtc
Very nice! All I have now is a few minor comments and nits. https://codereview.webrtc.org/2750783004/diff/160001/webrtc/audio/utility/audio_frame_operations_unittest.cc File ...
3 years, 9 months ago (2017-03-22 12:07:26 UTC) #42
yujo
We're kind of back to the ArrayView discussion. As an in-between measure, would you want ...
3 years, 9 months ago (2017-03-22 19:45:45 UTC) #43
hlundin-webrtc
LGTM from me! Sterling work! Thank you. https://codereview.webrtc.org/2750783004/diff/160001/webrtc/modules/module_common_types_unittest.cc File webrtc/modules/module_common_types_unittest.cc (right): https://codereview.webrtc.org/2750783004/diff/160001/webrtc/modules/module_common_types_unittest.cc#newcode47 webrtc/modules/module_common_types_unittest.cc:47: EXPECT_TRUE(AllSamplesAre(0, frame)); ...
3 years, 9 months ago (2017-03-23 07:04:03 UTC) #48
the sun
Great job! A few comments, one for Henrik. :) https://codereview.webrtc.org/2750783004/diff/180001/webrtc/audio/audio_transport_proxy.cc File webrtc/audio/audio_transport_proxy.cc (right): https://codereview.webrtc.org/2750783004/diff/180001/webrtc/audio/audio_transport_proxy.cc#newcode29 webrtc/audio/audio_transport_proxy.cc:29: ...
3 years, 9 months ago (2017-03-23 19:34:38 UTC) #49
yujo
https://codereview.webrtc.org/2750783004/diff/180001/webrtc/audio/audio_transport_proxy.cc File webrtc/audio/audio_transport_proxy.cc (right): https://codereview.webrtc.org/2750783004/diff/180001/webrtc/audio/audio_transport_proxy.cc#newcode29 webrtc/audio/audio_transport_proxy.cc:29: // handling of muted frames. On 2017/03/23 19:34:38, the ...
3 years, 9 months ago (2017-03-24 07:30:15 UTC) #50
the sun
LGTM % those two DCHECKs Again, great job on this, thanks for jumping in! https://codereview.webrtc.org/2750783004/diff/180001/webrtc/modules/audio_coding/acm2/audio_coding_module.cc ...
3 years, 9 months ago (2017-03-24 08:05:58 UTC) #53
hlundin-webrtc
https://codereview.webrtc.org/2750783004/diff/180001/webrtc/modules/include/module_common_types.h File webrtc/modules/include/module_common_types.h (right): https://codereview.webrtc.org/2750783004/diff/180001/webrtc/modules/include/module_common_types.h#newcode286 webrtc/modules/include/module_common_types.h:286: // Stereo, 32 kHz, 60 ms (2 * 32 ...
3 years, 9 months ago (2017-03-24 08:12:07 UTC) #54
yujo
Thanks to both of you for the feedback! Let's talk offline about next steps. https://codereview.webrtc.org/2750783004/diff/180001/webrtc/modules/audio_coding/acm2/audio_coding_module.cc ...
3 years, 9 months ago (2017-03-24 17:10:32 UTC) #59
kwiberg-webrtc
https://codereview.webrtc.org/2750783004/diff/60001/webrtc/modules/include/module_common_types.h File webrtc/modules/include/module_common_types.h (right): https://codereview.webrtc.org/2750783004/diff/60001/webrtc/modules/include/module_common_types.h#newcode312 webrtc/modules/include/module_common_types.h:312: const int16_t* data() const; On 2017/03/17 14:29:38, hlundin-webrtc wrote: ...
3 years, 7 months ago (2017-05-10 08:38:28 UTC) #66
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/2750783004/360001
3 years, 6 months ago (2017-06-12 19:07:51 UTC) #77
commit-bot: I haz the power
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/18061)
3 years, 6 months ago (2017-06-12 19:12:35 UTC) #79
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/2750783004/360001
3 years, 6 months ago (2017-06-12 19:17:02 UTC) #83
yujo
+henrika for the following files Missing LGTM from an OWNER for these files: webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc webrtc/modules/audio_conference_mixer/test/audio_conference_mixer_unittest.cc ...
3 years, 6 months ago (2017-06-12 19:19:20 UTC) #84
commit-bot: I haz the power
3 years, 6 months ago (2017-06-12 19:45:42 UTC) #87
Message was sent while issue was closed.
Committed patchset #19 (id:360001) as
https://chromium.googlesource.com/external/webrtc/+/36b1a5fcec6270ec4a5bea87b...

Powered by Google App Engine
This is Rietveld 408576698