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> |
(...skipping 28 matching lines...) Expand all Loading... |
39 MEDIA_LOOPBACK_AUDIO_CAPTURE, | 39 MEDIA_LOOPBACK_AUDIO_CAPTURE, |
40 | 40 |
41 NUM_MEDIA_TYPES | 41 NUM_MEDIA_TYPES |
42 }; | 42 }; |
43 | 43 |
44 // Types of media stream requests that can be made to the media controller. | 44 // Types of media stream requests that can be made to the media controller. |
45 enum MediaStreamRequestType { | 45 enum MediaStreamRequestType { |
46 MEDIA_DEVICE_ACCESS = 0, | 46 MEDIA_DEVICE_ACCESS = 0, |
47 MEDIA_GENERATE_STREAM, | 47 MEDIA_GENERATE_STREAM, |
48 MEDIA_ENUMERATE_DEVICES, | 48 MEDIA_ENUMERATE_DEVICES, |
49 MEDIA_OPEN_DEVICE | 49 MEDIA_OPEN_DEVICE // Only used in requests made by Pepper. |
50 }; | 50 }; |
51 | 51 |
52 // Facing mode for video capture. | 52 // Facing mode for video capture. |
53 enum VideoFacingMode { | 53 enum VideoFacingMode { |
54 MEDIA_VIDEO_FACING_NONE = 0, | 54 MEDIA_VIDEO_FACING_NONE = 0, |
55 MEDIA_VIDEO_FACING_USER, | 55 MEDIA_VIDEO_FACING_USER, |
56 MEDIA_VIDEO_FACING_ENVIRONMENT, | 56 MEDIA_VIDEO_FACING_ENVIRONMENT, |
57 MEDIA_VIDEO_FACING_LEFT, | 57 MEDIA_VIDEO_FACING_LEFT, |
58 MEDIA_VIDEO_FACING_RIGHT, | 58 MEDIA_VIDEO_FACING_RIGHT, |
59 | 59 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Contains the device properties of the capture device. | 157 // Contains the device properties of the capture device. |
158 AudioDeviceParameters input; | 158 AudioDeviceParameters input; |
159 | 159 |
160 // If the capture device has an associated output device (e.g. headphones), | 160 // If the capture device has an associated output device (e.g. headphones), |
161 // this will contain the properties for the output device. If no such device | 161 // this will contain the properties for the output device. If no such device |
162 // exists (e.g. webcam w/mic), then the value of this member will be all | 162 // exists (e.g. webcam w/mic), then the value of this member will be all |
163 // zeros. | 163 // zeros. |
164 AudioDeviceParameters matched_output; | 164 AudioDeviceParameters matched_output; |
165 }; | 165 }; |
166 | 166 |
167 typedef std::vector<MediaStreamDevice> MediaStreamDevices; | 167 class CONTENT_EXPORT MediaStreamDevices |
| 168 : public std::vector<MediaStreamDevice> { |
| 169 public: |
| 170 MediaStreamDevices(); |
| 171 MediaStreamDevices(size_t count, const MediaStreamDevice& value); |
| 172 |
| 173 // Looks for a MediaStreamDevice based on its ID. |
| 174 // Returns NULL if not found. |
| 175 const MediaStreamDevice* FindById(const std::string& device_id) const; |
| 176 }; |
168 | 177 |
169 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap; | 178 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap; |
170 | 179 |
171 // Represents a request for media streams (audio/video). | 180 // Represents a request for media streams (audio/video). |
172 // TODO(vrk): Decouple MediaStreamDevice from this header file so that | 181 // TODO(vrk): Decouple MediaStreamDevice from this header file so that |
173 // media_stream_options.h no longer depends on this file. | 182 // media_stream_options.h no longer depends on this file. |
174 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between | 183 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between |
175 // vanilla WebRTC, Tab Capture, and Pepper Video Capture. Right now there is | 184 // vanilla WebRTC, Tab Capture, and Pepper Video Capture. Right now there is |
176 // Tab-only stuff and Pepper-only stuff being passed around to all clients, | 185 // Tab-only stuff and Pepper-only stuff being passed around to all clients, |
177 // which is icky. | 186 // which is icky. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 254 |
246 // Callback used return results of media access requests. | 255 // Callback used return results of media access requests. |
247 typedef base::Callback<void( | 256 typedef base::Callback<void( |
248 const MediaStreamDevices& devices, | 257 const MediaStreamDevices& devices, |
249 content::MediaStreamRequestResult result, | 258 content::MediaStreamRequestResult result, |
250 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; | 259 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; |
251 | 260 |
252 } // namespace content | 261 } // namespace content |
253 | 262 |
254 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 263 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
OLD | NEW |