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 typedef content::MediaStreamDeviceType MediaStreamType; |
| 17 |
16 // StreamOptions is a Chromium representation of WebKit's | 18 // StreamOptions is a Chromium representation of WebKit's |
17 // WebUserMediaRequest Options. It describes the components | 19 // WebUserMediaRequest Options. It describes the components |
18 // in a request for a new media stream. | 20 // in a request for a new media stream. |
19 struct CONTENT_EXPORT StreamOptions { | 21 struct CONTENT_EXPORT StreamOptions { |
20 StreamOptions() : audio(false), video(false) {} | 22 StreamOptions(); |
21 StreamOptions(bool audio, bool video) | 23 // TODO(miu): Remove the 2-bools ctor in later clean-up CL. |
22 : audio(audio), video(video) {} | 24 StreamOptions(bool user_audio, bool user_video); |
| 25 StreamOptions(MediaStreamType audio_type, MediaStreamType video_type); |
23 | 26 |
24 // True if the stream shall contain an audio input stream. | 27 // If not NO_SERVICE, the stream shall contain an audio input stream. |
25 bool audio; | 28 MediaStreamType audio_type; |
26 | 29 |
27 // True if the stream shall contain a video input stream. | 30 // If not NO_SERVICE, the stream shall contain a video input stream. |
28 bool video; | 31 MediaStreamType video_type; |
29 }; | 32 }; |
30 | 33 |
31 typedef content::MediaStreamDeviceType MediaStreamType; | |
32 | |
33 // StreamDeviceInfo describes information about a device. | 34 // StreamDeviceInfo describes information about a device. |
34 struct CONTENT_EXPORT StreamDeviceInfo { | 35 struct CONTENT_EXPORT StreamDeviceInfo { |
35 static const int kNoId; | 36 static const int kNoId; |
36 | 37 |
37 StreamDeviceInfo(); | 38 StreamDeviceInfo(); |
38 StreamDeviceInfo(MediaStreamType service_param, | 39 StreamDeviceInfo(MediaStreamType service_param, |
39 const std::string& name_param, | 40 const std::string& name_param, |
40 const std::string& device_param, | 41 const std::string& device_param, |
41 bool opened); | 42 bool opened); |
42 static bool IsEqual(const StreamDeviceInfo& first, | 43 static bool IsEqual(const StreamDeviceInfo& first, |
(...skipping 10 matching lines...) Expand all Loading... |
53 bool in_use; | 54 bool in_use; |
54 // Id for this capture session. Unique for all sessions of the same type. | 55 // Id for this capture session. Unique for all sessions of the same type. |
55 int session_id; | 56 int session_id; |
56 }; | 57 }; |
57 | 58 |
58 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; | 59 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; |
59 | 60 |
60 } // namespace media_stream | 61 } // namespace media_stream |
61 | 62 |
62 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ | 63 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
OLD | NEW |