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" |
(...skipping 29 matching lines...) Expand all Loading... |
40 bool Init(); | 40 bool Init(); |
41 bool PrepareForeignSocketHandle(base::ProcessHandle process_handle, | 41 bool PrepareForeignSocketHandle(base::ProcessHandle process_handle, |
42 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
43 base::SyncSocket::Handle* foreign_handle); | 43 base::SyncSocket::Handle* foreign_handle); |
44 #else | 44 #else |
45 base::FileDescriptor* foreign_handle); | 45 base::FileDescriptor* foreign_handle); |
46 #endif | 46 #endif |
47 | 47 |
48 private: | 48 private: |
49 base::SharedMemory* shared_memory_; | 49 base::SharedMemory* shared_memory_; |
50 base::Time previous_call_time_; | |
51 | 50 |
52 // Number of input channels for synchronized I/O. | 51 // Number of input channels for synchronized I/O. |
53 int input_channels_; | 52 int input_channels_; |
54 | 53 |
55 // Socket for transmitting audio data. | 54 // Socket for transmitting audio data. |
56 scoped_ptr<base::CancelableSyncSocket> socket_; | 55 scoped_ptr<base::CancelableSyncSocket> socket_; |
57 | 56 |
58 // Socket to be used by the renderer. The reference is released after | 57 // Socket to be used by the renderer. The reference is released after |
59 // PrepareForeignSocketHandle() is called and ran successfully. | 58 // PrepareForeignSocketHandle() is called and ran successfully. |
60 scoped_ptr<base::CancelableSyncSocket> foreign_socket_; | 59 scoped_ptr<base::CancelableSyncSocket> foreign_socket_; |
61 | 60 |
62 // Shared memory wrapper used for transferring audio data to Read() callers. | 61 // Shared memory wrapper used for transferring audio data to Read() callers. |
63 scoped_ptr<media::AudioBus> output_bus_; | 62 scoped_ptr<media::AudioBus> output_bus_; |
64 | 63 |
65 // Shared memory wrapper used for transferring audio data from Read() callers. | 64 // Shared memory wrapper used for transferring audio data from Read() callers. |
66 scoped_ptr<media::AudioBus> input_bus_; | 65 scoped_ptr<media::AudioBus> input_bus_; |
67 | 66 |
68 // Maximum amount of audio data which can be transferred in one Read() call. | 67 // Maximum amount of audio data which can be transferred in one Read() call. |
69 int packet_size_; | 68 int packet_size_; |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); | 70 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); |
72 }; | 71 }; |
73 | 72 |
74 } // namespace content | 73 } // namespace content |
75 | 74 |
76 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 75 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
OLD | NEW |