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

Unified Diff: content/browser/renderer_host/media/audio_sync_reader.cc

Issue 2437863004: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Created 4 years, 2 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: content/browser/renderer_host/media/audio_sync_reader.cc
diff --git a/content/browser/renderer_host/media/audio_sync_reader.cc b/content/browser/renderer_host/media/audio_sync_reader.cc
index 6299aaf7e665b038956893ef87a562dac5a623af..a79da77eff251ef14910ef2e9bdd5789b519ebaf 100644
--- a/content/browser/renderer_host/media/audio_sync_reader.cc
+++ b/content/browser/renderer_host/media/audio_sync_reader.cc
@@ -18,10 +18,12 @@
#include "build/build_config.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/public/common/content_switches.h"
+#include "media/audio/audio_device_thread.h"
#include "media/base/audio_parameters.h"
using media::AudioBus;
using media::AudioOutputBuffer;
+using Packet = media::AudioDeviceThread::Packet;
namespace {
@@ -140,8 +142,9 @@ std::unique_ptr<AudioSyncReader> AudioSyncReader::Create(
}
// media::AudioOutputController::SyncReader implementations.
-void AudioSyncReader::UpdatePendingBytes(uint32_t bytes,
- uint32_t frames_skipped) {
+void AudioSyncReader::PrepareNextData(base::TimeDelta delay,
+ base::TimeTicks delay_timestamp,
+ uint32_t frames_skipped) {
// Increase the number of skipped frames stored in shared memory. We don't
// send it over the socket since sending more than 4 bytes might lead to being
// descheduled. The reading side will zero it when consumed.
@@ -153,7 +156,8 @@ void AudioSyncReader::UpdatePendingBytes(uint32_t bytes,
// in the anomalous case if the renderer is unable to keep up with real-time.
output_bus_->Zero();
- socket_->Send(&bytes, sizeof(bytes));
+ Packet packet = {delay.ToInternalValue(), delay_timestamp.ToInternalValue()};
DaleCurtis 2016/10/20 18:35:29 In the past, there were concerns that sending more
miu 2016/10/23 01:19:15 ditto here: Please use InMicroseconds() instead of
Mikhail 2016/10/24 19:50:23 Done.
+ socket_->Send(&packet, sizeof(packet));
++buffer_index_;
}

Powered by Google App Engine
This is Rietveld 408576698