Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: content/common/media/audio_messages.h

Issue 1122393004: Add support for switching the audio output device for HTMLMediaElements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to MediaPlayers so that they invoke callbacks in the correct threads. First complete implem… Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string>
9
8 #include "base/basictypes.h" 10 #include "base/basictypes.h"
9 #include "base/memory/shared_memory.h" 11 #include "base/memory/shared_memory.h"
10 #include "base/sync_socket.h" 12 #include "base/sync_socket.h"
11 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
12 #include "content/common/media/media_param_traits.h" 14 #include "content/common/media/media_param_traits.h"
13 #include "ipc/ipc_message_macros.h" 15 #include "ipc/ipc_message_macros.h"
14 #include "media/audio/audio_input_ipc.h" 16 #include "media/audio/audio_input_ipc.h"
15 #include "media/audio/audio_output_ipc.h" 17 #include "media/audio/audio_output_ipc.h"
16 #include "media/audio/audio_parameters.h" 18 #include "media/audio/audio_parameters.h"
19 #include "url/gurl.h"
17 20
18 #undef IPC_MESSAGE_EXPORT 21 #undef IPC_MESSAGE_EXPORT
19 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 22 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
20 #define IPC_MESSAGE_START AudioMsgStart 23 #define IPC_MESSAGE_START AudioMsgStart
21 24
22 IPC_ENUM_TRAITS_MAX_VALUE(media::AudioInputIPCDelegate::State, 25 IPC_ENUM_TRAITS_MAX_VALUE(media::AudioInputIPCDelegate::State,
23 media::AudioInputIPCDelegate::kStateLast) 26 media::AudioInputIPCDelegate::kStateLast)
24 27
25 IPC_ENUM_TRAITS_MAX_VALUE(media::AudioOutputIPCDelegate::State, 28 IPC_ENUM_TRAITS_MAX_VALUE(media::AudioOutputIPCDelegate::State,
26 media::AudioOutputIPCDelegate::kStateLast) 29 media::AudioOutputIPCDelegate::kStateLast)
27 30
31 IPC_ENUM_TRAITS_MAX_VALUE(
32 media::AudioOutputIPCDelegate::DeviceSwitchResult,
33 media::AudioOutputIPCDelegate::kDeviceSwitchResultLast)
34
28 IPC_STRUCT_BEGIN(AudioInputHostMsg_CreateStream_Config) 35 IPC_STRUCT_BEGIN(AudioInputHostMsg_CreateStream_Config)
29 IPC_STRUCT_MEMBER(media::AudioParameters, params) 36 IPC_STRUCT_MEMBER(media::AudioParameters, params)
30 IPC_STRUCT_MEMBER(bool, automatic_gain_control) 37 IPC_STRUCT_MEMBER(bool, automatic_gain_control)
31 IPC_STRUCT_MEMBER(uint32, shared_memory_count) 38 IPC_STRUCT_MEMBER(uint32, shared_memory_count)
32 IPC_STRUCT_END() 39 IPC_STRUCT_END()
33 40
34 // Messages sent from the browser to the renderer. 41 // Messages sent from the browser to the renderer.
35 42
36 // Tell the renderer process that an audio stream has been created. 43 // Tell the renderer process that an audio stream has been created.
37 // The renderer process is given a shared memory handle for the audio data 44 // The renderer process is given a shared memory handle for the audio data
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // Set audio volume of the stream specified by stream_id. 121 // Set audio volume of the stream specified by stream_id.
115 // 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.
116 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume, 123 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume,
117 int /* stream_id */, 124 int /* stream_id */,
118 double /* volume */) 125 double /* volume */)
119 126
120 // Set audio volume of the input stream specified by stream_id. 127 // Set audio volume of the input stream specified by stream_id.
121 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, 128 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume,
122 int /* stream_id */, 129 int /* stream_id */,
123 double /* volume */) 130 double /* volume */)
131
132 // Switch the output device of the stream specified by stream_id.
133 IPC_MESSAGE_CONTROL5(AudioHostMsg_SwitchOutputDevice,
134 int /* stream_id */,
135 std::string /* device_id */,
136 GURL /* security_origin */,
137 int /* render_frame_id */,
138 int /* request_id */)
139
140 // Notification message sent from AudioRendererHost to renderer for state
141 // update after the renderer has requested a SwitchOutputDevice.
142 IPC_MESSAGE_CONTROL3(AudioMsg_NotifyOutputDeviceSwitched,
143 int /* stream id */,
144 int /* request id */,
145 media::AudioOutputIPCDelegate::DeviceSwitchResult /* result */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698