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

Side by Side Diff: media/audio/audio_input_device.cc

Issue 2689483006: Switch browser side audio capture path to use base time primitives. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/audio_input_device.h" 5 #include "media/audio/audio_input_device.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 LOG(ERROR) << message; 328 LOG(ERROR) << message;
329 capture_callback_->OnCaptureError(message); 329 capture_callback_->OnCaptureError(message);
330 } 330 }
331 last_buffer_id_ = buffer->params.id; 331 last_buffer_id_ = buffer->params.id;
332 332
333 // Use pre-allocated audio bus wrapping existing block of shared memory. 333 // Use pre-allocated audio bus wrapping existing block of shared memory.
334 media::AudioBus* audio_bus = audio_buses_[current_segment_id_]; 334 media::AudioBus* audio_bus = audio_buses_[current_segment_id_];
335 335
336 // Deliver captured data to the client in floating point format and update 336 // Deliver captured data to the client in floating point format and update
337 // the audio delay measurement. 337 // the audio delay measurement.
338 // TODO(olka, tommi): Do something with |delay_timestamp|.
o1ka 2017/02/10 13:28:50 Looking on TimeTicks::IsConsistentAcrossProcesses(
o1ka 2017/02/10 13:28:50 Will we break anything if we leave it as "TODO"? L
DaleCurtis 2017/02/11 01:43:13 Good question, looking at the implementations, thi
o1ka 2017/02/13 14:00:21 Can we have this documented in the code?
338 capture_callback_->Capture( 339 capture_callback_->Capture(
339 audio_bus, 340 audio_bus,
340 buffer->params.hardware_delay_bytes / bytes_per_ms_, // Delay in ms 341 base::TimeDelta::FromMicroseconds(buffer->params.delay).InMilliseconds(),
341 buffer->params.volume, buffer->params.key_pressed); 342 buffer->params.volume, buffer->params.key_pressed);
342 343
343 if (++current_segment_id_ >= total_segments_) 344 if (++current_segment_id_ >= total_segments_)
344 current_segment_id_ = 0; 345 current_segment_id_ = 0;
345 } 346 }
346 347
347 } // namespace media 348 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698