OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_RENDERER_AUDIO_DEVICE_H_ | 5 #ifndef CONTENT_RENDERER_AUDIO_DEVICE_H_ |
6 #define CHROME_RENDERER_AUDIO_DEVICE_H_ | 6 #define CONTENT_RENDERER_AUDIO_DEVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
14 #include "base/threading/simple_thread.h" | 14 #include "base/threading/simple_thread.h" |
15 #include "chrome/renderer/audio_message_filter.h" | 15 #include "content/renderer/audio_message_filter.h" |
16 | 16 |
17 // Each instance of AudioDevice corresponds to one host stream. | 17 // Each instance of AudioDevice corresponds to one host stream. |
18 // This class is not thread-safe, so its methods must be called from | 18 // This class is not thread-safe, so its methods must be called from |
19 // the same thread. | 19 // the same thread. |
20 class AudioDevice : public AudioMessageFilter::Delegate, | 20 class AudioDevice : public AudioMessageFilter::Delegate, |
21 public base::DelegateSimpleThread::Delegate { | 21 public base::DelegateSimpleThread::Delegate { |
22 public: | 22 public: |
23 class RenderCallback { | 23 class RenderCallback { |
24 public: | 24 public: |
25 virtual void Render(const std::vector<float*>& audio_data, | 25 virtual void Render(const std::vector<float*>& audio_data, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void* shared_memory_data() { return shared_memory()->memory(); } | 74 void* shared_memory_data() { return shared_memory()->memory(); } |
75 | 75 |
76 static scoped_refptr<AudioMessageFilter> filter_; | 76 static scoped_refptr<AudioMessageFilter> filter_; |
77 int32 stream_id_; | 77 int32 stream_id_; |
78 scoped_ptr<base::SharedMemory> shared_memory_; | 78 scoped_ptr<base::SharedMemory> shared_memory_; |
79 scoped_ptr<base::SyncSocket> socket_; | 79 scoped_ptr<base::SyncSocket> socket_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(AudioDevice); | 81 DISALLOW_COPY_AND_ASSIGN(AudioDevice); |
82 }; | 82 }; |
83 | 83 |
84 #endif // CHROME_RENDERER_AUDIO_DEVICE_H_ | 84 #endif // CONTENT_RENDERER_AUDIO_DEVICE_H_ |
OLD | NEW |