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

Issue 2424173003: Move functionality out from AudioFrame and into AudioFrameOperations. (Closed)

Created:
4 years, 2 months ago by aleloi
Modified:
4 years ago
CC:
webrtc-reviews_webrtc.org, yujie_mao (webrtc), Andrew MacDonald, henrika_webrtc, hlundin-webrtc, tlegrand-webrtc, tterriberry_mozilla.com, audio-team_agora.io, qiang.lu, niklas.enbom, peah-webrtc, minyue-webrtc, aluebs-webrtc, bjornv1
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Move functionality out from AudioFrame and into AudioFrameOperations. This CL is in preparation to move the AudioFrame into webrtc/api. The AudioFrame is a POD type used for representing 10ms of audio. It appears as a parameter and return value of interfaces being migrated to webrtc/api, in particular AudioMixer. Here, methods operator+=, operator>>=, Mute are moved into a new target webrtc/audio/utility/audio_frame_operations, and dependencies are changed to use the new versions. The old AudioFrame methods are marked deprecated. The audio frame utilities in webrtc/modules/utility:audio_frame_operations are also moved to the new location. TBR=kjellander@webrtc.org BUG=webrtc:6548 NOPRESUBMIT=True Committed: https://crrev.com/6321b49a0da3ebdeede1430aa9bc825855646b79 Cr-Commit-Position: refs/heads/master@{#15413}

Patch Set 1 #

Total comments: 18

Patch Set 2 : Tests pass. #

Patch Set 3 : Updated deprecation notice, minimized diff to original unittest. #

Total comments: 25

Patch Set 4 : Removed ClampToInt16, 'u' suffix, extra parentheses, added const. #

Patch Set 5 : Style issues: punctuation and naming. #

Patch Set 6 : Removed unneeded checks for #channels <= 2. #

Total comments: 23

Patch Set 7 : New tests, DCHECKS, style and default member initializers. #

Total comments: 8

Patch Set 8 : Include order & DCHECKs. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -663 lines) Patch
M .gn View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/audio/BUILD.gn View 1 3 chunks +3 lines, -5 lines 0 comments Download
M webrtc/audio/utility/BUILD.gn View 1 1 chunk +16 lines, -0 lines 0 comments Download
A + webrtc/audio/utility/audio_frame_operations.h View 1 2 3 4 5 6 5 chunks +26 lines, -6 lines 0 comments Download
A + webrtc/audio/utility/audio_frame_operations.cc View 1 2 3 4 5 6 7 5 chunks +75 lines, -9 lines 0 comments Download
A + webrtc/audio/utility/audio_frame_operations_unittest.cc View 1 2 3 4 5 6 2 chunks +21 lines, -1 line 0 comments Download
M webrtc/modules/BUILD.gn View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/modules/audio_conference_mixer/BUILD.gn View 1 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_conference_mixer/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc View 1 5 chunks +7 lines, -7 lines 0 comments Download
M webrtc/modules/audio_mixer/BUILD.gn View 1 2 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/audio_mixer/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/modules/audio_mixer/audio_frame_manipulator.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/audio_mixer/audio_mixer_impl.cc View 1 4 chunks +7 lines, -7 lines 0 comments Download
M webrtc/modules/audio_processing/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/modules/audio_processing/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/modules/audio_processing/vad/standalone_vad.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/include/module_common_types.h View 1 2 3 4 5 6 6 chunks +18 lines, -28 lines 0 comments Download
M webrtc/modules/module_common_types_unittest.cc View 1 chunk +0 lines, -9 lines 0 comments Download
M webrtc/modules/utility/BUILD.gn View 1 2 chunks +3 lines, -1 line 0 comments Download
M webrtc/modules/utility/DEPS View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M webrtc/modules/utility/include/audio_frame_operations.h View 1 2 1 chunk +5 lines, -48 lines 0 comments Download
M webrtc/modules/utility/source/audio_frame_operations.cc View 1 1 chunk +0 lines, -160 lines 0 comments Download
D webrtc/modules/utility/source/audio_frame_operations_unittest.cc View 1 1 chunk +0 lines, -369 lines 0 comments Download
M webrtc/voice_engine/BUILD.gn View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/voice_engine/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/voice_engine/channel.cc View 1 2 3 4 5 6 7 3 chunks +2 lines, -2 lines 0 comments Download
M webrtc/voice_engine/output_mixer.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M webrtc/voice_engine/transmit_mixer.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M webrtc/voice_engine/utility.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M webrtc/voice_engine/voe_external_media_impl.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 79 (43 generated)
aleloi
Can you please take a look? https://codereview.webrtc.org/2424173003/diff/40001/webrtc/modules/include/module_common_types.h File webrtc/modules/include/module_common_types.h (left): https://codereview.webrtc.org/2424173003/diff/40001/webrtc/modules/include/module_common_types.h#oldcode520 webrtc/modules/include/module_common_types.h:520: * deciding the ...
4 years, 2 months ago (2016-10-18 11:38:04 UTC) #4
kwiberg-webrtc
Why do you want to change these from methods to static methods of another class? ...
4 years, 2 months ago (2016-10-19 09:22:30 UTC) #5
the sun
https://codereview.webrtc.org/2424173003/diff/40001/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc File webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc (right): https://codereview.webrtc.org/2424173003/diff/40001/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc#newcode43 webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc:43: AudioFrameOperations::ShiftDown(frame); Note, if this function was called DivideBy2(), ApplyHalfGain() ...
4 years, 2 months ago (2016-10-19 09:23:17 UTC) #6
the sun
It is great that you're taking the time to set up build dependencies properly by ...
4 years, 2 months ago (2016-10-19 09:37:32 UTC) #7
the sun
On 2016/10/19 09:22:30, kwiberg-webrtc wrote: > Why do you want to change these from methods ...
4 years, 2 months ago (2016-10-19 10:20:05 UTC) #8
kwiberg-webrtc
On 2016/10/19 10:20:05, the sun wrote: > On 2016/10/19 09:22:30, kwiberg-webrtc wrote: > > Why ...
4 years, 2 months ago (2016-10-19 10:49:37 UTC) #9
kwiberg-webrtc
OK, took a closer look, and (depending on what we intend users to do with ...
4 years, 2 months ago (2016-10-19 12:19:47 UTC) #10
aleloi
I tried to set up a trybot compilation alias. That's why the trybot result list ...
4 years, 2 months ago (2016-10-20 08:27:06 UTC) #11
the sun
https://codereview.webrtc.org/2424173003/diff/40001/webrtc/modules/utility/source/audio_frame_operations.cc File webrtc/modules/utility/source/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/40001/webrtc/modules/utility/source/audio_frame_operations.cc#newcode185 webrtc/modules/utility/source/audio_frame_operations.cc:185: frame->id_ = -1; On 2016/10/20 08:27:06, aleloi wrote: > ...
4 years, 2 months ago (2016-10-20 08:37:57 UTC) #12
aleloi
https://codereview.webrtc.org/2424173003/diff/60001/webrtc/modules/utility/include/audio_frame_operations.h File webrtc/modules/utility/include/audio_frame_operations.h (right): https://codereview.webrtc.org/2424173003/diff/60001/webrtc/modules/utility/include/audio_frame_operations.h#newcode67 webrtc/modules/utility/include/audio_frame_operations.h:67: // Halve samples in |frame| by applying a right ...
4 years, 2 months ago (2016-10-20 08:51:20 UTC) #13
the sun
On 2016/10/20 08:51:20, aleloi wrote: > https://codereview.webrtc.org/2424173003/diff/60001/webrtc/modules/utility/include/audio_frame_operations.h > File webrtc/modules/utility/include/audio_frame_operations.h (right): > > https://codereview.webrtc.org/2424173003/diff/60001/webrtc/modules/utility/include/audio_frame_operations.h#newcode67 > ...
4 years, 2 months ago (2016-10-24 07:50:26 UTC) #14
kjellander_webrtc
On 2016/10/24 07:50:26, the sun wrote: > On 2016/10/20 08:51:20, aleloi wrote: > > > ...
4 years, 2 months ago (2016-10-24 08:20:07 UTC) #15
the sun
Can I help you un-stuck this CL somehow?
4 years ago (2016-11-25 12:08:16 UTC) #23
aleloi
On 2016/11/25 12:08:16, the sun wrote: > Can I help you un-stuck this CL somehow? ...
4 years ago (2016-11-29 10:09:28 UTC) #27
aleloi
Hi! Could you take a look at this old CL again? The difference from last ...
4 years ago (2016-11-29 14:01:35 UTC) #44
kwiberg-webrtc
https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode30 webrtc/audio/utility/audio_frame_operations.cc:30: RTC_DCHECK_LT(result_frame->num_channels_, 3u); You don't need the "u"s anymore! https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode48 ...
4 years ago (2016-11-30 09:38:34 UTC) #45
aleloi
https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode30 webrtc/audio/utility/audio_frame_operations.cc:30: RTC_DCHECK_LT(result_frame->num_channels_, 3u); On 2016/11/30 09:38:34, kwiberg-webrtc wrote: > You ...
4 years ago (2016-11-30 10:11:48 UTC) #46
hlundin-webrtc
LG. I have a few comments. https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode29 webrtc/audio/utility/audio_frame_operations.cc:29: RTC_DCHECK_GT(result_frame->num_channels_, 0u); I ...
4 years ago (2016-11-30 11:24:36 UTC) #48
kwiberg-webrtc
lgtm https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode30 webrtc/audio/utility/audio_frame_operations.cc:30: RTC_DCHECK_LT(result_frame->num_channels_, 3u); On 2016/11/30 10:11:48, aleloi wrote: > ...
4 years ago (2016-11-30 11:32:44 UTC) #49
aleloi
https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode29 webrtc/audio/utility/audio_frame_operations.cc:29: RTC_DCHECK_GT(result_frame->num_channels_, 0u); On 2016/11/30 11:24:36, hlundin-webrtc wrote: > I ...
4 years ago (2016-11-30 11:33:39 UTC) #50
kwiberg-webrtc
https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode29 webrtc/audio/utility/audio_frame_operations.cc:29: RTC_DCHECK_GT(result_frame->num_channels_, 0u); On 2016/11/30 11:33:39, aleloi wrote: > On ...
4 years ago (2016-11-30 11:36:04 UTC) #51
aleloi
https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode29 webrtc/audio/utility/audio_frame_operations.cc:29: RTC_DCHECK_GT(result_frame->num_channels_, 0u); I think methods should in general only ...
4 years ago (2016-11-30 11:48:34 UTC) #52
hlundin-webrtc
https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode29 webrtc/audio/utility/audio_frame_operations.cc:29: RTC_DCHECK_GT(result_frame->num_channels_, 0u); On 2016/11/30 11:36:04, kwiberg-webrtc wrote: > On ...
4 years ago (2016-11-30 11:51:06 UTC) #53
kwiberg-webrtc
https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/320001/webrtc/audio/utility/audio_frame_operations.cc#newcode29 webrtc/audio/utility/audio_frame_operations.cc:29: RTC_DCHECK_GT(result_frame->num_channels_, 0u); On 2016/11/30 11:51:05, hlundin-webrtc wrote: > On ...
4 years ago (2016-11-30 11:55:04 UTC) #54
aleloi
Hi! The build issues are fixed and linux-internal is green. Can we proceed to land ...
4 years ago (2016-12-01 09:10:41 UTC) #59
kwiberg-webrtc
On 2016/12/01 09:10:41, aleloi wrote: > Hi! The build issues are fixed and linux-internal is ...
4 years ago (2016-12-01 09:22:57 UTC) #60
hlundin-webrtc
lgtm with one nit https://codereview.webrtc.org/2424173003/diff/380001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/380001/webrtc/audio/utility/audio_frame_operations.cc#newcode14 webrtc/audio/utility/audio_frame_operations.cc:14: #include "webrtc/modules/include/module_common_types.h" Order of includes ...
4 years ago (2016-12-01 09:44:51 UTC) #61
the sun
https://codereview.webrtc.org/2424173003/diff/380001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/380001/webrtc/audio/utility/audio_frame_operations.cc#newcode29 webrtc/audio/utility/audio_frame_operations.cc:29: // Sanity check. RTC_DCHECK(result_frame); https://codereview.webrtc.org/2424173003/diff/380001/webrtc/audio/utility/audio_frame_operations.cc#newcode37 webrtc/audio/utility/audio_frame_operations.cc:37: if (result_frame->samples_per_channel_ != ...
4 years ago (2016-12-01 20:32:46 UTC) #62
aleloi
https://codereview.webrtc.org/2424173003/diff/380001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/380001/webrtc/audio/utility/audio_frame_operations.cc#newcode37 webrtc/audio/utility/audio_frame_operations.cc:37: if (result_frame->samples_per_channel_ != frame_to_add.samples_per_channel_) { On 2016/12/01 20:32:45, the ...
4 years ago (2016-12-02 12:13:36 UTC) #63
the sun
lgtm % comments https://codereview.webrtc.org/2424173003/diff/400001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/400001/webrtc/audio/utility/audio_frame_operations.cc#newcode11 webrtc/audio/utility/audio_frame_operations.cc:11: #include <algorithm> order! https://codereview.webrtc.org/2424173003/diff/400001/webrtc/audio/utility/audio_frame_operations.cc#newcode44 webrtc/audio/utility/audio_frame_operations.cc:44: if ...
4 years ago (2016-12-02 13:39:55 UTC) #64
aleloi
https://codereview.webrtc.org/2424173003/diff/400001/webrtc/audio/utility/audio_frame_operations.cc File webrtc/audio/utility/audio_frame_operations.cc (right): https://codereview.webrtc.org/2424173003/diff/400001/webrtc/audio/utility/audio_frame_operations.cc#newcode11 webrtc/audio/utility/audio_frame_operations.cc:11: #include <algorithm> On 2016/12/02 13:39:55, the sun wrote: > ...
4 years ago (2016-12-05 09:18:37 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/2424173003/420001
4 years ago (2016-12-05 09:19:12 UTC) #69
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/11057)
4 years ago (2016-12-05 09:22:42 UTC) #71
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/2424173003/420001
4 years ago (2016-12-05 09:24:42 UTC) #74
commit-bot: I haz the power
Committed patchset #8 (id:420001)
4 years ago (2016-12-05 09:46:16 UTC) #77
commit-bot: I haz the power
4 years ago (2016-12-05 09:46:29 UTC) #79
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/6321b49a0da3ebdeede1430aa9bc825855646b79
Cr-Commit-Position: refs/heads/master@{#15413}

Powered by Google App Engine
This is Rietveld 408576698