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/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "base/sync_socket.h" | 10 #include "base/sync_socket.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "content/common/media/audio_stream_state.h" | 12 #include "content/common/media/audio_stream_state.h" |
13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
14 #include "media/audio/audio_buffers_state.h" | 14 #include "media/audio/audio_buffers_state.h" |
15 #include "media/audio/audio_parameters.h" | 15 #include "media/audio/audio_parameters.h" |
16 | 16 |
17 #undef IPC_MESSAGE_EXPORT | 17 #undef IPC_MESSAGE_EXPORT |
18 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 18 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
19 #define IPC_MESSAGE_START AudioMsgStart | 19 #define IPC_MESSAGE_START AudioMsgStart |
20 | 20 |
21 IPC_ENUM_TRAITS(AudioStreamState) | 21 IPC_ENUM_TRAITS(AudioStreamState) |
22 IPC_ENUM_TRAITS(AudioParameters::Format) | |
23 IPC_ENUM_TRAITS(ChannelLayout) | |
24 | 22 |
25 IPC_STRUCT_TRAITS_BEGIN(AudioBuffersState) | 23 IPC_STRUCT_TRAITS_BEGIN(AudioBuffersState) |
26 IPC_STRUCT_TRAITS_MEMBER(pending_bytes) | 24 IPC_STRUCT_TRAITS_MEMBER(pending_bytes) |
27 IPC_STRUCT_TRAITS_MEMBER(hardware_delay_bytes) | 25 IPC_STRUCT_TRAITS_MEMBER(hardware_delay_bytes) |
28 IPC_STRUCT_TRAITS_MEMBER(timestamp) | 26 IPC_STRUCT_TRAITS_MEMBER(timestamp) |
29 IPC_STRUCT_TRAITS_END() | 27 IPC_STRUCT_TRAITS_END() |
30 | 28 |
31 IPC_STRUCT_TRAITS_BEGIN(AudioParameters) | |
32 IPC_STRUCT_TRAITS_MEMBER(format) | |
33 IPC_STRUCT_TRAITS_MEMBER(channel_layout) | |
34 IPC_STRUCT_TRAITS_MEMBER(sample_rate) | |
35 IPC_STRUCT_TRAITS_MEMBER(bits_per_sample) | |
36 IPC_STRUCT_TRAITS_MEMBER(samples_per_packet) | |
37 IPC_STRUCT_TRAITS_MEMBER(channels) | |
38 IPC_STRUCT_TRAITS_END() | |
39 | |
40 // Messages sent from the browser to the renderer. | 29 // Messages sent from the browser to the renderer. |
41 | 30 |
42 // Tell the renderer process that an audio stream has been created. | 31 // Tell the renderer process that an audio stream has been created. |
43 // The renderer process is given a shared memory handle for the audio data | 32 // The renderer process is given a shared memory handle for the audio data |
44 // buffer it shares with the browser process. It is also given a SyncSocket that | 33 // buffer it shares with the browser process. It is also given a SyncSocket that |
45 // it uses to communicate with the browser process about the state of the | 34 // it uses to communicate with the browser process about the state of the |
46 // buffered audio data. | 35 // buffered audio data. |
47 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
48 IPC_MESSAGE_CONTROL4(AudioMsg_NotifyStreamCreated, | 37 IPC_MESSAGE_CONTROL4(AudioMsg_NotifyStreamCreated, |
49 int /* stream id */, | 38 int /* stream id */, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // Set audio volume of the input stream specified by stream_id. | 134 // Set audio volume of the input stream specified by stream_id. |
146 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, | 135 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, |
147 int /* stream_id */, | 136 int /* stream_id */, |
148 double /* volume */) | 137 double /* volume */) |
149 | 138 |
150 // Start the device referenced by the session_id for the input stream specified | 139 // Start the device referenced by the session_id for the input stream specified |
151 // by stream_id. | 140 // by stream_id. |
152 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_StartDevice, | 141 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_StartDevice, |
153 int /* stream_id */, | 142 int /* stream_id */, |
154 int /* session_id */) | 143 int /* session_id */) |
OLD | NEW |