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

Unified Diff: content/renderer/media/renderer_webaudiodevice_impl.h

Issue 1990303002: Moving FIFO from AudioDestination to RendererWebAudioDeviceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for android compilation error Created 4 years, 7 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/renderer/media/renderer_webaudiodevice_impl.h
diff --git a/content/renderer/media/renderer_webaudiodevice_impl.h b/content/renderer/media/renderer_webaudiodevice_impl.h
index 48e7fad2d6a17cbe2c9afb6ad6549aacf3e6c04d..fd5827fbf2904629da417d19808bd717b0015ebe 100644
--- a/content/renderer/media/renderer_webaudiodevice_impl.h
+++ b/content/renderer/media/renderer_webaudiodevice_impl.h
@@ -23,6 +23,7 @@ class SingleThreadTaskRunner;
namespace media {
class NullAudioSink;
+class AudioPullFifo;
}
namespace content {
@@ -50,7 +51,14 @@ class RendererWebAudioDeviceImpl
void OnRenderError() override;
private:
- const media::AudioParameters params_;
+ // Called by AudioPullFifo when more data is necessary.
+ void SourceCallback(int fifo_frames_delay, media::AudioBus* audio_bus);
+
+ // Creates a FIFO to rebuffer audio between the client and the sink.
+ void CreateFifoIfRequired(int render_frames_per_buffer);
+
+ // Parameters of audio being pulled from the client.
+ const media::AudioParameters client_params_;
// Weak reference to the callback into WebKit code.
blink::WebAudioDevice::RenderCallback* const client_callback_;
@@ -92,6 +100,10 @@ class RendererWebAudioDeviceImpl
// Security origin, used to check permissions for |output_device_|.
url::Origin security_origin_;
+ // Used to buffer data between the client and the sink in cases where
+ // the client buffer size is not the same as rendering buffer size.
+ std::unique_ptr<media::AudioPullFifo> audio_fifo_;
+
DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl);
};

Powered by Google App Engine
This is Rietveld 408576698