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

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

Issue 2452183003: Revert of 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 c5af7183080d68d6e7fb39c9c8fa2dfc34607df5..6299aaf7e665b038956893ef87a562dac5a623af 100644
--- a/content/browser/renderer_host/media/audio_sync_reader.cc
+++ b/content/browser/renderer_host/media/audio_sync_reader.cc
@@ -18,12 +18,10 @@
#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 {
@@ -142,23 +140,20 @@
}
// media::AudioOutputController::SyncReader implementations.
-void AudioSyncReader::RequestMoreData(base::TimeDelta delay,
- base::TimeTicks delay_timestamp,
- int prior_frames_skipped) {
+void AudioSyncReader::UpdatePendingBytes(uint32_t bytes,
+ 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.
AudioOutputBuffer* buffer =
reinterpret_cast<AudioOutputBuffer*>(shared_memory_->memory());
- buffer->params.frames_skipped += prior_frames_skipped;
+ buffer->params.frames_skipped += frames_skipped;
// Zero out the entire output buffer to avoid stuttering/repeating-buffers
// in the anomalous case if the renderer is unable to keep up with real-time.
output_bus_->Zero();
- Packet packet = {delay.InMicroseconds(),
- (delay_timestamp - base::TimeTicks()).InMicroseconds()};
- socket_->Send(&packet, sizeof(packet));
+ socket_->Send(&bytes, sizeof(bytes));
++buffer_index_;
}
« no previous file with comments | « content/browser/renderer_host/media/audio_sync_reader.h ('k') | content/renderer/media/renderer_webaudiodevice_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698