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 #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 Loading... |
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 // TODO(ajm): Remove this type and use media::AudioParameters directly. |
129 AudioDeviceParameters() | 130 struct CONTENT_EXPORT AudioDeviceParameters { |
130 : sample_rate(), channel_layout(), frames_per_buffer(), effects() { | 131 AudioDeviceParameters(); |
131 } | 132 AudioDeviceParameters(int sample_rate, |
| 133 int channel_layout, |
| 134 int frames_per_buffer); |
132 | 135 |
133 AudioDeviceParameters(int sample_rate, int channel_layout, | 136 ~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 | 137 |
141 // Preferred sample rate in samples per second for the device. | 138 // Preferred sample rate in samples per second for the device. |
142 int sample_rate; | 139 int sample_rate; |
143 | 140 |
144 // Preferred channel configuration for the device. | 141 // Preferred channel configuration for the device. |
145 // TODO(henrika): ideally, we would like to use media::ChannelLayout here | 142 // TODO(henrika): ideally, we would like to use media::ChannelLayout here |
146 // but including media/base/channel_layout.h violates checkdeps rules. | 143 // but including media/base/channel_layout.h violates checkdeps rules. |
147 int channel_layout; | 144 int channel_layout; |
148 | 145 |
149 // Preferred number of frames per buffer for the device. This is filled | 146 // 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 | 147 // in on the browser side and can be used by the renderer to match the |
151 // expected browser side settings and avoid unnecessary buffering. | 148 // expected browser side settings and avoid unnecessary buffering. |
152 // See media::AudioParameters for more. | 149 // See media::AudioParameters for more. |
153 int frames_per_buffer; | 150 int frames_per_buffer; |
154 | 151 |
155 // See media::AudioParameters::PlatformEffectsMask. | 152 // See media::AudioParameters::PlatformEffectsMask. |
156 int effects; | 153 int effects; |
| 154 |
| 155 std::vector<media::Point> mic_positions; |
157 }; | 156 }; |
158 | 157 |
159 // These below two member variables are valid only when the type of device is | 158 // These below two member variables are valid only when the type of device is |
160 // audio (i.e. IsAudioInputMediaType returns true). | 159 // audio (i.e. IsAudioInputMediaType returns true). |
161 | 160 |
162 // Contains the device properties of the capture device. | 161 // Contains the device properties of the capture device. |
163 AudioDeviceParameters input; | 162 AudioDeviceParameters input; |
164 | 163 |
165 // If the capture device has an associated output device (e.g. headphones), | 164 // 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 | 165 // 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 Loading... |
259 | 258 |
260 // Callback used return results of media access requests. | 259 // Callback used return results of media access requests. |
261 typedef base::Callback<void( | 260 typedef base::Callback<void( |
262 const MediaStreamDevices& devices, | 261 const MediaStreamDevices& devices, |
263 content::MediaStreamRequestResult result, | 262 content::MediaStreamRequestResult result, |
264 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; | 263 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; |
265 | 264 |
266 } // namespace content | 265 } // namespace content |
267 | 266 |
268 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 267 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
OLD | NEW |