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_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ | 5 #ifndef CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
6 #define CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ | 6 #define CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "content/public/common/media_stream_request.h" | 12 #include "content/public/common/media_stream_request.h" |
13 | 13 |
14 namespace media_stream { | 14 namespace media_stream { |
15 | 15 |
| 16 // MediaStreamConstraint keys for constraints that are passed to getUserMedia. |
| 17 CONTENT_EXPORT extern const char kMediaStreamSource[]; |
| 18 CONTENT_EXPORT extern const char kMediaStreamSourceId[]; |
| 19 CONTENT_EXPORT extern const char kMediaStreamSourceTab[]; |
| 20 |
16 typedef content::MediaStreamDeviceType MediaStreamType; | 21 typedef content::MediaStreamDeviceType MediaStreamType; |
17 | 22 |
18 // StreamOptions is a Chromium representation of WebKit's | 23 // StreamOptions is a Chromium representation of WebKit's |
19 // WebUserMediaRequest Options. It describes the components | 24 // WebUserMediaRequest Options. It describes the components |
20 // in a request for a new media stream. | 25 // in a request for a new media stream. |
21 struct CONTENT_EXPORT StreamOptions { | 26 struct CONTENT_EXPORT StreamOptions { |
22 StreamOptions(); | 27 StreamOptions(); |
23 // TODO(miu): Remove the 2-bools ctor in later clean-up CL. | 28 // TODO(miu): Remove the 2-bools ctor in later clean-up CL. |
24 StreamOptions(bool user_audio, bool user_video); | 29 StreamOptions(bool user_audio, bool user_video); |
25 StreamOptions(MediaStreamType audio_type, MediaStreamType video_type); | 30 StreamOptions(MediaStreamType audio_type, MediaStreamType video_type); |
| 31 StreamOptions(MediaStreamType audio_type, std::string audio_device_id, |
| 32 MediaStreamType video_type, std::string video_device_id); |
26 | 33 |
27 // If not NO_SERVICE, the stream shall contain an audio input stream. | 34 // If not NO_SERVICE, the stream shall contain an audio input stream. |
28 MediaStreamType audio_type; | 35 MediaStreamType audio_type; |
| 36 std::string audio_device_id; |
29 | 37 |
30 // If not NO_SERVICE, the stream shall contain a video input stream. | 38 // If not NO_SERVICE, the stream shall contain a video input stream. |
31 MediaStreamType video_type; | 39 MediaStreamType video_type; |
| 40 std::string video_device_id; |
32 }; | 41 }; |
33 | 42 |
34 // StreamDeviceInfo describes information about a device. | 43 // StreamDeviceInfo describes information about a device. |
35 struct CONTENT_EXPORT StreamDeviceInfo { | 44 struct CONTENT_EXPORT StreamDeviceInfo { |
36 static const int kNoId; | 45 static const int kNoId; |
37 | 46 |
38 StreamDeviceInfo(); | 47 StreamDeviceInfo(); |
39 StreamDeviceInfo(MediaStreamType service_param, | 48 StreamDeviceInfo(MediaStreamType service_param, |
40 const std::string& name_param, | 49 const std::string& name_param, |
41 const std::string& device_param, | 50 const std::string& device_param, |
(...skipping 12 matching lines...) Expand all Loading... |
54 bool in_use; | 63 bool in_use; |
55 // Id for this capture session. Unique for all sessions of the same type. | 64 // Id for this capture session. Unique for all sessions of the same type. |
56 int session_id; | 65 int session_id; |
57 }; | 66 }; |
58 | 67 |
59 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; | 68 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; |
60 | 69 |
61 } // namespace media_stream | 70 } // namespace media_stream |
62 | 71 |
63 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ | 72 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
OLD | NEW |