summaryrefslogtreecommitdiffstats
path: root/chromecast/media/audio
diff options
context:
space:
mode:
authorgrunell <grunell@chromium.org>2015-12-18 03:28:21 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-18 11:29:19 +0000
commit09a6d7939e02a3b892d3eeaac95c5f0fc36e7e72 (patch)
tree82e8ecc62499e9452d16bbcc9fb1ab70ad785884 /chromecast/media/audio
parentbbebdda2945f809f53ecdd41100a315ed3265532 (diff)
downloadchromium_src-09a6d7939e02a3b892d3eeaac95c5f0fc36e7e72.zip
chromium_src-09a6d7939e02a3b892d3eeaac95c5f0fc36e7e72.tar.gz
chromium_src-09a6d7939e02a3b892d3eeaac95c5f0fc36e7e72.tar.bz2
Forward the number of skipped frames by the OS in audio playout.
* Introduce AudioOutputBufferParameters in media/audio/audio_parameters.h. This contains number of skipped frames. * Change the shared memory to hold AudioOutputBufferParameters before the audio data. * Forward skipped frames by OS on Mac over IPC. Not yet used by any client. This relands https://codereview.chromium.org/1487983002/ which was reverted due to crackling flash (pepper) audio. Original CL is in patch set 1. Will be done in follow-up CLs: * Forward skipped frames by OS on Windows. * Forward skipped frames to the WebRTC AEC. BUG=560371 TBR=dalecurtis@chromium.org,ckehoe@chromium.org (no changes from original CL) Review URL: https://codereview.chromium.org/1538563002 Cr-Commit-Position: refs/heads/master@{#366078}
Diffstat (limited to 'chromecast/media/audio')
-rw-r--r--chromecast/media/audio/cast_audio_output_stream.cc3
-rw-r--r--chromecast/media/audio/cast_audio_output_stream_unittest.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/chromecast/media/audio/cast_audio_output_stream.cc b/chromecast/media/audio/cast_audio_output_stream.cc
index d6fab42..6dac338 100644
--- a/chromecast/media/audio/cast_audio_output_stream.cc
+++ b/chromecast/media/audio/cast_audio_output_stream.cc
@@ -331,7 +331,8 @@ void CastAudioOutputStream::PushBuffer() {
std::max(base::TimeDelta(), next_push_time_ - now);
uint32_t bytes_delay = queue_delay.InMicroseconds() *
audio_params_.GetBytesPerSecond() / 1000000;
- int frame_count = source_callback_->OnMoreData(audio_bus_.get(), bytes_delay);
+ int frame_count =
+ source_callback_->OnMoreData(audio_bus_.get(), bytes_delay, 0);
VLOG(3) << "frames_filled=" << frame_count << " with latency=" << bytes_delay;
DCHECK_EQ(frame_count, audio_bus_->frames());
diff --git a/chromecast/media/audio/cast_audio_output_stream_unittest.cc b/chromecast/media/audio/cast_audio_output_stream_unittest.cc
index 35d5955..e946c25 100644
--- a/chromecast/media/audio/cast_audio_output_stream_unittest.cc
+++ b/chromecast/media/audio/cast_audio_output_stream_unittest.cc
@@ -165,7 +165,8 @@ class FakeAudioSourceCallback
// ::media::AudioOutputStream::AudioSourceCallback overrides.
int OnMoreData(::media::AudioBus* audio_bus,
- uint32 total_bytes_delay) override {
+ uint32_t total_bytes_delay,
+ uint32_t frames_skipped) override {
audio_bus->Zero();
return audio_bus->frames();
}