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

Issue 2437863004: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)

Created:
4 years, 2 months ago by Mikhail
Modified:
4 years, 1 month ago
CC:
chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make more media APIs aware of |delay| and |delay_timestamp| This patch is a part of 'AudioContext.getOutputTimestamp' method implementation [1] and it continues the changes introduced at [2]. The AudioRendererSink::RenderCallback::Render method has same semantics as AudioSourceCallback::OnMoreData. That caused other changes in the following interfaces: - AudioSyncReader::UpdatePendingBytes(uint32_t bytes, uint32_t frames_skipped) -> AudioSyncReader::PrepareNextData(base::TimeDelta delay, base::TimeTicks delay_timestamp, uint32_t frames_skipped) - AudioDeviceThread::Callback::Process(uint32_t pending_data) -> AudioDeviceThread::Callback::Process(int64_t pending_data, base::TimeTicks data_timestamp) - AudioDeviceThread is receiving a "packet" of two int64_t values BUG=619533 [1] https://codereview.chromium.org/2060833002/ [2] https://codereview.chromium.org/2101303004/ Committed: https://crrev.com/df872a842609926a62e0211868c886d0ec96cff7 Committed: https://crrev.com/06d9d80a203b9c329fc6d53fde44bae66645a389 Cr-Original-Commit-Position: refs/heads/master@{#427996} Cr-Commit-Position: refs/heads/master@{#428953}

Patch Set 1 #

Total comments: 39

Patch Set 2 : Review comments + build fixes #

Total comments: 6

Patch Set 3 : Comments from James #

Total comments: 6

Patch Set 4 : Comments from James #

Total comments: 4

Patch Set 5 : Comments from Tommi #

Patch Set 6 : fixed excessive logging #

Total comments: 2

Patch Set 7 : Removed unneeded logging also from audio_device_thread.cc #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+281 lines, -199 lines) Patch
M content/browser/renderer_host/media/audio_input_sync_writer.cc View 1 2 3 4 2 chunks +6 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_sync_writer_unittest.cc View 1 3 chunks +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/audio_sync_reader.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_sync_reader.cc View 1 2 2 chunks +9 lines, -4 lines 0 comments Download
M content/renderer/media/renderer_webaudiodevice_impl.h View 1 2 3 1 chunk +4 lines, -3 lines 0 comments Download
M content/renderer/media/renderer_webaudiodevice_impl.cc View 1 2 3 2 chunks +5 lines, -3 lines 0 comments Download
M content/renderer/media/track_audio_renderer.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M content/renderer/media/track_audio_renderer.cc View 1 2 3 4 5 2 chunks +6 lines, -11 lines 1 comment Download
M content/renderer/media/webrtc_audio_renderer.h View 1 2 2 chunks +5 lines, -4 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer.cc View 1 2 3 5 chunks +12 lines, -22 lines 0 comments Download
M media/audio/audio_device_thread.h View 2 chunks +8 lines, -1 line 0 comments Download
M media/audio/audio_device_thread.cc View 1 2 3 4 5 6 2 chunks +9 lines, -6 lines 0 comments Download
M media/audio/audio_input_device.cc View 1 3 chunks +7 lines, -5 lines 0 comments Download
M media/audio/audio_output_controller.h View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
M media/audio/audio_output_controller.cc View 1 4 chunks +6 lines, -7 lines 0 comments Download
M media/audio/audio_output_controller_unittest.cc View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M media/audio/audio_output_device.cc View 1 4 chunks +10 lines, -10 lines 0 comments Download
M media/audio/audio_output_device_unittest.cc View 1 2 4 chunks +13 lines, -10 lines 0 comments Download
M media/audio/audio_output_stream_sink.cc View 1 2 chunks +3 lines, -6 lines 0 comments Download
M media/audio/clockless_audio_sink.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M media/audio/null_audio_sink.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M media/base/audio_bus_perftest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M media/base/audio_converter_unittest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M media/base/audio_hash_unittest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M media/base/audio_renderer_mixer.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M media/base/audio_renderer_mixer.cc View 1 2 3 chunks +7 lines, -3 lines 0 comments Download
M media/base/audio_renderer_mixer_input.cc View 1 2 chunks +6 lines, -1 line 0 comments Download
M media/base/audio_renderer_mixer_unittest.cc View 1 3 chunks +8 lines, -4 lines 0 comments Download
M media/base/audio_renderer_sink.h View 1 2 1 chunk +8 lines, -7 lines 0 comments Download
M media/base/fake_audio_render_callback.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M media/base/fake_audio_render_callback.cc View 1 2 2 chunks +7 lines, -3 lines 0 comments Download
M media/base/fake_audio_renderer_sink.h View 1 chunk +2 lines, -2 lines 0 comments Download
M media/base/fake_audio_renderer_sink.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M media/base/silent_sink_suspender.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M media/base/silent_sink_suspender.cc View 1 2 4 chunks +9 lines, -7 lines 0 comments Download
M media/base/silent_sink_suspender_unittest.cc View 1 8 chunks +39 lines, -14 lines 0 comments Download
M media/blink/webaudiosourceprovider_impl.cc View 1 2 5 chunks +18 lines, -10 lines 0 comments Download
M media/blink/webaudiosourceprovider_impl_unittest.cc View 1 2 chunks +6 lines, -3 lines 0 comments Download
M media/renderers/audio_renderer_impl.h View 1 2 1 chunk +5 lines, -4 lines 0 comments Download
M media/renderers/audio_renderer_impl.cc View 1 2 2 chunks +9 lines, -5 lines 0 comments Download
M media/renderers/audio_renderer_impl_unittest.cc View 5 chunks +9 lines, -9 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 89 (59 generated)
Mikhail
Please take a look. Unfortunately the modified APIs are used in many places so the ...
4 years, 2 months ago (2016-10-20 18:12:09 UTC) #3
DaleCurtis
https://codereview.chromium.org/2437863004/diff/1/content/browser/renderer_host/media/audio_sync_reader.cc File content/browser/renderer_host/media/audio_sync_reader.cc (right): https://codereview.chromium.org/2437863004/diff/1/content/browser/renderer_host/media/audio_sync_reader.cc#newcode159 content/browser/renderer_host/media/audio_sync_reader.cc:159: Packet packet = {delay.ToInternalValue(), delay_timestamp.ToInternalValue()}; In the past, there ...
4 years, 2 months ago (2016-10-20 18:35:29 UTC) #4
chcunningham
Nice change :) https://codereview.chromium.org/2437863004/diff/1/media/audio/audio_device_thread.cc File media/audio/audio_device_thread.cc (right): https://codereview.chromium.org/2437863004/diff/1/media/audio/audio_device_thread.cc#newcode72 media/audio/audio_device_thread.cc:72: if (bytes_read != sizeof(packet)) Not sure ...
4 years, 1 month ago (2016-10-21 18:19:47 UTC) #5
James West
https://codereview.chromium.org/2437863004/diff/1/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/2437863004/diff/1/content/renderer/media/webrtc_audio_renderer.cc#newcode413 content/renderer/media/webrtc_audio_renderer.cc:413: // TODO(grunell): Using of milliseconds will potentially lose "Using ...
4 years, 1 month ago (2016-10-21 19:40:17 UTC) #7
miu
Nice work! Great to see more of the "legacy audio API" being fixed. This will ...
4 years, 1 month ago (2016-10-23 01:19:16 UTC) #9
Mikhail
Thank you for review! https://codereview.chromium.org/2437863004/diff/1/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc (right): https://codereview.chromium.org/2437863004/diff/1/content/browser/renderer_host/media/audio_input_sync_writer.cc#newcode331 content/browser/renderer_host/media/audio_input_sync_writer.cc:331: base::TimeTicks::Now().ToInternalValue()}; On 2016/10/23 01:19:15, miu ...
4 years, 1 month ago (2016-10-24 19:50:24 UTC) #21
James West
https://codereview.chromium.org/2437863004/diff/40001/content/browser/renderer_host/media/audio_sync_reader.h File content/browser/renderer_host/media/audio_sync_reader.h (right): https://codereview.chromium.org/2437863004/diff/40001/content/browser/renderer_host/media/audio_sync_reader.h#newcode51 content/browser/renderer_host/media/audio_sync_reader.h:51: uint32_t frames_skipped) override; Change to "int prior_frames_skipped" for consistency ...
4 years, 1 month ago (2016-10-24 21:05:45 UTC) #24
miu
lgtm (assuming James' comments are addressed before commit) https://codereview.chromium.org/2437863004/diff/1/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc (right): https://codereview.chromium.org/2437863004/diff/1/content/browser/renderer_host/media/audio_input_sync_writer.cc#newcode331 content/browser/renderer_host/media/audio_input_sync_writer.cc:331: base::TimeTicks::Now().ToInternalValue()}; ...
4 years, 1 month ago (2016-10-24 22:45:52 UTC) #25
Mikhail
https://codereview.chromium.org/2437863004/diff/40001/content/browser/renderer_host/media/audio_sync_reader.h File content/browser/renderer_host/media/audio_sync_reader.h (right): https://codereview.chromium.org/2437863004/diff/40001/content/browser/renderer_host/media/audio_sync_reader.h#newcode51 content/browser/renderer_host/media/audio_sync_reader.h:51: uint32_t frames_skipped) override; On 2016/10/24 21:05:45, James West wrote: ...
4 years, 1 month ago (2016-10-25 07:46:10 UTC) #28
James West
lgtm except for a few minor things. https://codereview.chromium.org/2437863004/diff/60001/content/renderer/media/renderer_webaudiodevice_impl.cc File content/renderer/media/renderer_webaudiodevice_impl.cc (right): https://codereview.chromium.org/2437863004/diff/60001/content/renderer/media/renderer_webaudiodevice_impl.cc#newcode106 content/renderer/media/renderer_webaudiodevice_impl.cc:106: int frames_skipped, ...
4 years, 1 month ago (2016-10-25 18:22:17 UTC) #31
Mikhail
Thanks for review! https://codereview.chromium.org/2437863004/diff/60001/content/renderer/media/renderer_webaudiodevice_impl.cc File content/renderer/media/renderer_webaudiodevice_impl.cc (right): https://codereview.chromium.org/2437863004/diff/60001/content/renderer/media/renderer_webaudiodevice_impl.cc#newcode106 content/renderer/media/renderer_webaudiodevice_impl.cc:106: int frames_skipped, On 2016/10/25 18:22:17, James ...
4 years, 1 month ago (2016-10-25 20:58:10 UTC) #34
Mikhail
jochen@, could you take a look at content/ changes?
4 years, 1 month ago (2016-10-25 21:01:35 UTC) #36
chcunningham
lgtm
4 years, 1 month ago (2016-10-26 00:01:49 UTC) #39
jochen (gone - plz use gerrit)
please ask one of the /content/*/media OWNERS to review the content changes
4 years, 1 month ago (2016-10-26 07:07:12 UTC) #40
Mikhail
tommi@, perkj@, could you take a look at content/ changes?
4 years, 1 month ago (2016-10-26 07:18:10 UTC) #42
tommi (sloooow) - chröme
lgtm % comments https://codereview.chromium.org/2437863004/diff/80001/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc (right): https://codereview.chromium.org/2437863004/diff/80001/content/browser/renderer_host/media/audio_input_sync_writer.cc#newcode331 content/browser/renderer_host/media/audio_input_sync_writer.cc:331: base::TimeTicks::Now().ToInternalValue()}; using ToInternalValue() here but InMicroseconds ...
4 years, 1 month ago (2016-10-26 19:53:26 UTC) #43
Mikhail
https://codereview.chromium.org/2437863004/diff/80001/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc (right): https://codereview.chromium.org/2437863004/diff/80001/content/browser/renderer_host/media/audio_input_sync_writer.cc#newcode331 content/browser/renderer_host/media/audio_input_sync_writer.cc:331: base::TimeTicks::Now().ToInternalValue()}; On 2016/10/26 19:53:25, tommi (chrömium) wrote: > using ...
4 years, 1 month ago (2016-10-27 10:56:27 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2437863004/120001
4 years, 1 month ago (2016-10-27 10:57:09 UTC) #56
commit-bot: I haz the power
Committed patchset #5 (id:120001)
4 years, 1 month ago (2016-10-27 11:03:02 UTC) #58
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/df872a842609926a62e0211868c886d0ec96cff7 Cr-Commit-Position: refs/heads/master@{#427996}
4 years, 1 month ago (2016-10-27 11:05:27 UTC) #60
sakal-chromium
A revert of this CL (patchset #5 id:120001) has been created in https://codereview.chromium.org/2452183003/ by sakal@chromium.org. ...
4 years, 1 month ago (2016-10-27 14:08:21 UTC) #61
Mikhail
On 2016/10/27 14:08:21, sakal-chromium wrote: > A revert of this CL (patchset #5 id:120001) has ...
4 years, 1 month ago (2016-10-31 13:31:26 UTC) #71
chcunningham
https://codereview.chromium.org/2437863004/diff/180001/media/audio/audio_device_thread.cc File media/audio/audio_device_thread.cc (right): https://codereview.chromium.org/2437863004/diff/180001/media/audio/audio_device_thread.cc#newcode73 media/audio/audio_device_thread.cc:73: LOG(ERROR) << "Failed to receive."; I'm surprised this ever ...
4 years, 1 month ago (2016-10-31 20:08:35 UTC) #78
miu
lgtm https://codereview.chromium.org/2437863004/diff/180001/media/audio/audio_device_thread.cc File media/audio/audio_device_thread.cc (right): https://codereview.chromium.org/2437863004/diff/180001/media/audio/audio_device_thread.cc#newcode73 media/audio/audio_device_thread.cc:73: LOG(ERROR) << "Failed to receive."; On 2016/10/31 20:08:35, ...
4 years, 1 month ago (2016-10-31 20:59:04 UTC) #79
Mikhail
On 2016/10/31 20:08:35, chcunningham wrote: > https://codereview.chromium.org/2437863004/diff/180001/media/audio/audio_device_thread.cc > File media/audio/audio_device_thread.cc (right): > > https://codereview.chromium.org/2437863004/diff/180001/media/audio/audio_device_thread.cc#newcode73 > ...
4 years, 1 month ago (2016-11-01 06:57:05 UTC) #80
Mikhail
On 2016/10/31 20:59:04, miu wrote: > https://codereview.chromium.org/2437863004/diff/200001/content/renderer/media/track_audio_renderer.cc > File content/renderer/media/track_audio_renderer.cc (right): > > https://codereview.chromium.org/2437863004/diff/200001/content/renderer/media/track_audio_renderer.cc#newcode59 > ...
4 years, 1 month ago (2016-11-01 07:02:40 UTC) #81
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2437863004/200001
4 years, 1 month ago (2016-11-01 07:03:26 UTC) #84
commit-bot: I haz the power
Committed patchset #7 (id:200001)
4 years, 1 month ago (2016-11-01 07:11:20 UTC) #86
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/06d9d80a203b9c329fc6d53fde44bae66645a389 Cr-Commit-Position: refs/heads/master@{#428953}
4 years, 1 month ago (2016-11-01 07:13:33 UTC) #88
David Tseng
4 years, 1 month ago (2016-11-02 20:31:34 UTC) #89
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:200001) has been created in
https://codereview.chromium.org/2471733004/ by dtseng@chromium.org.

The reason for reverting is: This breaks built in speech synthesis on Chrome OS.
To reproduce, simply use web speech to speak something e.g.
speechSynthesis.speak(new SpeechSynthesisUtterance('test'));.

Powered by Google App Engine
This is Rietveld 408576698