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

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! Remove RefCount. Squash ARMM changes. 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
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..da1ca88d4e86043de234db658164fbe52827ab0e 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,12 @@ 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(
scherkus (not reviewing) 2012/07/14 01:45:02 nit: blank line before here
DaleCurtis 2012/07/14 02:10:03 Done.
+ 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 +44,20 @@ 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().
+ AudioRendererMixer* mixer_;
scherkus (not reviewing) 2012/07/14 01:45:02 add docs on ownership / lifetime (i.e., expected t
DaleCurtis 2012/07/14 02:10:03 Done.
// 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);
};

Powered by Google App Engine
This is Rietveld 408576698