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

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

Issue 1171953002: Add IPC interface for switching the audio output device for a given audio stream in the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix style 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | media/audio/audio_logging.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(media::SwitchOutputDeviceResult,
32 media::SWITCH_OUTPUT_DEVICE_RESULT_LAST)
33
28 IPC_STRUCT_BEGIN(AudioInputHostMsg_CreateStream_Config) 34 IPC_STRUCT_BEGIN(AudioInputHostMsg_CreateStream_Config)
29 IPC_STRUCT_MEMBER(media::AudioParameters, params) 35 IPC_STRUCT_MEMBER(media::AudioParameters, params)
30 IPC_STRUCT_MEMBER(bool, automatic_gain_control) 36 IPC_STRUCT_MEMBER(bool, automatic_gain_control)
31 IPC_STRUCT_MEMBER(uint32, shared_memory_count) 37 IPC_STRUCT_MEMBER(uint32, shared_memory_count)
32 IPC_STRUCT_END() 38 IPC_STRUCT_END()
33 39
34 // Messages sent from the browser to the renderer. 40 // Messages sent from the browser to the renderer.
35 41
36 // Tell the renderer process that an audio stream has been created. 42 // 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 43 // The renderer process is given a shared memory handle for the audio data
(...skipping 26 matching lines...) Expand all
64 70
65 // Notification message sent from browser to renderer for state update. 71 // Notification message sent from browser to renderer for state update.
66 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamStateChanged, 72 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamStateChanged,
67 int /* stream id */, 73 int /* stream id */,
68 media::AudioInputIPCDelegate::State /* new state */) 74 media::AudioInputIPCDelegate::State /* new state */)
69 75
70 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamVolume, 76 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamVolume,
71 int /* stream id */, 77 int /* stream id */,
72 double /* volume */) 78 double /* volume */)
73 79
80 // Notification message sent from AudioRendererHost to renderer for state
81 // update after the renderer has requested a SwitchOutputDevice.
82 IPC_MESSAGE_CONTROL3(AudioMsg_NotifyOutputDeviceSwitched,
83 int /* stream id */,
84 int /* request id */,
85 media::SwitchOutputDeviceResult /* result */)
86
74 // Messages sent from the renderer to the browser. 87 // Messages sent from the renderer to the browser.
75 88
76 // Request that is sent to the browser for creating an audio output stream. 89 // Request that is sent to the browser for creating an audio output stream.
77 // |render_frame_id| is the routing ID for the RenderFrame producing the audio 90 // |render_frame_id| is the routing ID for the RenderFrame producing the audio
78 // data. 91 // data.
79 IPC_MESSAGE_CONTROL4(AudioHostMsg_CreateStream, 92 IPC_MESSAGE_CONTROL4(AudioHostMsg_CreateStream,
80 int /* stream_id */, 93 int /* stream_id */,
81 int /* render_frame_id */, 94 int /* render_frame_id */,
82 int /* session_id */, 95 int /* session_id */,
83 media::AudioParameters /* params */) 96 media::AudioParameters /* params */)
(...skipping 30 matching lines...) Expand all
114 // Set audio volume of the stream specified by stream_id. 127 // 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. 128 // TODO(hclam): change this to vector if we have channel numbers other than 2.
116 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume, 129 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume,
117 int /* stream_id */, 130 int /* stream_id */,
118 double /* volume */) 131 double /* volume */)
119 132
120 // Set audio volume of the input stream specified by stream_id. 133 // Set audio volume of the input stream specified by stream_id.
121 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, 134 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume,
122 int /* stream_id */, 135 int /* stream_id */,
123 double /* volume */) 136 double /* volume */)
137
138 // Switch the output device of the stream specified by stream_id.
139 IPC_MESSAGE_CONTROL5(AudioHostMsg_SwitchOutputDevice,
140 int /* stream_id */,
141 int /* render_frame_id */,
142 std::string /* device_id */,
143 GURL /* security_origin */,
144 int /* request_id */)
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | media/audio/audio_logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698