| 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 // IPC messages for the audio. | 5 // IPC messages for the audio. |
| 6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/sync_socket.h" | 10 #include "base/sync_socket.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 IPC_STRUCT_MEMBER(uint32, shared_memory_count) | 32 IPC_STRUCT_MEMBER(uint32, shared_memory_count) |
| 33 IPC_STRUCT_END() | 33 IPC_STRUCT_END() |
| 34 | 34 |
| 35 // Messages sent from the browser to the renderer. | 35 // Messages sent from the browser to the renderer. |
| 36 | 36 |
| 37 // Tell the renderer process that an audio stream has been created. | 37 // Tell the renderer process that an audio stream has been created. |
| 38 // The renderer process is given a shared memory handle for the audio data | 38 // The renderer process is given a shared memory handle for the audio data |
| 39 // buffer it shares with the browser process. It is also given a SyncSocket that | 39 // buffer it shares with the browser process. It is also given a SyncSocket that |
| 40 // it uses to communicate with the browser process about the state of the | 40 // it uses to communicate with the browser process about the state of the |
| 41 // buffered audio data. | 41 // buffered audio data. |
| 42 #if defined(OS_WIN) | |
| 43 IPC_MESSAGE_CONTROL4(AudioMsg_NotifyStreamCreated, | 42 IPC_MESSAGE_CONTROL4(AudioMsg_NotifyStreamCreated, |
| 44 int /* stream id */, | 43 int /* stream id */, |
| 45 base::SharedMemoryHandle /* handle */, | 44 base::SharedMemoryHandle /* handle */, |
| 46 base::SyncSocket::Handle /* socket handle */, | 45 base::SyncSocket::TransitDescriptor /* socket handle */, |
| 47 uint32 /* length */) | 46 uint32 /* length */) |
| 48 #else | |
| 49 IPC_MESSAGE_CONTROL4(AudioMsg_NotifyStreamCreated, | |
| 50 int /* stream id */, | |
| 51 base::SharedMemoryHandle /* handle */, | |
| 52 base::FileDescriptor /* socket handle */, | |
| 53 uint32 /* length */) | |
| 54 #endif | |
| 55 | 47 |
| 56 // Tell the renderer process that an audio input stream has been created. | 48 // Tell the renderer process that an audio input stream has been created. |
| 57 // The renderer process would be given a SyncSocket that it should read | 49 // The renderer process would be given a SyncSocket that it should read |
| 58 // from from then on. It is also given number of segments in shared memory. | 50 // from from then on. It is also given number of segments in shared memory. |
| 59 #if defined(OS_WIN) | |
| 60 IPC_MESSAGE_CONTROL5(AudioInputMsg_NotifyStreamCreated, | 51 IPC_MESSAGE_CONTROL5(AudioInputMsg_NotifyStreamCreated, |
| 61 int /* stream id */, | 52 int /* stream id */, |
| 62 base::SharedMemoryHandle /* handle */, | 53 base::SharedMemoryHandle /* handle */, |
| 63 base::SyncSocket::Handle /* socket handle */, | 54 base::SyncSocket::TransitDescriptor /* socket handle */, |
| 64 uint32 /* length */, | 55 uint32 /* length */, |
| 65 uint32 /* segment count */) | 56 uint32 /* segment count */) |
| 66 #else | |
| 67 IPC_MESSAGE_CONTROL5(AudioInputMsg_NotifyStreamCreated, | |
| 68 int /* stream id */, | |
| 69 base::SharedMemoryHandle /* handle */, | |
| 70 base::FileDescriptor /* socket handle */, | |
| 71 uint32 /* length */, | |
| 72 uint32 /* segment count */) | |
| 73 #endif | |
| 74 | 57 |
| 75 // Notification message sent from AudioRendererHost to renderer after an output | 58 // Notification message sent from AudioRendererHost to renderer after an output |
| 76 // device change has occurred. | 59 // device change has occurred. |
| 77 IPC_MESSAGE_CONTROL3(AudioMsg_NotifyDeviceChanged, | 60 IPC_MESSAGE_CONTROL3(AudioMsg_NotifyDeviceChanged, |
| 78 int /* stream_id */, | 61 int /* stream_id */, |
| 79 int /* new_buffer_size */, | 62 int /* new_buffer_size */, |
| 80 int /* new_sample_rate */) | 63 int /* new_sample_rate */) |
| 81 | 64 |
| 82 // Notification message sent from AudioRendererHost to renderer for state | 65 // Notification message sent from AudioRendererHost to renderer for state |
| 83 // update after the renderer has requested a Create/Start/Close. | 66 // update after the renderer has requested a Create/Start/Close. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Set audio volume of the stream specified by stream_id. | 121 // Set audio volume of the stream specified by stream_id. |
| 139 // TODO(hclam): change this to vector if we have channel numbers other than 2. | 122 // TODO(hclam): change this to vector if we have channel numbers other than 2. |
| 140 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume, | 123 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume, |
| 141 int /* stream_id */, | 124 int /* stream_id */, |
| 142 double /* volume */) | 125 double /* volume */) |
| 143 | 126 |
| 144 // Set audio volume of the input stream specified by stream_id. | 127 // Set audio volume of the input stream specified by stream_id. |
| 145 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, | 128 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, |
| 146 int /* stream_id */, | 129 int /* stream_id */, |
| 147 double /* volume */) | 130 double /* volume */) |
| OLD | NEW |