| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
| 13 #include "base/sync_socket.h" | 13 #include "base/sync_socket.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
| 16 #include "media/audio/audio_input_ipc.h" | 16 #include "media/audio/audio_input_ipc.h" |
| 17 #include "media/audio/audio_output_ipc.h" | 17 #include "media/audio/audio_output_ipc.h" |
| 18 #include "media/base/ipc/media_param_traits.h" | 18 #include "media/base/ipc/media_param_traits.h" |
| 19 #include "media/gpu/ipc/common/media_param_traits.h" | 19 #include "media/gpu/ipc/common/media_param_traits.h" |
| 20 #include "url/origin.h" | 20 #include "url/origin.h" |
| 21 | 21 |
| 22 #undef IPC_MESSAGE_EXPORT | 22 #undef IPC_MESSAGE_EXPORT |
| 23 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 23 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 24 #define IPC_MESSAGE_START AudioMsgStart | 24 #define IPC_MESSAGE_START AudioMsgStart |
| 25 | 25 |
| 26 IPC_ENUM_TRAITS_MAX_VALUE(media::AudioInputIPCDelegateState, | |
| 27 media::AUDIO_INPUT_IPC_DELEGATE_STATE_LAST) | |
| 28 | |
| 29 IPC_ENUM_TRAITS_MAX_VALUE(media::OutputDeviceStatus, | 26 IPC_ENUM_TRAITS_MAX_VALUE(media::OutputDeviceStatus, |
| 30 media::OUTPUT_DEVICE_STATUS_MAX) | 27 media::OUTPUT_DEVICE_STATUS_MAX) |
| 31 | 28 |
| 32 IPC_STRUCT_BEGIN(AudioInputHostMsg_CreateStream_Config) | 29 IPC_STRUCT_BEGIN(AudioInputHostMsg_CreateStream_Config) |
| 33 IPC_STRUCT_MEMBER(media::AudioParameters, params) | 30 IPC_STRUCT_MEMBER(media::AudioParameters, params) |
| 34 IPC_STRUCT_MEMBER(bool, automatic_gain_control) | 31 IPC_STRUCT_MEMBER(bool, automatic_gain_control) |
| 35 IPC_STRUCT_MEMBER(uint32_t, shared_memory_count) | 32 IPC_STRUCT_MEMBER(uint32_t, shared_memory_count) |
| 36 IPC_STRUCT_END() | 33 IPC_STRUCT_END() |
| 37 | 34 |
| 38 // Messages sent from the browser to the renderer. | 35 // Messages sent from the browser to the renderer. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 67 base::SharedMemoryHandle /* handle */, | 64 base::SharedMemoryHandle /* handle */, |
| 68 base::SyncSocket::TransitDescriptor /* socket descriptor */, | 65 base::SyncSocket::TransitDescriptor /* socket descriptor */, |
| 69 uint32_t /* length */, | 66 uint32_t /* length */, |
| 70 uint32_t /* segment count */) | 67 uint32_t /* segment count */) |
| 71 | 68 |
| 72 // Notification message sent from AudioRendererHost to renderer for state | 69 // Notification message sent from AudioRendererHost to renderer for state |
| 73 // update on error. | 70 // update on error. |
| 74 IPC_MESSAGE_CONTROL1(AudioMsg_NotifyStreamError, int /* stream id */) | 71 IPC_MESSAGE_CONTROL1(AudioMsg_NotifyStreamError, int /* stream id */) |
| 75 | 72 |
| 76 // Notification message sent from browser to renderer for state update. | 73 // Notification message sent from browser to renderer for state update. |
| 77 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamStateChanged, | 74 IPC_MESSAGE_CONTROL1(AudioInputMsg_NotifyStreamError, int /* stream id */) |
| 78 int /* stream id */, | |
| 79 media::AudioInputIPCDelegateState /* new state */) | |
| 80 | |
| 81 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamVolume, | |
| 82 int /* stream id */, | |
| 83 double /* volume */) | |
| 84 | 75 |
| 85 // Messages sent from the renderer to the browser. | 76 // Messages sent from the renderer to the browser. |
| 86 | 77 |
| 87 // Message sent to the browser to request the use of an audio output | 78 // Message sent to the browser to request the use of an audio output |
| 88 // device. |render_frame_id| is the routing ID for the RenderFrame producing | 79 // device. |render_frame_id| is the routing ID for the RenderFrame producing |
| 89 // the audio data. | 80 // the audio data. |
| 90 IPC_MESSAGE_CONTROL5(AudioHostMsg_RequestDeviceAuthorization, | 81 IPC_MESSAGE_CONTROL5(AudioHostMsg_RequestDeviceAuthorization, |
| 91 int /* stream_id */, | 82 int /* stream_id */, |
| 92 int /* render_frame_id */, | 83 int /* render_frame_id */, |
| 93 int /* session_id */, | 84 int /* session_id */, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Set audio volume of the stream specified by stream_id. | 123 // Set audio volume of the stream specified by stream_id. |
| 133 // TODO(hclam): change this to vector if we have channel numbers other than 2. | 124 // TODO(hclam): change this to vector if we have channel numbers other than 2. |
| 134 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume, | 125 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume, |
| 135 int /* stream_id */, | 126 int /* stream_id */, |
| 136 double /* volume */) | 127 double /* volume */) |
| 137 | 128 |
| 138 // Set audio volume of the input stream specified by stream_id. | 129 // Set audio volume of the input stream specified by stream_id. |
| 139 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, | 130 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, |
| 140 int /* stream_id */, | 131 int /* stream_id */, |
| 141 double /* volume */) | 132 double /* volume */) |
| OLD | NEW |