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

Unified Diff: content/browser/renderer_host/media/audio_stream_registry.h

Issue 2578983003: Add AudioStreamRegistry. Move stream counting logic (Closed)
Patch Set: Thread checks. Created 3 years, 11 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_stream_registry.h
diff --git a/content/browser/renderer_host/media/audio_stream_registry.h b/content/browser/renderer_host/media/audio_stream_registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..f6a97efc78439e93919ec0f26d7b7778bac616c3
--- /dev/null
+++ b/content/browser/renderer_host/media/audio_stream_registry.h
@@ -0,0 +1,46 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_STREAM_REGISTRY_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_STREAM_REGISTRY_H_
+
+#include "media/media_features.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace content {
+
+// This class tracks all the input and output streams and enables stream
+// counting and debug recording controll for the RenderProcessHost. Methods
+// may only be called on the IO thread.
+class AudioStreamRegistry {
+ public:
+ class Stream {
+ public:
+ virtual ~Stream() {}
+
+#if BUILDFLAG(ENABLE_WEBRTC)
+ // The stream is expected to add a suffix to this file name, making it
+ // unique.
+ virtual void EnableDebugRecording(const base::FilePath& base_file_name) = 0;
+ virtual void DisableDebugRecording() = 0;
+#endif // BUILDFLAG(ENABLE_WEBRTC)
+ };
+
+ virtual ~AudioStreamRegistry() {}
o1ka 2017/01/10 11:47:40 protected?
+
+ // Streams must be removed before destruction.
+ // virtual void RegisterInputStream(Stream* stream) = 0;
+ virtual void RegisterOutputStream(Stream* stream) = 0;
+ // virtual void DeregisterInputStream(Stream* stream) = 0;
+ virtual void DeregisterOutputStream(Stream* stream) = 0;
+
+ virtual void OutputStreamStateChanged(Stream* stream, bool playing) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_STREAM_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698