Chromium Code Reviews| Index: chromecast/media/audio/cast_audio_mixer.h |
| diff --git a/chromecast/media/audio/cast_audio_mixer.h b/chromecast/media/audio/cast_audio_mixer.h |
| index 7927f4259543c0c5eaf5efe5d42a0a77fd016a0f..d327cbeccea4691c7ccaf355dac280c4248c45ad 100644 |
| --- a/chromecast/media/audio/cast_audio_mixer.h |
| +++ b/chromecast/media/audio/cast_audio_mixer.h |
| @@ -6,7 +6,7 @@ |
| #define CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MIXER_H_ |
| #include <memory> |
| -#include <vector> |
| +#include <set> |
| #include "base/callback.h" |
| #include "base/macros.h" |
| @@ -25,15 +25,11 @@ class CastAudioManager; |
| // stream down to a single AudioOutputStream to be rendered by the CMA backend. |
| class CastAudioMixer : public ::media::AudioOutputStream::AudioSourceCallback { |
| public: |
| - using RealStreamFactory = base::Callback<::media::AudioOutputStream*( |
| - const ::media::AudioParameters&)>; |
| - |
| - explicit CastAudioMixer(const RealStreamFactory& real_stream_factory); |
| + CastAudioMixer(CastAudioManager* audio_manager); |
|
slan
2017/05/30 16:26:01
nit: explicit
alokp
2017/05/30 23:19:33
Done.
|
| ~CastAudioMixer() override; |
| virtual ::media::AudioOutputStream* MakeStream( |
| - const ::media::AudioParameters& params, |
| - CastAudioManager* audio_manager); |
| + const ::media::AudioParameters& params); |
| private: |
| class MixerProxyStream; |
| @@ -43,7 +39,6 @@ class CastAudioMixer : public ::media::AudioOutputStream::AudioSourceCallback { |
| base::TimeTicks delay_timestamp, |
| int prior_frames_skipped, |
| ::media::AudioBus* dest) override; |
| - |
| void OnError() override; |
| // MixedAudioOutputStreams call Register on opening and AddInput on starting. |
| @@ -51,17 +46,17 @@ class CastAudioMixer : public ::media::AudioOutputStream::AudioSourceCallback { |
| void Unregister(MixerProxyStream* proxy_stream); |
| void AddInput(::media::AudioConverter::InputCallback* input_callback); |
| void RemoveInput(::media::AudioConverter::InputCallback* input_callback); |
| + void HandleError(); |
| - base::ThreadChecker thread_checker_; |
| - std::unique_ptr<::media::AudioConverter> mixer_; |
| + CastAudioManager* audio_manager_; |
|
slan
2017/05/30 16:26:01
nit: const
alokp
2017/05/30 23:19:33
Done.
|
| bool error_; |
| - |
| - const RealStreamFactory real_stream_factory_; |
| - ::media::AudioOutputStream* output_stream_; |
| + std::set<MixerProxyStream*> proxy_streams_; |
| + std::unique_ptr<::media::AudioConverter> mixer_; |
| + base::Lock mixer_lock_; |
| ::media::AudioParameters output_params_; |
| + ::media::AudioOutputStream* output_stream_; |
| - std::vector<MixerProxyStream*> proxy_streams_; |
| - |
| + THREAD_CHECKER(audio_thread_checker_); |
| DISALLOW_COPY_AND_ASSIGN(CastAudioMixer); |
| }; |