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

Unified Diff: content/renderer/media/audio_output_client.h

Issue 1896883002: Mojo interfaces needed for switching audio rendering stream creation and closing from IPC to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/renderer/media/audio_output_client.h
diff --git a/content/renderer/media/audio_output_client.h b/content/renderer/media/audio_output_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..3911f8b9e9918af8daca78fd0251370dc0a260a6
--- /dev/null
+++ b/content/renderer/media/audio_output_client.h
@@ -0,0 +1,82 @@
+// 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 CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_CLIENT_H_
+#define CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_CLIENT_H_
+
+#include <map>
+
+#include "base/files/file.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/shared_memory_handle.h"
+#include "base/sync_socket.h"
+#include "base/threading/thread_checker.h"
+#include "content/common/content_export.h"
+#include "media/mojo/interfaces/audio_output.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+}
+
+namespace media {
+class AudioParameters;
+}
+
+namespace content {
+
+class AudioMessageFilter;
+class ServiceRegistry;
+
+
+class CONTENT_EXPORT AudioOutputClient {
+ public:
+ explicit AudioOutputClient(ServiceRegistry* service_registry,
+ AudioMessageFilter* audio_message_filter);
+
+
+ ~AudioOutputClient();
+
+ void CreateStream(int stream_id,
Henrik Grunell 2016/04/19 15:36:09 Add comments to all functions.
rchtara 2016/04/21 09:10:18 Done.
+ int render_frame_id,
+ const media::AudioParameters& params);
+ void CreateStreamOnMainThread(int stream_id,
+ int render_frame_id,
+ const media::AudioParameters& params);
+ void CreateStreamCallback(mojom::AudioOutputStreamPtr stream,
+ int stream_id,
+ mojo::ScopedSharedBufferHandle shared_buffer,
+ mojo::ScopedHandle socket_descriptor);
+ void CreateStreamOnIOThread(
+ mojom::AudioOutputStreamPtr* const stream,
+ base::SharedMemoryHandle handle,
+ base::SyncSocket::TransitDescriptor socket_descriptor,
+ uint32_t length);
+
+ void CloseStream(int stream_id);
+ void CloseStreamOnMainThread(int stream_id);
+
+ void OnStreamError(int stream_id);
+ void ReportErrorOnIOThread(int stream_id);
+
+ private:
+ // Mojo connection error handler.
+ void OnConnectionError();
+
+ // The Mojo service for registering observers to listen for enable/disable
+ // events.
+ mojom::AudioOutputPtr service_;
+ std::map<int, scoped_ptr<mojom::AudioOutputStreamPtr>> streams_;
+
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
+ AudioMessageFilter* audio_message_filter_;
Henrik Grunell 2016/04/19 15:36:09 How is it guaranteed that the filter outlives this
rchtara 2016/04/21 09:10:18 I will replace it by scoped_refptr<AudioMessageFil
+ DISALLOW_COPY_AND_ASSIGN(AudioOutputClient);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698