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

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

Issue 12383016: Merge AssociateStreamWithProducer message into CreateStream message for both audio output and input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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 | Annotate | Revision Log
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 "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/media_param_traits.h" 12 #include "content/common/media/media_param_traits.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_input_ipc.h" 15 #include "media/audio/audio_input_ipc.h"
16 #include "media/audio/audio_output_ipc.h" 16 #include "media/audio/audio_output_ipc.h"
17 #include "media/audio/audio_parameters.h" 17 #include "media/audio/audio_parameters.h"
18 18
19 #undef IPC_MESSAGE_EXPORT 19 #undef IPC_MESSAGE_EXPORT
20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
21 #define IPC_MESSAGE_START AudioMsgStart 21 #define IPC_MESSAGE_START AudioMsgStart
22 22
23 IPC_ENUM_TRAITS(media::AudioInputIPCDelegate::State) 23 IPC_ENUM_TRAITS(media::AudioInputIPCDelegate::State)
24 IPC_ENUM_TRAITS(media::AudioOutputIPCDelegate::State) 24 IPC_ENUM_TRAITS(media::AudioOutputIPCDelegate::State)
25 25
26 IPC_STRUCT_BEGIN(AudioInputHostMsg_CreateStream_Config)
27 IPC_STRUCT_MEMBER(media::AudioParameters, params)
28 IPC_STRUCT_MEMBER(bool, automatic_gain_control)
29 IPC_STRUCT_MEMBER(uint32, shared_memory_count)
30 IPC_STRUCT_END()
31
26 // Messages sent from the browser to the renderer. 32 // Messages sent from the browser to the renderer.
27 33
28 // Tell the renderer process that an audio stream has been created. 34 // Tell the renderer process that an audio stream has been created.
29 // The renderer process is given a shared memory handle for the audio data 35 // The renderer process is given a shared memory handle for the audio data
30 // buffer it shares with the browser process. It is also given a SyncSocket that 36 // buffer it shares with the browser process. It is also given a SyncSocket that
31 // it uses to communicate with the browser process about the state of the 37 // it uses to communicate with the browser process about the state of the
32 // buffered audio data. 38 // buffered audio data.
33 #if defined(OS_WIN) 39 #if defined(OS_WIN)
34 IPC_MESSAGE_CONTROL4(AudioMsg_NotifyStreamCreated, 40 IPC_MESSAGE_CONTROL4(AudioMsg_NotifyStreamCreated,
35 int /* stream id */, 41 int /* stream id */,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamStateChanged, 86 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamStateChanged,
81 int /* stream id */, 87 int /* stream id */,
82 media::AudioInputIPCDelegate::State /* new state */) 88 media::AudioInputIPCDelegate::State /* new state */)
83 89
84 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamVolume, 90 IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamVolume,
85 int /* stream id */, 91 int /* stream id */,
86 double /* volume */) 92 double /* volume */)
87 93
88 // Messages sent from the renderer to the browser. 94 // Messages sent from the renderer to the browser.
89 95
90 // Request that got sent to browser for creating an audio output stream 96 // Request that is sent to the browser for creating an audio output stream.
91 IPC_MESSAGE_CONTROL2(AudioHostMsg_CreateStream, 97 // |render_view_id| is the routing ID for the render view producing the audio
98 // data.
99 IPC_MESSAGE_CONTROL3(AudioHostMsg_CreateStream,
92 int /* stream_id */, 100 int /* stream_id */,
101 int /* render_view_id */,
93 media::AudioParameters /* params */) 102 media::AudioParameters /* params */)
94 103
95 // Request that got sent to browser for creating an audio input stream 104 // Request that is sent to the browser for creating an audio input stream.
96 IPC_MESSAGE_CONTROL5(AudioInputHostMsg_CreateStream, 105 // |render_view_id| is the routing ID for the render view consuming the audio
106 // data.
107 IPC_MESSAGE_CONTROL4(AudioInputHostMsg_CreateStream,
97 int /* stream_id */, 108 int /* stream_id */,
109 int /* render_view_id */,
98 int /* session_id */, 110 int /* session_id */,
99 media::AudioParameters /* params */, 111 AudioInputHostMsg_CreateStream_Config)
100 bool /* automatic_gain_control */,
101 uint32 /* shared memory count */)
102
103 // Indicate that audio for a stream is produced by the specified render view.
104 IPC_MESSAGE_CONTROL2(AudioHostMsg_AssociateStreamWithProducer,
105 int /* stream_id */,
106 int /* render_view_id */)
107
108 // Indicate that audio for a stream is consumed by the specified render view.
109 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_AssociateStreamWithConsumer,
110 int /* stream_id */,
111 int /* render_view_id */)
112 112
113 // Start buffering and play the audio stream specified by stream_id. 113 // Start buffering and play the audio stream specified by stream_id.
114 IPC_MESSAGE_CONTROL1(AudioHostMsg_PlayStream, 114 IPC_MESSAGE_CONTROL1(AudioHostMsg_PlayStream,
115 int /* stream_id */) 115 int /* stream_id */)
116 116
117 // Start recording the audio input stream specified by stream_id. 117 // Start recording the audio input stream specified by stream_id.
118 IPC_MESSAGE_CONTROL1(AudioInputHostMsg_RecordStream, 118 IPC_MESSAGE_CONTROL1(AudioInputHostMsg_RecordStream,
119 int /* stream_id */) 119 int /* stream_id */)
120 120
121 // Pause the audio stream specified by stream_id. 121 // Pause the audio stream specified by stream_id.
(...skipping 11 matching lines...) Expand all
133 // Set audio volume of the stream specified by stream_id. 133 // Set audio volume of the stream specified by stream_id.
134 // TODO(hclam): change this to vector if we have channel numbers other than 2. 134 // TODO(hclam): change this to vector if we have channel numbers other than 2.
135 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume, 135 IPC_MESSAGE_CONTROL2(AudioHostMsg_SetVolume,
136 int /* stream_id */, 136 int /* stream_id */,
137 double /* volume */) 137 double /* volume */)
138 138
139 // Set audio volume of the input stream specified by stream_id. 139 // Set audio volume of the input stream specified by stream_id.
140 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume, 140 IPC_MESSAGE_CONTROL2(AudioInputHostMsg_SetVolume,
141 int /* stream_id */, 141 int /* stream_id */,
142 double /* volume */) 142 double /* volume */)
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/audio_renderer_host_unittest.cc ('k') | content/content_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698