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

Side by Side Diff: content/public/common/media_stream_request.h

Issue 1275783003: Add a virtual beamforming audio device on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mcasas comments Created 5 years, 3 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 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
16 #include "media/audio/audio_parameters.h"
16 #include "ui/gfx/native_widget_types.h" 17 #include "ui/gfx/native_widget_types.h"
17 #include "url/gurl.h" 18 #include "url/gurl.h"
18 19
19 namespace content { 20 namespace content {
20 21
21 // Types of media streams. 22 // Types of media streams.
22 enum MediaStreamType { 23 enum MediaStreamType {
23 MEDIA_NO_SERVICE = 0, 24 MEDIA_NO_SERVICE = 0,
24 25
25 // A device provided by the operating system (e.g., webcam input). 26 // A device provided by the operating system (e.g., webcam input).
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 119
119 // The device id of a matched output device if any (otherwise empty). 120 // The device id of a matched output device if any (otherwise empty).
120 // Only applicable to audio devices. 121 // Only applicable to audio devices.
121 std::string matched_output_device_id; 122 std::string matched_output_device_id;
122 123
123 // The device's "friendly" name. Not guaranteed to be unique. 124 // The device's "friendly" name. Not guaranteed to be unique.
124 std::string name; 125 std::string name;
125 126
126 // Contains properties that match directly with those with the same name 127 // Contains properties that match directly with those with the same name
127 // in media::AudioParameters. 128 // in media::AudioParameters.
128 struct AudioDeviceParameters { 129 struct AudioDeviceParameters {
ajm 2015/09/02 06:47:01 This should probably _be_ a media::AudioParameters
tommi (sloooow) - chröme 2015/09/02 07:43:07 I agree. It's basically a poor man's copy of it.
ajm 2015/09/02 17:00:55 I'll add the TODO.
129 AudioDeviceParameters() 130 AudioDeviceParameters();
130 : sample_rate(), channel_layout(), frames_per_buffer(), effects() { 131 AudioDeviceParameters(int sample_rate,
131 } 132 int channel_layout,
133 int frames_per_buffer);
132 134
133 AudioDeviceParameters(int sample_rate, int channel_layout, 135 ~AudioDeviceParameters();
134 int frames_per_buffer)
135 : sample_rate(sample_rate),
136 channel_layout(channel_layout),
137 frames_per_buffer(frames_per_buffer),
138 effects() {
139 }
140 136
141 // Preferred sample rate in samples per second for the device. 137 // Preferred sample rate in samples per second for the device.
142 int sample_rate; 138 int sample_rate;
143 139
144 // Preferred channel configuration for the device. 140 // Preferred channel configuration for the device.
145 // TODO(henrika): ideally, we would like to use media::ChannelLayout here 141 // TODO(henrika): ideally, we would like to use media::ChannelLayout here
146 // but including media/base/channel_layout.h violates checkdeps rules. 142 // but including media/base/channel_layout.h violates checkdeps rules.
147 int channel_layout; 143 int channel_layout;
148 144
149 // Preferred number of frames per buffer for the device. This is filled 145 // Preferred number of frames per buffer for the device. This is filled
150 // in on the browser side and can be used by the renderer to match the 146 // in on the browser side and can be used by the renderer to match the
151 // expected browser side settings and avoid unnecessary buffering. 147 // expected browser side settings and avoid unnecessary buffering.
152 // See media::AudioParameters for more. 148 // See media::AudioParameters for more.
153 int frames_per_buffer; 149 int frames_per_buffer;
154 150
155 // See media::AudioParameters::PlatformEffectsMask. 151 // See media::AudioParameters::PlatformEffectsMask.
156 int effects; 152 int effects;
153
154 std::vector<media::Point> mic_positions;
157 }; 155 };
158 156
159 // These below two member variables are valid only when the type of device is 157 // These below two member variables are valid only when the type of device is
160 // audio (i.e. IsAudioInputMediaType returns true). 158 // audio (i.e. IsAudioInputMediaType returns true).
161 159
162 // Contains the device properties of the capture device. 160 // Contains the device properties of the capture device.
163 AudioDeviceParameters input; 161 AudioDeviceParameters input;
164 162
165 // If the capture device has an associated output device (e.g. headphones), 163 // If the capture device has an associated output device (e.g. headphones),
166 // this will contain the properties for the output device. If no such device 164 // this will contain the properties for the output device. If no such device
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 257
260 // Callback used return results of media access requests. 258 // Callback used return results of media access requests.
261 typedef base::Callback<void( 259 typedef base::Callback<void(
262 const MediaStreamDevices& devices, 260 const MediaStreamDevices& devices,
263 content::MediaStreamRequestResult result, 261 content::MediaStreamRequestResult result,
264 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; 262 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback;
265 263
266 } // namespace content 264 } // namespace content
267 265
268 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 266 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698