Index: content/renderer/media/audio_output_ipc_impl.h |
diff --git a/content/renderer/media/audio_output_ipc_impl.h b/content/renderer/media/audio_output_ipc_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cafc1c9d7b52c8a1e043516c8075e096e59ad08d |
--- /dev/null |
+++ b/content/renderer/media/audio_output_ipc_impl.h |
@@ -0,0 +1,57 @@ |
+// Copyright (c) 2012 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. |
+// |
+// MessageFilter that handles audio messages and delegates them to audio |
scherkus (not reviewing)
2012/08/03 21:12:52
nit: we (media folks) typically have the class doc
|
+// renderers. Created on render thread, AudioMessageFilter is operated on |
+// IO thread (secondary thread of render process) it intercepts audio messages |
+// and process them on IO thread since these messages are time critical. |
+ |
+#ifndef CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_ |
+#define CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_ |
+ |
+#include "base/gtest_prod_util.h" |
+#include "base/id_map.h" |
+#include "base/shared_memory.h" |
+#include "base/sync_socket.h" |
+#include "content/common/content_export.h" |
+#include "ipc/ipc_channel_proxy.h" |
+#include "media/audio/audio_buffers_state.h" |
+#include "media/audio/audio_output_ipc.h" |
+ |
+class AudioMessageFilter; |
+ |
+class CONTENT_EXPORT AudioOutputIPCImpl |
scherkus (not reviewing)
2012/08/03 21:12:52
new classes in content should be under the content
|
+ : public NON_EXPORTED_BASE(media::AudioOutputIPC) { |
+ public: |
+ explicit AudioOutputIPCImpl(int render_view_id); |
+ virtual ~AudioOutputIPCImpl(); |
+ |
+ // media::AudioOutputIPC implementation. |
+ virtual int AddDelegate(media::AudioOutputIPCDelegate* delegate) OVERRIDE; |
+ virtual void RemoveDelegate(int id) OVERRIDE; |
+ virtual void CreateStream(int stream_id, |
+ const media::AudioParameters& params) OVERRIDE; |
+ virtual void PlayStream(int stream_id) OVERRIDE; |
+ virtual void PauseStream(int stream_id) OVERRIDE; |
+ virtual void FlushStream(int stream_id) OVERRIDE; |
+ virtual void CloseStream(int stream_id) OVERRIDE; |
+ virtual void SetVolume(int stream_id, double volume) OVERRIDE; |
+ |
+ private: |
+ |
+ // Sends an IPC message using |filter_|. |
+ bool Send(IPC::Message* message); |
+ |
+ // Cached audio message filter (lives on the main render thread). |
+ scoped_refptr<AudioMessageFilter> filter_; |
+ |
+ // A map of stream ids to delegates. |
+ IDMap<media::AudioOutputIPCDelegate> delegates_; |
+ |
+ const int render_view_id_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AudioOutputIPCImpl); |
+}; |
+ |
+#endif // CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_ |