Index: chromecast/media/audio/chromecast_device_audio_output_stream.h |
diff --git a/chromecast/media/audio/chromecast_device_audio_output_stream.h b/chromecast/media/audio/chromecast_device_audio_output_stream.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..825e328ec9351828420f8a344ea43ba7a92f0d45 |
--- /dev/null |
+++ b/chromecast/media/audio/chromecast_device_audio_output_stream.h |
@@ -0,0 +1,61 @@ |
+// 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_CHROMECAST_DEVICE_AUDIO_OUTPUT_STREAM_H_ |
+#define CHROMECAST_MEDIA_AUDIO_CHROMECAST_DEVICE_AUDIO_OUTPUT_STREAM_H_ |
+ |
+#include "base/macros.h" |
+#include "chromecast/public/cast_audio_stream.h" |
+#include "media/audio/audio_io.h" |
+#include "media/audio/audio_manager.h" |
+#include "media/base/media_export.h" |
+ |
+namespace chromecast { |
+ |
+struct AudioParameters; |
+ |
+// An implementation of media::AudioOutputStream for any Chromecast device. This |
+// passes control requests and data to an instance of the platform-independent |
+// chromecast::CastAudioOutputStream interface. |
+class ChromecastDeviceAudioOutputStream |
+ : public chromecast::CastAudioOutputStream::AudioSourceCallback, |
gunsch
2015/04/27 16:09:11
style nit: don't fully-qualify chromecast-namespac
byungchul
2015/04/27 17:38:06
And, it doesn't have to be public.
slan
2015/04/28 00:11:38
Done.
slan
2015/04/28 00:11:38
Done.
|
+ public media::AudioOutputStream { |
+ public: |
+ ChromecastDeviceAudioOutputStream( |
+ chromecast::CastAudioOutputStream* output_stream, |
gunsch
2015/04/27 16:09:11
Describe the ownership model here, since you're pa
slan
2015/04/28 00:11:39
Documentation added clarifying the ownership model
|
+ const chromecast::AudioParameters& params); |
+ ~ChromecastDeviceAudioOutputStream() override; |
+ |
+ // media::AudioOutputStream implementation: |
+ bool Open() override; |
+ void Start(media::AudioOutputStream::AudioSourceCallback* callback) override; |
+ void Stop() override; |
+ void SetVolume(double volume) override; |
+ void GetVolume(double* volume) override; |
+ void Close() override; |
+ |
+ // chromecast::AudioSourceCallback implementation: |
+ int OnMoreData(void* dest, |
+ uint32_t len, |
+ int32_t frames, |
+ uint32_t total_bytes_delay) override; |
+ void OnError(chromecast::CastAudioOutputStream* stream) override; |
+ void OnClose() override; |
+ |
+ private: |
+ // Calls to media::AudioOutputStream interface will be forwarded here. |
+ chromecast::CastAudioOutputStream* output_stream_; |
byungchul
2015/04/27 17:38:06
* const
slan
2015/04/28 00:11:38
Done.
|
+ |
+ // Calls to chromecast::AudioSourceCallback interface will be forwarded here. |
+ media::AudioOutputStream::AudioSourceCallback* callback_; |
+ |
+ // The parameters describing the stream. |
+ chromecast::AudioParameters params_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ChromecastDeviceAudioOutputStream); |
+}; |
+ |
+} // namespace chromecast |
+ |
+#endif // CHROMECAST_MEDIA_AUDIO_CHROMECAST_DEVICE_AUDIO_OUTPUT_STREAM_H_ |