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

Unified Diff: media/base/audio_renderer_mixer_input.h

Issue 11410012: Collapse AudioRendererMixer and OnMoreDataResampler into AudioTransform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: First draft. Created 8 years, 1 month 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 486f5c2f19c56428a54e389db3856732b8d4a408..313f15ff61ff13b64daf7bddd5a37e9346c8b502 100644
--- a/media/base/audio_renderer_mixer_input.h
+++ b/media/base/audio_renderer_mixer_input.h
@@ -9,13 +9,15 @@
#include "base/callback.h"
#include "media/base/audio_renderer_sink.h"
+#include "media/base/audio_transform.h"
namespace media {
class AudioRendererMixer;
class MEDIA_EXPORT AudioRendererMixerInput
- : NON_EXPORTED_BASE(public AudioRendererSink) {
+ : NON_EXPORTED_BASE(public AudioRendererSink),
+ public AudioTransform::AudioTransformInput {
public:
typedef base::Callback<AudioRendererMixer*(
const AudioParameters& params)> GetMixerCB;
@@ -24,9 +26,6 @@ class MEDIA_EXPORT AudioRendererMixerInput
AudioRendererMixerInput(
const GetMixerCB& get_mixer_cb, const RemoveMixerCB& remove_mixer_cb);
- AudioRendererSink::RenderCallback* callback() { return callback_; }
- bool playing() { return playing_; }
-
// AudioRendererSink implementation.
virtual void Start() OVERRIDE;
virtual void Stop() OVERRIDE;
@@ -36,17 +35,29 @@ class MEDIA_EXPORT AudioRendererMixerInput
virtual void Initialize(const AudioParameters& params,
AudioRendererSink::RenderCallback* renderer) OVERRIDE;
- void GetVolume(double* volume);
+ // Called by AudioRendererMixer when new delay information is available.
+ void set_audio_delay_milliseconds(int audio_delay_milliseconds) {
+ current_audio_delay_milliseconds_ = audio_delay_milliseconds;
+ }
+
+ // Called by AudioRendererMixer when an error occurs.
+ void OnRenderError();
protected:
virtual ~AudioRendererMixerInput();
private:
+ friend class AudioRendererMixerInputTest;
+
bool playing_;
bool initialized_;
bool started_;
double volume_;
+ // AudioTransform::ProvideAudioTransformInput implementation.
+ virtual float ProvideAudioTransformInput(
+ AudioBus* audio_bus, base::TimeDelta buffer_delay) OVERRIDE;
+
// 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_;
@@ -62,6 +73,10 @@ class MEDIA_EXPORT AudioRendererMixerInput
// Source of audio data which is provided to the mixer.
AudioRendererSink::RenderCallback* callback_;
+ // The current audio delay as last provided by AudioRendererMixer. Updated on
+ // each ProvideInput() call using |ms_per_frame_|.
+ int current_audio_delay_milliseconds_;
+
DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerInput);
};

Powered by Google App Engine
This is Rietveld 408576698