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

Issue 2466463005: Support (E)AC3 passthrough

Created:
4 years, 1 month ago by AndyWu
Modified:
3 years, 4 months ago
CC:
Aaron Boodman, abarth-chromium, agrieve+watch_chromium.org, alokp+watch_chromium.org, avayvod+watch_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, feature-media-reviews_chromium.org, halliwell+watch_chromium.org, jam, lcwu+watch_chromium.org, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-media_chromium.org, posciak+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, xjz+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Support (E)AC3 passthrough When the connected HDMI receiver supports (E)AC3 passthrough, we can directly pass raw compressed (E)AC3 bitstream to AudioTrack. BUG=613385 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Patch Set 1 #

Patch Set 2 : Improve CastMediaClient::IsSupportedPassthroughAudio() #

Total comments: 47

Patch Set 3 : Support (E)AC3 passthrough #

Patch Set 4 : Revert changes in audio_renderer_mixer. #

Total comments: 3

Patch Set 5 : Change kSampleFormatRaw and kCodecRaw #

Patch Set 6 : Clamp current media time to the last reported value #

Patch Set 7 : Rebase the CL #

Patch Set 8 : Use the terminology "compressed" instead of "raw" #

Patch Set 9 : Drop AudioDecoderConfig changes #

Patch Set 10 : Parsing (E)AC3 syncframes #

Patch Set 11 : Rebase #

Patch Set 12 : Rename is_compressed_format to is_bitstream_format #

Patch Set 13 : Rebase #

Patch Set 14 : Rebase #

Patch Set 15 : Rebase and Refactor #

Patch Set 16 : Add unit tests #

Total comments: 96
Unified diffs Side-by-side diffs Delta from patch set Stats (+822 lines, -21 lines) Patch
M content/browser/renderer_host/media/audio_sync_reader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -1 line 2 comments Download
M content/renderer/media/audio_renderer_mixer_manager.cc View 1 2 3 4 5 6 7 8 13 14 1 chunk +2 lines, -1 line 1 comment Download
M media/audio/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M media/audio/android/audio_manager_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -3 lines 0 comments Download
A media/audio/android/audio_track_output_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +65 lines, -0 lines 2 comments Download
A media/audio/android/audio_track_output_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +150 lines, -0 lines 18 comments Download
M media/audio/audio_output_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +11 lines, -0 lines 4 comments Download
M media/base/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +13 lines, -0 lines 0 comments Download
A media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +241 lines, -0 lines 21 comments Download
A media/base/android/java/src/test/org/chromium/media/AudioTrackOutputStreamTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +162 lines, -0 lines 2 comments Download
M media/base/android/media_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download
M media/base/audio_buffer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -2 lines 2 comments Download
M media/base/audio_buffer_queue.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +31 lines, -1 line 18 comments Download
M media/base/audio_bus.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -0 lines 2 comments Download
M media/base/audio_bus.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +24 lines, -6 lines 4 comments Download
M media/base/audio_parameters.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M media/filters/audio_renderer_algorithm.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M media/filters/audio_renderer_algorithm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +10 lines, -0 lines 4 comments Download
M media/renderers/audio_renderer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
M media/renderers/audio_renderer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 11 chunks +65 lines, -7 lines 16 comments Download

Messages

Total messages: 51 (12 generated)
AndyWu
4 years, 1 month ago (2016-10-31 22:18:02 UTC) #4
DaleCurtis
Thanks for putting this together. Do you have a design doc for it? What are ...
4 years, 1 month ago (2016-10-31 22:23:43 UTC) #5
AndyWu
I don't really have a design doc, since it's just a straight forward change: passing ...
4 years, 1 month ago (2016-10-31 22:50:15 UTC) #6
DaleCurtis
For Chromecast that's up to you if you want to have support or not. But ...
4 years, 1 month ago (2016-10-31 22:52:22 UTC) #7
DaleCurtis
This is pretty far from a straight-forward change :) You're piercing all sorts of layers ...
4 years, 1 month ago (2016-11-01 23:05:13 UTC) #9
AndyWu
https://codereview.chromium.org/2466463005/diff/20001/chromecast/common/media/cast_media_client.h File chromecast/common/media/cast_media_client.h (right): https://codereview.chromium.org/2466463005/diff/20001/chromecast/common/media/cast_media_client.h#newcode35 chromecast/common/media/cast_media_client.h:35: bool IsSupportedPassthroughAudio(::media::AudioCodec codec) override; On 2016/11/01 23:05:13, DaleCurtis wrote: ...
4 years, 1 month ago (2016-11-04 18:04:24 UTC) #10
AndyWu
https://codereview.chromium.org/2466463005/diff/20001/media/base/audio_renderer_mixer.cc File media/base/audio_renderer_mixer.cc (right): https://codereview.chromium.org/2466463005/diff/20001/media/base/audio_renderer_mixer.cc#newcode57 media/base/audio_renderer_mixer.cc:57: raw_input_(nullptr), On 2016/11/01 23:05:13, DaleCurtis wrote: > Why is ...
4 years, 1 month ago (2016-11-04 19:43:49 UTC) #11
DaleCurtis
https://codereview.chromium.org/2466463005/diff/20001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java File media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java (right): https://codereview.chromium.org/2466463005/diff/20001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java#newcode51 media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java:51: private WorkerThread mWorkerThread; On 2016/11/04 at 18:04:24, AndyWu wrote: ...
4 years, 1 month ago (2016-11-04 19:48:29 UTC) #12
DaleCurtis
https://codereview.chromium.org/2466463005/diff/20001/media/base/audio_buffer.cc File media/base/audio_buffer.cc (right): https://codereview.chromium.org/2466463005/diff/20001/media/base/audio_buffer.cc#newcode115 media/base/audio_buffer.cc:115: const size_t data_size) { On 2016/11/04 at 19:48:29, DaleCurtis ...
4 years, 1 month ago (2016-11-04 21:17:34 UTC) #13
DaleCurtis
https://codereview.chromium.org/2466463005/diff/60001/media/audio/audio_output_device.cc File media/audio/audio_output_device.cc (right): https://codereview.chromium.org/2466463005/diff/60001/media/audio/audio_output_device.cc#newcode479 media/audio/audio_output_device.cc:479: output_bus_->set_is_raw_format(audio_parameters_.IsRawFormat()); What happens if you output zeros when in ...
4 years, 1 month ago (2016-11-04 21:24:53 UTC) #14
AndyWu
https://codereview.chromium.org/2466463005/diff/20001/media/base/audio_buffer.cc File media/base/audio_buffer.cc (right): https://codereview.chromium.org/2466463005/diff/20001/media/base/audio_buffer.cc#newcode115 media/base/audio_buffer.cc:115: const size_t data_size) { On 2016/11/04 21:17:33, DaleCurtis wrote: ...
4 years, 1 month ago (2016-11-08 00:04:21 UTC) #16
DaleCurtis
https://codereview.chromium.org/2466463005/diff/20001/media/renderers/audio_renderer_impl.cc File media/renderers/audio_renderer_impl.cc (right): https://codereview.chromium.org/2466463005/diff/20001/media/renderers/audio_renderer_impl.cc#newcode692 media/renderers/audio_renderer_impl.cc:692: if (state_ == kPlaying && buffer->sample_format() != kSampleFormatRaw) { ...
4 years, 1 month ago (2016-11-08 00:11:47 UTC) #18
watk
https://codereview.chromium.org/2466463005/diff/20001/media/renderers/audio_renderer_impl.cc File media/renderers/audio_renderer_impl.cc (right): https://codereview.chromium.org/2466463005/diff/20001/media/renderers/audio_renderer_impl.cc#newcode692 media/renderers/audio_renderer_impl.cc:692: if (state_ == kPlaying && buffer->sample_format() != kSampleFormatRaw) { ...
4 years, 1 month ago (2016-11-08 19:59:31 UTC) #19
AndyWu
https://codereview.chromium.org/2466463005/diff/20001/media/renderers/audio_renderer_impl.cc File media/renderers/audio_renderer_impl.cc (right): https://codereview.chromium.org/2466463005/diff/20001/media/renderers/audio_renderer_impl.cc#newcode692 media/renderers/audio_renderer_impl.cc:692: if (state_ == kPlaying && buffer->sample_format() != kSampleFormatRaw) { ...
4 years, 1 month ago (2016-11-11 17:52:48 UTC) #20
chcunningham
+1 to Dale's call for a doc. Thats a good place to discuss some unsettled ...
4 years, 1 month ago (2016-11-11 19:14:28 UTC) #21
chcunningham
> Thats a good place to discuss some unsettled things... + implications for WebAudio
4 years, 1 month ago (2016-11-11 19:15:13 UTC) #22
AndyWu
Here is the document: https://docs.google.com/a/google.com/document/d/1hVRqp_xUAHr9zAE0qmIE8I16Irq-qkE1waJ6Dj6gFpo Hopefully, it could help reviewers.
4 years, 1 month ago (2016-11-11 21:09:15 UTC) #23
AndyWu
https://codereview.chromium.org/2466463005/diff/20001/media/base/audio_splicer.cc File media/base/audio_splicer.cc (right): https://codereview.chromium.org/2466463005/diff/20001/media/base/audio_splicer.cc#newcode186 media/base/audio_splicer.cc:186: if (frames_to_fill == 0 || std::abs(frames_to_fill) < kMinGapSize || ...
4 years, 1 month ago (2016-11-11 23:49:13 UTC) #24
DaleCurtis
I've done some more research, here's what I think we should do: - Drop all ...
4 years, 1 month ago (2016-11-16 00:19:32 UTC) #26
AndyWu
On 2016/11/16 00:19:32, DaleCurtis wrote: > I've done some more research, here's what I think ...
4 years, 1 month ago (2016-11-16 21:01:47 UTC) #27
DaleCurtis
On 2016/11/16 at 21:01:47, tsunghung wrote: > On 2016/11/16 00:19:32, DaleCurtis wrote: > > I've ...
4 years, 1 month ago (2016-11-16 22:11:43 UTC) #28
DaleCurtis
On 2016/11/16 at 22:11:43, DaleCurtis wrote: > On 2016/11/16 at 21:01:47, tsunghung wrote: > > ...
4 years ago (2016-11-29 00:07:52 UTC) #29
AndyWu
On 2016/11/29 00:07:52, DaleCurtis wrote: > So after looking at the spec some more, I ...
4 years ago (2016-11-29 17:44:25 UTC) #30
AndyWu
I think the reset of the CL is small enough. Please help to review this ...
3 years, 6 months ago (2017-06-12 21:55:02 UTC) #36
DaleCurtis
Sorry haven't had time to review this due to sheriffing. Will try to get to ...
3 years, 6 months ago (2017-06-14 00:50:53 UTC) #37
chcunningham
I'm new to audio buffer queue, so Dale may take a closer look there. https://codereview.chromium.org/2466463005/diff/20001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java ...
3 years, 6 months ago (2017-06-14 20:03:09 UTC) #38
chcunningham
https://codereview.chromium.org/2466463005/diff/20001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java File media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java (right): https://codereview.chromium.org/2466463005/diff/20001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java#newcode51 media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java:51: private WorkerThread mWorkerThread; I think minimally you'll want to ...
3 years, 6 months ago (2017-06-14 20:27:22 UTC) #39
chcunningham
https://codereview.chromium.org/2466463005/diff/300001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java File media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java (right): https://codereview.chromium.org/2466463005/diff/300001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java#newcode199 media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java:199: private boolean readMoreData() { IIUC, the way this is ...
3 years, 6 months ago (2017-06-14 20:32:19 UTC) #40
DaleCurtis
https://codereview.chromium.org/2466463005/diff/300001/content/browser/renderer_host/media/audio_sync_reader.cc File content/browser/renderer_host/media/audio_sync_reader.cc (right): https://codereview.chromium.org/2466463005/diff/300001/content/browser/renderer_host/media/audio_sync_reader.cc#newcode214 content/browser/renderer_host/media/audio_sync_reader.cc:214: if (mute_audio_) Just return instead of having else block. ...
3 years, 6 months ago (2017-06-15 21:46:33 UTC) #41
AndyWu
Thanks a lot for all comments, will update this CL by next week.
3 years, 6 months ago (2017-06-16 15:51:31 UTC) #42
AndyWu
I was caught by a P0 bug and will have a vacation coming soon. Sorry ...
3 years, 5 months ago (2017-06-26 14:56:08 UTC) #43
AndyWu
Please continue the code review here: https://chromium-review.googlesource.com/c/596720 There are still a couple of TBD items, ...
3 years, 4 months ago (2017-08-02 01:43:41 UTC) #44
DaleCurtis
https://codereview.chromium.org/2466463005/diff/300001/media/audio/android/audio_track_output_stream.cc File media/audio/android/audio_track_output_stream.cc (right): https://codereview.chromium.org/2466463005/diff/300001/media/audio/android/audio_track_output_stream.cc#newcode118 media/audio/android/audio_track_output_stream.cc:118: int total_played_frames) { On 2017/08/02 at 01:43:38, AndyWu wrote: ...
3 years, 4 months ago (2017-08-03 01:38:11 UTC) #45
AndyWu
https://codereview.chromium.org/2466463005/diff/300001/media/audio/android/audio_track_output_stream.cc File media/audio/android/audio_track_output_stream.cc (right): https://codereview.chromium.org/2466463005/diff/300001/media/audio/android/audio_track_output_stream.cc#newcode118 media/audio/android/audio_track_output_stream.cc:118: int total_played_frames) { On 2017/08/03 01:38:10, DaleCurtis wrote: > ...
3 years, 4 months ago (2017-08-03 17:11:17 UTC) #46
DaleCurtis
https://codereview.chromium.org/2466463005/diff/300001/media/audio/android/audio_track_output_stream.cc File media/audio/android/audio_track_output_stream.cc (right): https://codereview.chromium.org/2466463005/diff/300001/media/audio/android/audio_track_output_stream.cc#newcode118 media/audio/android/audio_track_output_stream.cc:118: int total_played_frames) { On 2017/08/03 at 17:11:17, AndyWu wrote: ...
3 years, 4 months ago (2017-08-03 17:22:55 UTC) #47
AndyWu
https://codereview.chromium.org/2466463005/diff/300001/media/audio/android/audio_track_output_stream.cc File media/audio/android/audio_track_output_stream.cc (right): https://codereview.chromium.org/2466463005/diff/300001/media/audio/android/audio_track_output_stream.cc#newcode118 media/audio/android/audio_track_output_stream.cc:118: int total_played_frames) { On 2017/08/03 17:22:55, DaleCurtis wrote: > ...
3 years, 4 months ago (2017-08-03 21:58:45 UTC) #48
chcunningham
Getting closer! Still standing by for the threading to move to c++ and use callbacks. ...
3 years, 4 months ago (2017-08-04 19:26:40 UTC) #49
AndyWu
https://codereview.chromium.org/2466463005/diff/300001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java File media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java (right): https://codereview.chromium.org/2466463005/diff/300001/media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java#newcode199 media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java:199: private boolean readMoreData() { On 2017/08/04 19:26:40, chcunningham wrote: ...
3 years, 4 months ago (2017-08-04 21:45:53 UTC) #50
AndyWu
3 years, 4 months ago (2017-08-05 07:17:11 UTC) #51
https://codereview.chromium.org/2466463005/diff/300001/media/base/android/jav...
File media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java
(right):

https://codereview.chromium.org/2466463005/diff/300001/media/base/android/jav...
media/base/android/java/src/org/chromium/media/AudioTrackOutputStream.java:199:
private boolean readMoreData() {
On 2017/06/14 20:32:19, chcunningham wrote:
> IIUC, the way this is structured you will lose data when AudioTrack decides it
> can't handle anymore. The readMoreData returns false, and you sleep, but then
> when you wake back up you ask the renderer for more which will mean the last
bus
> you attempted to push to AudioTrack gets dropped.

Done, thanks.
media/base/android/java/src/test/org/chromium/media/AudioTrackOutputStreamTest.java

Powered by Google App Engine
This is Rietveld 408576698