Chromium Code Reviews| Index: content/renderer/media/audio_output_ipc.h |
| diff --git a/content/renderer/media/audio_output_ipc.h b/content/renderer/media/audio_output_ipc.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..46be8910d83c84f5ab240d0765dca276fab94347 |
| --- /dev/null |
| +++ b/content/renderer/media/audio_output_ipc.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 |
| +// 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_H_ |
| +#define CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_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 AudioOutputIPC |
|
tommi (sloooow) - chröme
2012/07/31 10:52:41
I don't think it's a good idea to call this class
sail
2012/07/31 22:02:08
Done.
|
| + : public NON_EXPORTED_BASE(media::AudioOutputIPC) { |
| + public: |
| + explicit AudioOutputIPC(int render_view_id); |
| + virtual ~AudioOutputIPC(); |
| + |
| + // 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(AudioOutputIPC); |
| +}; |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_H_ |