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

Unified Diff: media/audio/audio_output_controller.cc

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementation of 'AudioContext.getOutputTimestamp' method Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_output_controller.cc
diff --git a/media/audio/audio_output_controller.cc b/media/audio/audio_output_controller.cc
index 9b8f52387d8e7a4f638d73c7d1127ae2a2f394e2..f6e1e769e9f16613abd5f3bd03c53e95aeb33910 100644
--- a/media/audio/audio_output_controller.cc
+++ b/media/audio/audio_output_controller.cc
@@ -173,7 +173,7 @@ void AudioOutputController::DoPlay() {
return;
// Ask for first packet.
- sync_reader_->UpdatePendingBytes(0, 0);
+ sync_reader_->UpdatePendingBytes(0, 0, {0, 0});
Raymond Toy 2016/06/14 16:42:40 Will this produce the right sized structure for Au
Mikhail 2016/06/17 09:36:57 those are converted to int64 to construct an Audio
Raymond Toy 2016/06/17 20:55:16 Yes AudioTimestamp() would be much nicer!
state_ = kPlaying;
@@ -226,7 +226,8 @@ void AudioOutputController::DoPause() {
// Let the renderer know we've stopped. Necessary to let PPAPI clients know
// audio has been shutdown. TODO(dalecurtis): This stinks. PPAPI should have
// a better way to know when it should exit PPB_Audio_Shared::Run().
- sync_reader_->UpdatePendingBytes(std::numeric_limits<uint32_t>::max(), 0);
+ sync_reader_->UpdatePendingBytes(std::numeric_limits<uint32_t>::max(), 0,
+ {0, 0});
handler_->OnPaused();
}
@@ -294,7 +295,8 @@ void AudioOutputController::DoReportError() {
int AudioOutputController::OnMoreData(AudioBus* dest,
uint32_t total_bytes_delay,
- uint32_t frames_skipped) {
+ uint32_t frames_skipped,
+ const AudioTimestamp& output_timestamp) {
TRACE_EVENT0("audio", "AudioOutputController::OnMoreData");
// Indicate that we haven't wedged (at least not indefinitely, WedgeCheck()
@@ -308,7 +310,8 @@ int AudioOutputController::OnMoreData(AudioBus* dest,
const int frames = dest->frames();
sync_reader_->UpdatePendingBytes(
- total_bytes_delay + frames * params_.GetBytesPerFrame(), frames_skipped);
+ total_bytes_delay + frames * params_.GetBytesPerFrame(), frames_skipped,
+ output_timestamp);
bool need_to_duplicate = false;
{

Powered by Google App Engine
This is Rietveld 408576698