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

Unified Diff: content/browser/renderer_host/media/audio_output_service_impl.cc

Issue 2319493002: Add mojo interface for audio rendering. (Closed)
Patch Set: format Created 4 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: content/browser/renderer_host/media/audio_output_service_impl.cc
diff --git a/content/browser/renderer_host/media/audio_output_service_impl.cc b/content/browser/renderer_host/media/audio_output_service_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..da5416a274737ef8feac9cae3a3c265d29373ce1
--- /dev/null
+++ b/content/browser/renderer_host/media/audio_output_service_impl.cc
@@ -0,0 +1,45 @@
+// Copyright 2016 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.
+
+#include "content/browser/renderer_host/media/audio_output_service_impl.h"
+
+namespace content {
+
+void GetOutputControllers(
+ const RenderProcessHost::GetAudioOutputControllersCallback& callback) {
+ task_runner_->PostTask(DoGetOutputControllers, this, callback);
+}
+
+bool AudioOutputServiceImpl::HasActiveAudio() {
+ return base::AtomicRefCountIsZero(&num_playing_streams);
+}
+
+void AudioOutputServiceImpl::NotifyStreamCreated(BindingId binding) {
+ task_runner_->PostTask(Base::Bind(DoNotifyStreamCreated, this, binding));
+}
+
+void AudioOutputServiceImpl::NotifyStreamStateChanged(BindingId binding) {
+ task_runner_->PostTask(
+ Base::Bind(DoNotifyStreamStateChanged, this, binding, render_frame_id));
+}
+
+void DoGetOutputControllers(
+ const RenderProcessHost::GetAudioOutputControllersCallback& callback) {
+ RenderProcessHost::AudioOutputControllerList list;
+}
+
+void AudioOutputServiceImpl::DoNotifyStreamCreated(BindingId binding) {
+ g_audio_streams_tracker.Get().IncreaseStreamCount();
+ max_simultaneous_streams_ =
+ std::max(bindings_.size(), max_simultaneous_streams_);
+}
+
+void AudioOutputServiceImpl::RegisterStartedStream(BindingId binding);
+{
+ g_audio_streams_tracker.Get().IncreaseStreamCount();
+ if (audio_entries_.size() > max_simultaneous_streams_)
+ max_simultaneous_streams_ = audio_entries_.size();
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698