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 // AudioInputRendererHost serves audio related requests from audio capturer | 5 // AudioInputRendererHost serves audio related requests from audio capturer |
6 // which lives inside the render process and provide access to audio hardware. | 6 // which lives inside the render process and provide access to audio hardware. |
7 // | 7 // |
8 // Create stream sequence (AudioInputController = AIC): | 8 // Create stream sequence (AudioInputController = AIC): |
9 // | 9 // |
10 // AudioInputHostMsg_CreateStream -> OnCreateStream -> AIC::CreateLowLatency -> | 10 // AudioInputHostMsg_CreateStream -> OnCreateStream -> AIC::CreateLowLatency -> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 friend class base::DeleteHelper<AudioInputRendererHost>; | 107 friend class base::DeleteHelper<AudioInputRendererHost>; |
108 | 108 |
109 struct AudioEntry; | 109 struct AudioEntry; |
110 typedef std::map<int, AudioEntry*> AudioEntryMap; | 110 typedef std::map<int, AudioEntry*> AudioEntryMap; |
111 typedef std::map<int, int> SessionEntryMap; | 111 typedef std::map<int, int> SessionEntryMap; |
112 | 112 |
113 virtual ~AudioInputRendererHost(); | 113 virtual ~AudioInputRendererHost(); |
114 | 114 |
115 // Methods called on IO thread ---------------------------------------------- | 115 // Methods called on IO thread ---------------------------------------------- |
116 | 116 |
117 // Audio related IPC message handlers. | |
118 | |
117 // Start the audio input device with the session id. If the device | 119 // Start the audio input device with the session id. If the device |
118 // starts successfully, it will trigger OnDeviceStarted() callback. | 120 // starts successfully, it will trigger OnDeviceStarted() callback. |
119 void OnStartDevice(int stream_id, int session_id); | 121 void OnStartDevice(int stream_id, int session_id); |
120 | 122 |
121 // Audio related IPC message handlers. | 123 // Creates an audio input stream with the specified format whose data is |
122 // Creates an audio input stream with the specified format. If this call is | 124 // consumed by an entity in the render view referenced by |render_view_id|. If |
123 // successful this object would keep an internal entry of the stream for the | 125 // this call is successful this object would keep an internal entry of the |
palmer
2013/03/05 21:09:32
Would keep, or does keep?
How does the caller kno
miu
2013/03/06 22:36:52
Clarified the comment.
| |
124 // required properties. | 126 // stream for the required properties. |
125 void OnCreateStream(int stream_id, | 127 void OnCreateStream(int stream_id, |
128 int render_view_id, | |
126 const media::AudioParameters& params, | 129 const media::AudioParameters& params, |
127 const std::string& device_id, | 130 const std::string& device_id, |
128 bool automatic_gain_control); | 131 bool automatic_gain_control); |
129 | 132 |
130 // Track that the data for the audio stream referenced by |stream_id| is | |
131 // consumed by an entity in the render view referenced by |render_view_id|. | |
132 void OnAssociateStreamWithConsumer(int stream_id, int render_view_id); | |
133 | |
134 // Record the audio input stream referenced by |stream_id|. | 133 // Record the audio input stream referenced by |stream_id|. |
135 void OnRecordStream(int stream_id); | 134 void OnRecordStream(int stream_id); |
136 | 135 |
137 // Close the audio stream referenced by |stream_id|. | 136 // Close the audio stream referenced by |stream_id|. |
138 void OnCloseStream(int stream_id); | 137 void OnCloseStream(int stream_id); |
139 | 138 |
140 // Set the volume of the audio stream referenced by |stream_id|. | 139 // Set the volume of the audio stream referenced by |stream_id|. |
141 void OnSetVolume(int stream_id, double volume); | 140 void OnSetVolume(int stream_id, double volume); |
142 | 141 |
143 // Complete the process of creating an audio input stream. This will set up | 142 // Complete the process of creating an audio input stream. This will set up |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 | 192 |
194 // A map of session IDs to audio session sources. | 193 // A map of session IDs to audio session sources. |
195 SessionEntryMap session_entries_; | 194 SessionEntryMap session_entries_; |
196 | 195 |
197 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); | 196 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); |
198 }; | 197 }; |
199 | 198 |
200 } // namespace content | 199 } // namespace content |
201 | 200 |
202 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ | 201 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ |
OLD | NEW |