| 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 {
|
| + public:
|
| + // This class acts as a proxy for chromecast::CastAudioOutputDevice,
|
| + // 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);
|
| + ~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_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(CastAudioManager);
|
| +};
|
| +
|
| +} // namespace chromecast
|
| +
|
| +#endif // CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MANAGER_H_
|
|
|