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

Unified Diff: chromecast/media/audio/audio_output_stream.h

Issue 1308153005: [Chromecast] Plumbs raw audio through CMA backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed default sample rate Created 5 years, 3 months 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: chromecast/media/audio/audio_output_stream.h
diff --git a/chromecast/media/audio/audio_output_stream.h b/chromecast/media/audio/audio_output_stream.h
new file mode 100644
index 0000000000000000000000000000000000000000..f9d6bf10a134b1760a6c6803d37a122176eaa91f
--- /dev/null
+++ b/chromecast/media/audio/audio_output_stream.h
@@ -0,0 +1,60 @@
+// 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_AUDIO_OUTPUT_STREAM_H_
+#define CHROMECAST_MEDIA_AUDIO_AUDIO_OUTPUT_STREAM_H_
+
+#include "base/memory/weak_ptr.h"
+#include "chromecast/public/media/media_component_device.h"
+#include "media/audio/audio_io.h"
+#include "media/audio/audio_parameters.h"
+
+namespace media {
+class FakeAudioWorker;
+} // namespace media
+
+namespace chromecast {
+namespace media {
+
+class AudioManager;
+class MediaPipelineBackend;
+
+class AudioOutputStream : public ::media::AudioOutputStream {
alokp 2015/09/18 21:42:15 Should we rename this to CastAudioOutputStream too
+ public:
+ AudioOutputStream(const ::media::AudioParameters& audio_params,
+ AudioManager* audio_manager);
+ ~AudioOutputStream() override;
+
+ // ::media::AudioOutputStream implementation.
+ bool Open() override;
+ void Close() override;
+ void Start(AudioSourceCallback* source_callback) override;
+ void Stop() override;
+ void SetVolume(double volume) override;
+ void GetVolume(double* volume) override;
+
+ private:
+ // Task to push frame into audio pipeline device.
+ void PushFrame(AudioSourceCallback* source_callback);
+ void OnPushFrameStatus(AudioSourceCallback* source_callback,
+ MediaComponentDevice::FrameStatus status);
+ void OnPushFrameError(AudioSourceCallback* source_callback);
+
+ ::media::AudioParameters audio_params_;
+ AudioManager* audio_manager_;
+
+ double volume_;
+ bool audio_device_busy_;
+ scoped_ptr<::media::FakeAudioWorker> audio_worker_;
+ scoped_ptr<::media::AudioBus> audio_bus_;
+ scoped_ptr<MediaPipelineBackend> media_pipeline_backend_;
+
+ base::WeakPtrFactory<AudioOutputStream> weak_factory_;
+ DISALLOW_COPY_AND_ASSIGN(AudioOutputStream);
gunsch 2015/09/18 21:23:07 nit: #include "base/macros.h"
alokp 2015/09/18 21:42:15 Done.
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_MEDIA_AUDIO_AUDIO_OUTPUT_STREAM_H_

Powered by Google App Engine
This is Rietveld 408576698