| 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, |
| 26 const std::string& opt_device_id); |
| 23 | 27 |
| 24 // True if the stream shall contain an audio input stream. | 28 // If not NO_SERVICE, the stream shall contain an audio input stream. |
| 25 bool audio; | 29 MediaStreamType audio_type; |
| 26 | 30 |
| 27 // True if the stream shall contain a video input stream. | 31 // If not NO_SERVICE, the stream shall contain a video input stream. |
| 28 bool video; | 32 MediaStreamType video_type; |
| 33 |
| 34 // If empty, user is allowed to choose from among all available devices. |
| 35 // Otherwise, this selects a specific device. |
| 36 std::string opt_device_id; |
| 29 }; | 37 }; |
| 30 | 38 |
| 31 typedef content::MediaStreamDeviceType MediaStreamType; | |
| 32 | |
| 33 // StreamDeviceInfo describes information about a device. | 39 // StreamDeviceInfo describes information about a device. |
| 34 struct CONTENT_EXPORT StreamDeviceInfo { | 40 struct CONTENT_EXPORT StreamDeviceInfo { |
| 35 static const int kNoId; | 41 static const int kNoId; |
| 36 | 42 |
| 37 StreamDeviceInfo(); | 43 StreamDeviceInfo(); |
| 38 StreamDeviceInfo(MediaStreamType service_param, | 44 StreamDeviceInfo(MediaStreamType service_param, |
| 39 const std::string& name_param, | 45 const std::string& name_param, |
| 40 const std::string& device_param, | 46 const std::string& device_param, |
| 41 bool opened); | 47 bool opened); |
| 42 static bool IsEqual(const StreamDeviceInfo& first, | 48 static bool IsEqual(const StreamDeviceInfo& first, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 53 bool in_use; | 59 bool in_use; |
| 54 // Id for this capture session. Unique for all sessions of the same type. | 60 // Id for this capture session. Unique for all sessions of the same type. |
| 55 int session_id; | 61 int session_id; |
| 56 }; | 62 }; |
| 57 | 63 |
| 58 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; | 64 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; |
| 59 | 65 |
| 60 } // namespace media_stream | 66 } // namespace media_stream |
| 61 | 67 |
| 62 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ | 68 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
| OLD | NEW |