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

Issue 177333003: Add support for midstream audio configuration changes. (Closed)

Created:
6 years, 9 months ago by rileya (GONE FROM CHROMIUM)
Modified:
6 years, 9 months ago
Reviewers:
rileya1, DaleCurtis
CC:
chromium-reviews, fischman+watch_chromium.org, jam, mcasas+watch_chromium.org, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@ABS
Visibility:
Public.

Description

Add support for midstream audio configuration changes. This introduces a new class, AudioBufferConverter, which takes AudioBuffers of arbitrary formats and converts them to AudioBuffers of a common format. To support config changes seamlessly we use the AudioBufferConverter to convert incoming AudioBuffers to the hardware output format as we get them from the AudioBufferStream. This way the rest of the audio pipeline doesn't need to handle config changes. We only enable this conversion step for DemuxerStreams that support config changes (namely ChunkDemuxerStream). BUG=347270 TEST=AudioBufferConverterTest NOTRY=true R=dalecurtis@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260071

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : moar rebase #

Patch Set 4 : cleanup #

Patch Set 5 : #

Total comments: 11

Patch Set 6 : #

Total comments: 44

Patch Set 7 : address comments #

Total comments: 9

Patch Set 8 : Address comments, run git cl format. #

Patch Set 9 : Add unit tests. #

Patch Set 10 : #

Total comments: 6

Patch Set 11 : add Reset() tests. Only enable ABC in MSE case. #

Total comments: 2

Patch Set 12 : Remove commented out code. #

Patch Set 13 : Rebase #

Patch Set 14 : #

Patch Set 15 : hacky new approach #

Patch Set 16 : Somewhat cleaner, more versatile approach. #

Patch Set 17 : Fix memory corruption. #

Patch Set 18 : Fix unit tests. #

Patch Set 19 : Back to the original approach, but with working splicer timestamps. #

Total comments: 23

Patch Set 20 : Fix player_x11 #

Patch Set 21 : Address comments #

Total comments: 4

Patch Set 22 : address comments #

Total comments: 2

Patch Set 23 : add MEDIA_EXPORT #

Patch Set 24 : #

Patch Set 25 : Reset |audio_converter_| on Flush(). #

Total comments: 1

Patch Set 26 : disable fifo, add <cmath> to fix compile error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+706 lines, -268 lines) Patch
M content/renderer/media/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +7 lines, -5 lines 0 comments Download
A media/base/audio_buffer_converter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +101 lines, -0 lines 0 comments Download
A media/base/audio_buffer_converter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +245 lines, -0 lines 0 comments Download
A media/base/audio_buffer_converter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 14 15 16 17 18 1 chunk +186 lines, -0 lines 0 comments Download
M media/base/audio_converter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +8 lines, -7 lines 0 comments Download
M media/base/audio_decoder.h View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
M media/base/mock_filters.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -3 lines 0 comments Download
M media/filters/audio_renderer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +15 lines, -2 lines 0 comments Download
M media/filters/audio_renderer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 8 chunks +52 lines, -19 lines 0 comments Download
M media/filters/audio_renderer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 8 chunks +19 lines, -34 lines 0 comments Download
M media/filters/decoder_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +10 lines, -0 lines 0 comments Download
M media/filters/decoder_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +4 lines, -0 lines 0 comments Download
M media/filters/decrypting_audio_decoder.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +0 lines, -12 lines 0 comments Download
M media/filters/decrypting_audio_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +2 lines, -26 lines 0 comments Download
M media/filters/decrypting_audio_decoder_unittest.cc View 1 2 3 4 5 2 chunks +0 lines, -9 lines 0 comments Download
M media/filters/ffmpeg_audio_decoder.h View 1 2 3 4 5 2 chunks +1 line, -11 lines 0 comments Download
M media/filters/ffmpeg_audio_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +13 lines, -55 lines 0 comments Download
M media/filters/ffmpeg_audio_decoder_unittest.cc View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M media/filters/opus_audio_decoder.h View 1 2 3 4 5 2 chunks +0 lines, -9 lines 0 comments Download
M media/filters/opus_audio_decoder.cc View 1 2 3 4 5 6 7 6 chunks +9 lines, -44 lines 0 comments Download
M media/filters/pipeline_integration_test_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M media/filters/pipeline_integration_test_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +13 lines, -4 lines 0 comments Download
M media/filters/source_buffer_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +0 lines, -15 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +3 lines, -0 lines 0 comments Download
M media/tools/player_x11/player_x11.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +16 lines, -5 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
rileya (GONE FROM CHROMIUM)
Not ready for full review, I just want some high-level feedback. I added a new ...
6 years, 9 months ago (2014-03-07 01:19:29 UTC) #1
DaleCurtis
We should also figure out some way to disable this for non-MSE paths as resampling ...
6 years, 9 months ago (2014-03-07 02:00:09 UTC) #2
rileya (GONE FROM CHROMIUM)
I gave this some more attention, PTAL. Still needs unit test tweaks (and probably new ...
6 years, 9 months ago (2014-03-20 00:55:11 UTC) #3
DaleCurtis
Partial review! https://codereview.chromium.org/177333003/diff/140001/media/base/audio_buffer_converter.cc File media/base/audio_buffer_converter.cc (right): https://codereview.chromium.org/177333003/diff/140001/media/base/audio_buffer_converter.cc#newcode43 media/base/audio_buffer_converter.cc:43: AudioParameters buffer_params = AudioBufferToAudioParameters(buffer); I'm loathe to ...
6 years, 9 months ago (2014-03-20 01:36:26 UTC) #4
DaleCurtis
https://codereview.chromium.org/177333003/diff/140001/media/base/audio_buffer_converter.cc File media/base/audio_buffer_converter.cc (right): https://codereview.chromium.org/177333003/diff/140001/media/base/audio_buffer_converter.cc#newcode116 media/base/audio_buffer_converter.cc:116: // Assume full volume (is this correct?) Yes. Volume ...
6 years, 9 months ago (2014-03-20 19:29:00 UTC) #5
rileya (GONE FROM CHROMIUM)
Alright, I think I covered most everything. We probably want to disable this entirely for ...
6 years, 9 months ago (2014-03-21 20:58:48 UTC) #6
DaleCurtis
Looks great, just needs a unit test for audio_buffer_converter now. https://codereview.chromium.org/177333003/diff/140001/media/base/audio_buffer_converter.cc File media/base/audio_buffer_converter.cc (right): https://codereview.chromium.org/177333003/diff/140001/media/base/audio_buffer_converter.cc#newcode200 ...
6 years, 9 months ago (2014-03-21 23:18:56 UTC) #7
rileya (GONE FROM CHROMIUM)
Added unit tests and addressed comments. For performance reasons we probably want to switch this ...
6 years, 9 months ago (2014-03-24 18:07:04 UTC) #8
DaleCurtis
Yeah, I think the DemuxerStream idea sounds great. Want to write that up in a ...
6 years, 9 months ago (2014-03-24 18:29:33 UTC) #9
rileya (GONE FROM CHROMIUM)
Added a couple tests and used DecoderStream::SupportsConfigChanges to switch this on/off. https://codereview.chromium.org/177333003/diff/220001/media/base/audio_buffer_converter_unittest.cc File media/base/audio_buffer_converter_unittest.cc (right): ...
6 years, 9 months ago (2014-03-24 21:27:18 UTC) #10
DaleCurtis
https://codereview.chromium.org/177333003/diff/240001/media/filters/source_buffer_stream.cc File media/filters/source_buffer_stream.cc (right): https://codereview.chromium.org/177333003/diff/240001/media/filters/source_buffer_stream.cc#newcode1338 media/filters/source_buffer_stream.cc:1338: /*if (audio_configs_[0].samples_per_second() != config.samples_per_second()) { Stay / go?
6 years, 9 months ago (2014-03-24 23:04:52 UTC) #11
rileya (GONE FROM CHROMIUM)
https://codereview.chromium.org/177333003/diff/240001/media/filters/source_buffer_stream.cc File media/filters/source_buffer_stream.cc (right): https://codereview.chromium.org/177333003/diff/240001/media/filters/source_buffer_stream.cc#newcode1338 media/filters/source_buffer_stream.cc:1338: /*if (audio_configs_[0].samples_per_second() != config.samples_per_second()) { On 2014/03/24 23:04:53, DaleCurtis ...
6 years, 9 months ago (2014-03-24 23:09:42 UTC) #12
rileya (GONE FROM CHROMIUM)
Latest patchset uses the method we discussed offline. It simplifies the AudioBufferConverter greatly. However, I ...
6 years, 9 months ago (2014-03-26 03:22:13 UTC) #13
rileya (GONE FROM CHROMIUM)
On second thought it may be possible to flush the AudioConverter after each buffer, and ...
6 years, 9 months ago (2014-03-26 15:51:55 UTC) #14
rileya (GONE FROM CHROMIUM)
Explanation of PS16: In order to reuse timestamp/duration from our input buffers we want a ...
6 years, 9 months ago (2014-03-26 22:56:47 UTC) #15
rileya (GONE FROM CHROMIUM)
Okay PS19 is back to the approach from before. I added a callback for config ...
6 years, 9 months ago (2014-03-27 05:10:48 UTC) #16
DaleCurtis
Looking great! I'll stamp after solving the lifetime of the input frame calculation. https://codereview.chromium.org/177333003/diff/420001/media/base/audio_buffer_converter.cc File ...
6 years, 9 months ago (2014-03-27 06:00:44 UTC) #17
rileya (GONE FROM CHROMIUM)
Addressed most everything. https://codereview.chromium.org/177333003/diff/420001/media/base/audio_buffer_converter.cc File media/base/audio_buffer_converter.cc (right): https://codereview.chromium.org/177333003/diff/420001/media/base/audio_buffer_converter.cc#newcode7 media/base/audio_buffer_converter.cc:7: #include <cstdlib> On 2014/03/27 06:00:45, DaleCurtis ...
6 years, 9 months ago (2014-03-27 17:51:40 UTC) #18
DaleCurtis
Pending the input buffer experiment we discussed offline, this lgtm. https://codereview.chromium.org/177333003/diff/420001/media/base/audio_buffer_converter.cc File media/base/audio_buffer_converter.cc (right): https://codereview.chromium.org/177333003/diff/420001/media/base/audio_buffer_converter.cc#newcode153 ...
6 years, 9 months ago (2014-03-27 18:15:22 UTC) #19
DaleCurtis
(needs a more detailed description and TEST= line though)
6 years, 9 months ago (2014-03-27 18:17:26 UTC) #20
rileya (GONE FROM CHROMIUM)
Addressed comments, updated description and added a TEST= I made a unit test (not committing ...
6 years, 9 months ago (2014-03-27 19:07:11 UTC) #21
DaleCurtis
https://codereview.chromium.org/177333003/diff/470001/media/base/audio_buffer_converter.h File media/base/audio_buffer_converter.h (right): https://codereview.chromium.org/177333003/diff/470001/media/base/audio_buffer_converter.h#newcode25 media/base/audio_buffer_converter.h:25: class AudioBufferConverter : public AudioConverter::InputCallback { need MEDIA_EXPORT here.
6 years, 9 months ago (2014-03-27 20:35:07 UTC) #22
rileya (GONE FROM CHROMIUM)
On 2014/03/27 20:35:07, DaleCurtis wrote: > https://codereview.chromium.org/177333003/diff/470001/media/base/audio_buffer_converter.h > File media/base/audio_buffer_converter.h (right): > > https://codereview.chromium.org/177333003/diff/470001/media/base/audio_buffer_converter.h#newcode25 > ...
6 years, 9 months ago (2014-03-27 20:57:31 UTC) #23
DaleCurtis
https://codereview.chromium.org/177333003/diff/470001/media/filters/audio_renderer_impl.cc File media/filters/audio_renderer_impl.cc (right): https://codereview.chromium.org/177333003/diff/470001/media/filters/audio_renderer_impl.cc#newcode751 media/filters/audio_renderer_impl.cc:751: buffer_converter_->ResetTimestampState(); Need to check expecting_config_changes here.
6 years, 9 months ago (2014-03-27 20:59:54 UTC) #24
rileya (GONE FROM CHROMIUM)
Added a DCHECK.
6 years, 9 months ago (2014-03-27 21:02:35 UTC) #25
DaleCurtis
https://codereview.chromium.org/177333003/diff/530001/media/base/audio_buffer_converter.cc File media/base/audio_buffer_converter.cc (right): https://codereview.chromium.org/177333003/diff/530001/media/base/audio_buffer_converter.cc#newcode161 media/base/audio_buffer_converter.cc:161: new AudioConverter(input_params_, output_params_, false)); As discussed offline, flip disable_fifo ...
6 years, 9 months ago (2014-03-27 22:49:26 UTC) #26
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 9 months ago (2014-03-27 23:02:59 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/177333003/500026
6 years, 9 months ago (2014-03-27 23:05:32 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-28 02:51:48 UTC) #29
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) content_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=136620
6 years, 9 months ago (2014-03-28 02:51:48 UTC) #30
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 9 months ago (2014-03-28 02:53:19 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/177333003/500026
6 years, 9 months ago (2014-03-28 02:54:00 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-28 03:27:38 UTC) #33
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) crypto_unittests, url_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=136643
6 years, 9 months ago (2014-03-28 03:27:39 UTC) #34
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 9 months ago (2014-03-28 03:36:59 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/177333003/500026
6 years, 9 months ago (2014-03-28 03:38:59 UTC) #36
rileya1
The CQ bit was unchecked by rileya@google.com
6 years, 9 months ago (2014-03-28 04:10:27 UTC) #37
rileya1
The CQ bit was checked by rileya@google.com
6 years, 9 months ago (2014-03-28 04:10:28 UTC) #38
DaleCurtis
6 years, 9 months ago (2014-03-28 04:20:30 UTC) #39
Message was sent while issue was closed.
Committed patchset #26 manually as r260071 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698