OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
7 | 7 |
8 #include "base/file_descriptor_posix.h" | 8 #include "base/file_descriptor_posix.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "base/sync_socket.h" | 10 #include "base/sync_socket.h" |
11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "media/audio/audio_output_controller.h" | 13 #include "media/audio/audio_output_controller.h" |
14 #include "media/base/audio_bus.h" | 14 #include "media/base/audio_bus.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class SharedMemory; | 17 class SharedMemory; |
18 } | 18 } |
19 | 19 |
| 20 namespace content { |
| 21 |
20 // A AudioOutputController::SyncReader implementation using SyncSocket. This | 22 // A AudioOutputController::SyncReader implementation using SyncSocket. This |
21 // is used by AudioOutputController to provide a low latency data source for | 23 // is used by AudioOutputController to provide a low latency data source for |
22 // transmitting audio packets between the browser process and the renderer | 24 // transmitting audio packets between the browser process and the renderer |
23 // process. | 25 // process. |
24 class AudioSyncReader : public media::AudioOutputController::SyncReader { | 26 class AudioSyncReader : public media::AudioOutputController::SyncReader { |
25 public: | 27 public: |
26 AudioSyncReader(base::SharedMemory* shared_memory, | 28 AudioSyncReader(base::SharedMemory* shared_memory, |
27 const media::AudioParameters& params, | 29 const media::AudioParameters& params, |
28 int input_channels); | 30 int input_channels); |
29 | 31 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 64 |
63 // Shared memory wrapper used for transferring audio data from Read() callers. | 65 // Shared memory wrapper used for transferring audio data from Read() callers. |
64 scoped_ptr<media::AudioBus> input_bus_; | 66 scoped_ptr<media::AudioBus> input_bus_; |
65 | 67 |
66 // Maximum amount of audio data which can be transferred in one Read() call. | 68 // Maximum amount of audio data which can be transferred in one Read() call. |
67 int packet_size_; | 69 int packet_size_; |
68 | 70 |
69 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); | 71 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); |
70 }; | 72 }; |
71 | 73 |
| 74 } // namespace content |
| 75 |
72 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 76 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
OLD | NEW |