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

Issue 2695243005: Injectable audio encoders: BuiltinAudioEncoderFactory (Closed)

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

Description

Injectable audio encoders: BuiltinAudioEncoderFactory This CL contains all the changes made to audio_coding while making audio encoders injectable. Apart from some small changes to webrtcvoiceengine, nothing here is hooked up to the outside world. Those changes will be added to a follow-up CL. BUG=webrtc:5806 Review-Url: https://codereview.webrtc.org/2695243005 Cr-Commit-Position: refs/heads/master@{#17569} Committed: https://chromium.googlesource.com/external/webrtc/+/a1a040a4a492c14af068811c6e853b03f1e70b9e

Patch Set 1 #

Total comments: 27

Patch Set 2 : Rebase #

Patch Set 3 : Removed stub versions of AudioEncoderFactory from peerconnectioninterface.h #

Total comments: 1

Patch Set 4 : Rebase #

Patch Set 5 : Cleaned up parameter parsing in AudioCodecOpus #

Total comments: 119

Patch Set 6 : Wrote tests for BuiltinAudioEncoderFactory; addressed many comments. #

Total comments: 6

Patch Set 7 : Moved ANA frame length calculation into its own function. Improved "ptime" parsing in non-opus codeā€¦ #

Total comments: 20

Patch Set 8 : Cleaned up Opus code a bit. kHz -> Hz in comment picked a bunch of lint #

Total comments: 55

Patch Set 9 : Rebase #

Patch Set 10 : Fixed test, made AudioEncoderOpus treat stereo parameter more leniently, formatting and lints. #

Total comments: 2

Patch Set 11 : num_channels: int -> size_t #

Patch Set 12 : Rebase #

Patch Set 13 : Fix build problems on Windows, Android and downstream. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1344 lines, -124 lines) Patch
M webrtc/api/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +7 lines, -0 lines 0 comments Download
M webrtc/api/audio_codecs/audio_format.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +68 lines, -16 lines 0 comments Download
M webrtc/api/audio_codecs/audio_format.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +28 lines, -7 lines 0 comments Download
M webrtc/api/peerconnectioninterface.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -8 lines 0 comments Download
M webrtc/media/engine/webrtcvoiceengine.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/media/engine/webrtcvoiceengine_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +13 lines, -10 lines 0 comments Download
M webrtc/modules/audio_coding/BUILD.gn View 1 2 3 4 5 6 7 8 4 chunks +30 lines, -0 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 9 chunks +111 lines, -6 lines 0 comments Download
A webrtc/modules/audio_coding/codecs/audio_encoder_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +46 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/audio_format_conversion.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +4 lines, -4 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory_internal.cc View 1 2 3 4 5 6 7 8 9 1 chunk +20 lines, -13 lines 0 comments Download
A webrtc/modules/audio_coding/codecs/builtin_audio_encoder_factory.h View 1 2 3 4 5 6 1 chunk +25 lines, -0 lines 0 comments Download
A webrtc/modules/audio_coding/codecs/builtin_audio_encoder_factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +143 lines, -0 lines 0 comments Download
A webrtc/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +145 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h View 1 2 3 4 5 3 chunks +11 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc View 1 2 3 4 5 6 7 4 chunks +49 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.h View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +36 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/audio_encoder_ilbc.h View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/audio_encoder_ilbc.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +50 lines, -10 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t.h View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h View 1 2 3 4 5 6 7 8 9 3 chunks +52 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +13 lines, -3 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +211 lines, -38 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +204 lines, -2 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/pcm16b/audio_encoder_pcm16b.h View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/pcm16b/audio_encoder_pcm16b.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +41 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/audio_decoder_unittest.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/pc/DEPS View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M webrtc/pc/peerconnectionfactory.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/pc/peerconnectioninterface_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/voice_engine/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 66 (33 generated)
ossu
Here is the audio encoder factory and the changes it requires to the encoders, etc. ...
3 years, 10 months ago (2017-02-17 17:31:20 UTC) #2
kwiberg-webrtc
https://codereview.webrtc.org/2695243005/diff/1/webrtc/api/audio_codecs/audio_format.cc File webrtc/api/audio_codecs/audio_format.cc (right): https://codereview.webrtc.org/2695243005/diff/1/webrtc/api/audio_codecs/audio_format.cc#newcode84 webrtc/api/audio_codecs/audio_format.cc:84: max_bitrate_bps(0) {} Also initialize default_bitrate_bps? In general, I prefer ...
3 years, 10 months ago (2017-02-19 21:41:10 UTC) #4
ossu
https://codereview.webrtc.org/2695243005/diff/1/webrtc/api/audio_codecs/audio_format.cc File webrtc/api/audio_codecs/audio_format.cc (right): https://codereview.webrtc.org/2695243005/diff/1/webrtc/api/audio_codecs/audio_format.cc#newcode84 webrtc/api/audio_codecs/audio_format.cc:84: max_bitrate_bps(0) {} On 2017/02/19 21:41:09, kwiberg-webrtc wrote: > Also ...
3 years, 10 months ago (2017-02-20 12:20:26 UTC) #5
ossu
I haven't addressed any of the comments in this change, but pushed the peerconnection changes ...
3 years, 10 months ago (2017-02-22 12:49:41 UTC) #6
ossu
I believe this latest patch set addresses all comments on this CL. The only thing ...
3 years, 9 months ago (2017-03-14 20:25:11 UTC) #9
ossu
Adding you, hlundin, to possibly take a quick look on the changes to Opus max ...
3 years, 9 months ago (2017-03-14 20:28:30 UTC) #11
the sun
Great stuff, almost there! https://codereview.webrtc.org/2695243005/diff/100001/webrtc/api/audio_codecs/audio_format.h File webrtc/api/audio_codecs/audio_format.h (right): https://codereview.webrtc.org/2695243005/diff/100001/webrtc/api/audio_codecs/audio_format.h#newcode77 webrtc/api/audio_codecs/audio_format.h:77: AudioFormatInfo(const AudioFormatInfo& b) = default; ...
3 years, 9 months ago (2017-03-14 20:48:29 UTC) #12
kwiberg-webrtc
https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc File webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc (right): https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc#newcode51 webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc:51: // bitrate should be in the range between 6000 ...
3 years, 9 months ago (2017-03-15 10:09:15 UTC) #13
ossu
Just some answers. No new patch set. https://codereview.webrtc.org/2695243005/diff/100001/webrtc/api/audio_codecs/audio_format.h File webrtc/api/audio_codecs/audio_format.h (right): https://codereview.webrtc.org/2695243005/diff/100001/webrtc/api/audio_codecs/audio_format.h#newcode77 webrtc/api/audio_codecs/audio_format.h:77: AudioFormatInfo(const AudioFormatInfo& ...
3 years, 9 months ago (2017-03-15 11:26:52 UTC) #14
the sun
https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/audio_encoder_factory.h File webrtc/modules/audio_coding/codecs/audio_encoder_factory.h (right): https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/audio_encoder_factory.h#newcode31 webrtc/modules/audio_coding/codecs/audio_encoder_factory.h:31: virtual rtc::Optional<AudioFormatInfo> QueryAudioFormat( On 2017/03/15 11:26:52, ossu wrote: > ...
3 years, 9 months ago (2017-03-15 11:57:40 UTC) #15
kwiberg-webrtc
https://codereview.webrtc.org/2695243005/diff/100001/webrtc/api/audio_codecs/audio_format.cc File webrtc/api/audio_codecs/audio_format.cc (right): https://codereview.webrtc.org/2695243005/diff/100001/webrtc/api/audio_codecs/audio_format.cc#newcode81 webrtc/api/audio_codecs/audio_format.cc:81: : AudioFormatInfo(0, 0, 0) {} Sorry if I've already ...
3 years, 9 months ago (2017-03-15 13:33:19 UTC) #16
the sun
https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/audio_encoder_factory.h File webrtc/modules/audio_coding/codecs/audio_encoder_factory.h (right): https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/audio_encoder_factory.h#newcode31 webrtc/modules/audio_coding/codecs/audio_encoder_factory.h:31: virtual rtc::Optional<AudioFormatInfo> QueryAudioFormat( On 2017/03/15 13:33:17, kwiberg-webrtc wrote: > ...
3 years, 9 months ago (2017-03-15 13:37:44 UTC) #17
kwiberg-webrtc
https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/audio_encoder_factory.h File webrtc/modules/audio_coding/codecs/audio_encoder_factory.h (right): https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/audio_encoder_factory.h#newcode31 webrtc/modules/audio_coding/codecs/audio_encoder_factory.h:31: virtual rtc::Optional<AudioFormatInfo> QueryAudioFormat( On 2017/03/15 13:37:44, the sun wrote: ...
3 years, 9 months ago (2017-03-15 14:10:25 UTC) #18
hlundin-webrtc
LGTM on the Opus bitrate. https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc File webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc (right): https://codereview.webrtc.org/2695243005/diff/100001/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc#newcode53 webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc:53: const int kOpusMaxBitrateBps = ...
3 years, 9 months ago (2017-03-16 12:16:31 UTC) #19
ossu
New patch set up. Mostly small fixes; the biggest new thing is the test for ...
3 years, 9 months ago (2017-03-16 18:03:58 UTC) #20
the sun
LGTM! Very nice! https://codereview.webrtc.org/2695243005/diff/120001/webrtc/api/audio_codecs/audio_format.h File webrtc/api/audio_codecs/audio_format.h (right): https://codereview.webrtc.org/2695243005/diff/120001/webrtc/api/audio_codecs/audio_format.h#newcode95 webrtc/api/audio_codecs/audio_format.h:95: min_bitrate_bps == default_bitrate_bps == max_bitrate_bps); Do ...
3 years, 9 months ago (2017-03-17 09:07:31 UTC) #21
ossu
Thanks! :) https://codereview.webrtc.org/2695243005/diff/120001/webrtc/api/audio_codecs/audio_format.h File webrtc/api/audio_codecs/audio_format.h (right): https://codereview.webrtc.org/2695243005/diff/120001/webrtc/api/audio_codecs/audio_format.h#newcode95 webrtc/api/audio_codecs/audio_format.h:95: min_bitrate_bps == default_bitrate_bps == max_bitrate_bps); On 2017/03/17 ...
3 years, 9 months ago (2017-03-17 09:55:40 UTC) #22
kwiberg-webrtc
I haven't looket at the new patch set, just answered comments. https://codereview.webrtc.org/2695243005/diff/100001/webrtc/api/audio_codecs/audio_format.cc File webrtc/api/audio_codecs/audio_format.cc (right): ...
3 years, 9 months ago (2017-03-17 10:20:03 UTC) #23
ossu
Adding minyue@ to take a look at the changes to AudioEncoderOpus, specifically the parsing of ...
3 years, 9 months ago (2017-03-17 14:15:16 UTC) #25
ossu
A few small changes to this one still. https://codereview.webrtc.org/2695243005/diff/160001/webrtc/media/engine/webrtcvoiceengine.cc File webrtc/media/engine/webrtcvoiceengine.cc (right): https://codereview.webrtc.org/2695243005/diff/160001/webrtc/media/engine/webrtcvoiceengine.cc#newcode505 webrtc/media/engine/webrtcvoiceengine.cc:505: const ...
3 years, 9 months ago (2017-03-20 18:18:53 UTC) #27
the sun
https://codereview.webrtc.org/2695243005/diff/160001/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h File webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h (right): https://codereview.webrtc.org/2695243005/diff/160001/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h#newcode49 webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h:49: // We only support different frame sizes at 16000 ...
3 years, 9 months ago (2017-03-20 20:53:40 UTC) #28
minyue-webrtc
good work! Some readability comments from me (I only looked at audio encoder opus for ...
3 years, 9 months ago (2017-03-21 08:29:44 UTC) #29
ossu
https://codereview.webrtc.org/2695243005/diff/160001/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h File webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h (right): https://codereview.webrtc.org/2695243005/diff/160001/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h#newcode49 webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h:49: // We only support different frame sizes at 16000 ...
3 years, 9 months ago (2017-03-21 16:15:32 UTC) #30
minyue-webrtc
lgtm % comments https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.cc File webrtc/api/audio_codecs/audio_format.cc (right): https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.cc#newcode84 webrtc/api/audio_codecs/audio_format.cc:84: num_channels, alignment error https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.cc#newcode90 webrtc/api/audio_codecs/audio_format.cc:90: int ...
3 years, 9 months ago (2017-03-23 11:36:54 UTC) #31
ossu
https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.cc File webrtc/api/audio_codecs/audio_format.cc (right): https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.cc#newcode84 webrtc/api/audio_codecs/audio_format.cc:84: num_channels, On 2017/03/23 11:36:52, minyue-webrtc wrote: > alignment error ...
3 years, 9 months ago (2017-03-23 12:02:00 UTC) #32
kwiberg-webrtc
https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.h File webrtc/api/audio_codecs/audio_format.h (right): https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.h#newcode107 webrtc/api/audio_codecs/audio_format.h:107: int num_channels; On 2017/03/23 12:01:59, ossu wrote: > On ...
3 years, 9 months ago (2017-03-23 12:18:47 UTC) #33
minyue-webrtc
https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.h File webrtc/api/audio_codecs/audio_format.h (right): https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.h#newcode100 webrtc/api/audio_codecs/audio_format.h:100: RTC_DCHECK_GE(min_bitrate_bps, 0); On 2017/03/23 12:01:59, ossu wrote: > On ...
3 years, 9 months ago (2017-03-23 12:20:22 UTC) #34
kwiberg-webrtc
lgtm, but see comments https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.cc File webrtc/api/audio_codecs/audio_format.cc (right): https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.cc#newcode103 webrtc/api/audio_codecs/audio_format.cc:103: RTC_DCHECK_GE(max_bitrate_bps, default_bitrate_bps); You check some ...
3 years, 9 months ago (2017-03-24 12:43:25 UTC) #35
ossu
Addressed a number of issues and did a rebase. https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.h File webrtc/api/audio_codecs/audio_format.h (right): https://codereview.webrtc.org/2695243005/diff/180001/webrtc/api/audio_codecs/audio_format.h#newcode100 webrtc/api/audio_codecs/audio_format.h:100: ...
3 years, 8 months ago (2017-04-05 14:41:52 UTC) #37
the sun
Looks great! https://codereview.webrtc.org/2695243005/diff/240001/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc File webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc (right): https://codereview.webrtc.org/2695243005/diff/240001/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc#newcode169 webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc:169: } else { nit: Add comment: When ...
3 years, 8 months ago (2017-04-05 15:05:45 UTC) #42
kwiberg-webrtc
still lgtm https://codereview.webrtc.org/2695243005/diff/240001/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc File webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc (right): https://codereview.webrtc.org/2695243005/diff/240001/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc#newcode169 webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc:169: } else { On 2017/04/05 15:05:45, the ...
3 years, 8 months ago (2017-04-06 11:17:46 UTC) #43
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/2695243005/320001
3 years, 8 months ago (2017-04-06 17:00:18 UTC) #63
commit-bot: I haz the power
3 years, 8 months ago (2017-04-06 17:03:28 UTC) #66
Message was sent while issue was closed.
Committed patchset #13 (id:320001) as
https://chromium.googlesource.com/external/webrtc/+/a1a040a4a492c14af068811c6...

Powered by Google App Engine
This is Rietveld 408576698