Chromium Code Reviews| Index: chromecast/media/audio/cast_audio_manager.h |
| diff --git a/chromecast/media/audio/cast_audio_manager.h b/chromecast/media/audio/cast_audio_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2c3bad1968a7a303ee9b3a23c5bab09de377c747 |
| --- /dev/null |
| +++ b/chromecast/media/audio/cast_audio_manager.h |
| @@ -0,0 +1,77 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MANAGER_H_ |
| +#define CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MANAGER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/linked_ptr.h" |
| +#include "media/audio/audio_manager_base.h" |
| + |
| +namespace media { |
| +class AudioLogFactory; |
| +} |
| + |
| +namespace chromecast { |
| + |
| +class CastAudioOutputDevice; |
| +class ChromecastDeviceAudioOutputStream; |
| + |
| +class CastAudioManager : public media::AudioManagerBase { |
|
gunsch
2015/04/27 16:09:11
+1 to Eric's comment about namespacing, prefer ::m
slan
2015/04/28 00:11:38
Done for entire chromecast/media/audio directory.
|
| + public: |
| + // This class acts as a proxy for chromecast::CastAudioOutputDevice, |
|
gunsch
2015/04/27 16:09:11
Documentation nit: separate the "class" docs from
slan
2015/04/28 00:11:38
Done.
|
| + // converting external-facing chromecast interfaces and data structures to |
| + // those expected by media::AudioManager. It does not take ownership of |
| + // |audio_output_device|, which must be non-null and which must outlive this |
| + // class. All calls to CreateAudioLog() will be forwarded to |
| + // |audio_log_factory|, which also must outlive this class. |
| + CastAudioManager(media::AudioLogFactory* audio_log_factory, |
| + CastAudioOutputDevice* audio_output_device); |
|
byungchul
2015/04/27 17:38:06
who instantiate CastAudioOutputDevice?
slan
2015/04/28 00:11:38
|audio_output_device| should be a global instance
|
| + ~CastAudioManager() override; |
| + |
| + // media::AudioManager implementation: |
| + bool HasAudioOutputDevices() override; |
| + bool HasAudioInputDevices() override; |
| + void ShowAudioInputSettings() override; |
| + void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names) override; |
| + media::AudioParameters GetInputStreamParameters( |
| + const std::string& device_id) override; |
| + |
| + // media::AudioManagerBase implementation: |
| + media::AudioParameters GetPreferredOutputStreamParameters( |
| + const std::string& output_device_id, |
| + const media::AudioParameters& input_params) override; |
| + media::AudioOutputStream* MakeLinearOutputStream( |
| + const media::AudioParameters& params) override; |
| + media::AudioOutputStream* MakeLowLatencyOutputStream( |
| + const media::AudioParameters& params, |
| + const std::string& device_id) override; |
| + media::AudioInputStream* MakeLinearInputStream( |
| + const media::AudioParameters& params, |
| + const std::string& device_id) override; |
| + media::AudioInputStream* MakeLowLatencyInputStream( |
| + const media::AudioParameters& params, |
| + const std::string& device_id) override; |
| + |
| + private: |
| + // Host a media::AudioOutputStream interface which wraps a |
| + // chromecast::AudioOutputStream. |
| + media::AudioOutputStream* MakeCastOutputStream( |
| + const media::AudioParameters& params); |
| + |
| + // Bindings between media and chromecast audio streams. |
| + std::vector<linked_ptr<ChromecastDeviceAudioOutputStream>> streams_; |
| + |
| + // The underlying audio output device. |
| + chromecast::CastAudioOutputDevice* audio_output_device_; |
|
byungchul
2015/04/27 17:38:06
* const
slan
2015/04/28 00:11:38
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(CastAudioManager); |
| +}; |
| + |
| +} // namespace chromecast |
| + |
| +#endif // CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MANAGER_H_ |