OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Low-latency audio rendering unit utilizing audio output stream provided | 5 // Low-latency audio rendering unit utilizing audio output stream provided |
6 // by browser process through IPC. | 6 // by browser process through IPC. |
7 // | 7 // |
8 // Relationship of classes. | 8 // Relationship of classes. |
9 // | 9 // |
10 // AudioOutputController AudioDevice | 10 // AudioOutputController AudioDevice |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ | 52 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ |
53 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ | 53 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ |
54 #pragma once | 54 #pragma once |
55 | 55 |
56 #include <vector> | 56 #include <vector> |
57 | 57 |
58 #include "base/basictypes.h" | 58 #include "base/basictypes.h" |
59 #include "base/memory/scoped_ptr.h" | 59 #include "base/memory/scoped_ptr.h" |
60 #include "base/shared_memory.h" | 60 #include "base/shared_memory.h" |
61 #include "base/threading/simple_thread.h" | 61 #include "base/threading/simple_thread.h" |
| 62 #include "content/common/content_export.h" |
62 #include "content/renderer/media/audio_message_filter.h" | 63 #include "content/renderer/media/audio_message_filter.h" |
63 | 64 |
64 struct AudioParameters; | 65 struct AudioParameters; |
65 | 66 |
66 class AudioDevice | 67 class CONTENT_EXPORT AudioDevice |
67 : public AudioMessageFilter::Delegate, | 68 : public AudioMessageFilter::Delegate, |
68 public base::DelegateSimpleThread::Delegate, | 69 public base::DelegateSimpleThread::Delegate, |
69 public base::RefCountedThreadSafe<AudioDevice> { | 70 public base::RefCountedThreadSafe<AudioDevice> { |
70 public: | 71 public: |
71 class RenderCallback { | 72 class RenderCallback { |
72 public: | 73 public: |
73 virtual void Render(const std::vector<float*>& audio_data, | 74 virtual void Render(const std::vector<float*>& audio_data, |
74 size_t number_of_frames, | 75 size_t number_of_frames, |
75 size_t audio_delay_milliseconds) = 0; | 76 size_t audio_delay_milliseconds) = 0; |
76 protected: | 77 protected: |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 169 |
169 // Data transfer between browser and render process uses a combination | 170 // Data transfer between browser and render process uses a combination |
170 // of sync sockets and shared memory to provide lowest possible latency. | 171 // of sync sockets and shared memory to provide lowest possible latency. |
171 scoped_ptr<base::SharedMemory> shared_memory_; | 172 scoped_ptr<base::SharedMemory> shared_memory_; |
172 scoped_ptr<base::SyncSocket> socket_; | 173 scoped_ptr<base::SyncSocket> socket_; |
173 | 174 |
174 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioDevice); | 175 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioDevice); |
175 }; | 176 }; |
176 | 177 |
177 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ | 178 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ |
OLD | NEW |