| 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 "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 // Types of media streams. | 18 // Types of media streams. |
| 19 enum MediaStreamDeviceType { | 19 enum MediaStreamDeviceType { |
| 20 MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE = 0, | 20 MEDIA_NO_SERVICE = 0, |
| 21 MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, | 21 |
| 22 MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE, | 22 // A device provided by the operating system (e.g., webcam input). |
| 23 NUM_MEDIA_STREAM_DEVICE_TYPES | 23 MEDIA_DEVICE_AUDIO_CAPTURE, |
| 24 MEDIA_DEVICE_VIDEO_CAPTURE, |
| 25 |
| 26 // Mirroring of a browser tab. |
| 27 MEDIA_TAB_AUDIO_CAPTURE, |
| 28 MEDIA_TAB_VIDEO_CAPTURE, |
| 29 |
| 30 NUM_MEDIA_TYPES |
| 24 }; | 31 }; |
| 25 | 32 |
| 33 // Convenience predicates to determine whether the given type represents some |
| 34 // audio or some video device. |
| 35 CONTENT_EXPORT bool IsAudioMediaType(MediaStreamDeviceType type); |
| 36 CONTENT_EXPORT bool IsVideoMediaType(MediaStreamDeviceType type); |
| 37 |
| 26 // TODO(xians): Change the structs to classes. | 38 // TODO(xians): Change the structs to classes. |
| 27 // Represents one device in a request for media stream(s). | 39 // Represents one device in a request for media stream(s). |
| 28 struct CONTENT_EXPORT MediaStreamDevice { | 40 struct CONTENT_EXPORT MediaStreamDevice { |
| 29 MediaStreamDevice( | 41 MediaStreamDevice( |
| 30 MediaStreamDeviceType type, | 42 MediaStreamDeviceType type, |
| 31 const std::string& device_id, | 43 const std::string& device_id, |
| 32 const std::string& name); | 44 const std::string& name); |
| 33 | 45 |
| 34 ~MediaStreamDevice(); | 46 ~MediaStreamDevice(); |
| 35 | 47 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 80 |
| 69 // A list of devices present on the user's computer, for each device type | 81 // A list of devices present on the user's computer, for each device type |
| 70 // requested. | 82 // requested. |
| 71 // All the elements in this map will be deleted in ~MediaStreamRequest(). | 83 // All the elements in this map will be deleted in ~MediaStreamRequest(). |
| 72 MediaStreamDeviceMap devices; | 84 MediaStreamDeviceMap devices; |
| 73 }; | 85 }; |
| 74 | 86 |
| 75 } // namespace content | 87 } // namespace content |
| 76 | 88 |
| 77 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 89 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
| OLD | NEW |