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

Unified Diff: media/base/audio_renderer_mixer_input.h

Issue 10698066: Switch to pcm_low_latency and enable resampling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments! Created 8 years, 5 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
« no previous file with comments | « media/base/audio_renderer_mixer.cc ('k') | media/base/audio_renderer_mixer_input.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_renderer_mixer_input.h
diff --git a/media/base/audio_renderer_mixer_input.h b/media/base/audio_renderer_mixer_input.h
index 7e8c9f1ccd6896fcf337048188caa7d02ae22f1e..5813a97ca2779a8c19ebdb9f5162990134034f08 100644
--- a/media/base/audio_renderer_mixer_input.h
+++ b/media/base/audio_renderer_mixer_input.h
@@ -7,6 +7,7 @@
#include <vector>
+#include "base/callback.h"
#include "media/base/audio_renderer_sink.h"
namespace media {
@@ -16,12 +17,13 @@ class AudioRendererMixer;
class MEDIA_EXPORT AudioRendererMixerInput
: NON_EXPORTED_BASE(public AudioRendererSink) {
public:
- explicit AudioRendererMixerInput(
- const scoped_refptr<AudioRendererMixer>& mixer);
+ typedef base::Callback<AudioRendererMixer*(
+ const AudioParameters& params)> GetMixerCB;
+ typedef base::Callback<void(const AudioParameters& params)> RemoveMixerCB;
+
+ AudioRendererMixerInput(
+ const GetMixerCB& get_mixer_cb, const RemoveMixerCB& remove_mixer_cb);
- // Each input should manage its own data buffer. The mixer will call this
- // method when it needs a buffer for rendering.
- const std::vector<float*>& audio_data() { return audio_data_; }
AudioRendererSink::RenderCallback* callback() { return callback_; }
bool playing() { return playing_; }
@@ -43,16 +45,21 @@ class MEDIA_EXPORT AudioRendererMixerInput
bool initialized_;
double volume_;
- // AudioRendererMixer is reference counted by all its AudioRendererMixerInputs
- // and is destroyed when all AudioRendererMixerInputs have called RemoveMixer.
- scoped_refptr<AudioRendererMixer> mixer_;
+ // Callbacks provided during construction which allow AudioRendererMixerInput
+ // to retrieve a mixer during Initialize() and notify when it's done with it.
+ GetMixerCB get_mixer_cb_;
+ RemoveMixerCB remove_mixer_cb_;
+
+ // AudioParameters received during Initialize().
+ AudioParameters params_;
+
+ // AudioRendererMixer provided through |get_mixer_cb_| during Initialize(),
+ // guaranteed to live (at least) until |remove_mixer_cb_| is called.
+ AudioRendererMixer* mixer_;
// Source of audio data which is provided to the mixer.
AudioRendererSink::RenderCallback* callback_;
- // Vector for rendering audio data which will be used by the mixer.
- std::vector<float*> audio_data_;
-
DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerInput);
};
« no previous file with comments | « media/base/audio_renderer_mixer.cc ('k') | media/base/audio_renderer_mixer_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698