| 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 // VideoCaptureDevice is the abstract base class for realizing video capture | 5 // VideoCaptureDevice is the abstract base class for realizing video capture |
| 6 // device support in Chromium. It provides the interface for OS dependent | 6 // device support in Chromium. It provides the interface for OS dependent |
| 7 // implementations. | 7 // implementations. |
| 8 // The class is created and functions are invoked on a thread owned by | 8 // The class is created and functions are invoked on a thread owned by |
| 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS | 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS |
| 10 // specific implementation. | 10 // specific implementation. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 class MEDIA_EXPORT Name { | 39 class MEDIA_EXPORT Name { |
| 40 public: | 40 public: |
| 41 Name(); | 41 Name(); |
| 42 Name(const std::string& name, const std::string& id); | 42 Name(const std::string& name, const std::string& id); |
| 43 | 43 |
| 44 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
| 45 // Windows targets Capture Api type: it can only be set on construction. | 45 // Windows targets Capture Api type: it can only be set on construction. |
| 46 enum CaptureApiType { | 46 enum CaptureApiType { |
| 47 MEDIA_FOUNDATION, | 47 MEDIA_FOUNDATION, |
| 48 DIRECT_SHOW, | 48 DIRECT_SHOW, |
| 49 DIRECT_SHOW_WDM, | 49 DIRECT_SHOW_WDM_CROSSBAR, |
| 50 API_TYPE_UNKNOWN | 50 API_TYPE_UNKNOWN |
| 51 }; | 51 }; |
| 52 #endif | 52 #endif |
| 53 #if defined(OS_MACOSX) | 53 #if defined(OS_MACOSX) |
| 54 // Mac targets Capture Api type: it can only be set on construction. | 54 // Mac targets Capture Api type: it can only be set on construction. |
| 55 enum CaptureApiType { | 55 enum CaptureApiType { |
| 56 AVFOUNDATION, | 56 AVFOUNDATION, |
| 57 QTKIT, | 57 QTKIT, |
| 58 API_TYPE_UNKNOWN | 58 API_TYPE_UNKNOWN |
| 59 }; | 59 }; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 bool operator<(const Name& other) const { | 100 bool operator<(const Name& other) const { |
| 101 return unique_id_ < other.id(); | 101 return unique_id_ < other.id(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 #if defined(OS_WIN) || defined(OS_MACOSX) | 104 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 105 CaptureApiType capture_api_type() const { | 105 CaptureApiType capture_api_type() const { |
| 106 return capture_api_class_.capture_api_type(); | 106 return capture_api_class_.capture_api_type(); |
| 107 } | 107 } |
| 108 #endif | 108 #endif |
| 109 #if defined(OS_WIN) |
| 110 // Certain devices need an ID different from the |unique_id_| for |
| 111 // capabilities retrieval. |
| 112 const std::string& capabilities_id() const { |
| 113 return capabilities_id_; |
| 114 } |
| 115 void set_capabilities_id(const std::string& id) { |
| 116 capabilities_id_ = id; |
| 117 } |
| 118 #endif |
| 109 #if defined(OS_MACOSX) | 119 #if defined(OS_MACOSX) |
| 110 TransportType transport_type() const { | 120 TransportType transport_type() const { |
| 111 return transport_type_; | 121 return transport_type_; |
| 112 } | 122 } |
| 113 bool is_blacklisted() const { | 123 bool is_blacklisted() const { |
| 114 return is_blacklisted_; | 124 return is_blacklisted_; |
| 115 } | 125 } |
| 116 void set_is_blacklisted(bool is_blacklisted) { | 126 void set_is_blacklisted(bool is_blacklisted) { |
| 117 is_blacklisted_ = is_blacklisted; | 127 is_blacklisted_ = is_blacklisted; |
| 118 } | 128 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 132 CaptureApiType capture_api_type() const { | 142 CaptureApiType capture_api_type() const { |
| 133 DCHECK_NE(capture_api_type_, API_TYPE_UNKNOWN); | 143 DCHECK_NE(capture_api_type_, API_TYPE_UNKNOWN); |
| 134 return capture_api_type_; | 144 return capture_api_type_; |
| 135 } | 145 } |
| 136 private: | 146 private: |
| 137 CaptureApiType capture_api_type_; | 147 CaptureApiType capture_api_type_; |
| 138 }; | 148 }; |
| 139 | 149 |
| 140 CaptureApiClass capture_api_class_; | 150 CaptureApiClass capture_api_class_; |
| 141 #endif | 151 #endif |
| 152 #if defined(OS_WIN) |
| 153 // ID used for capabilities retrieval. By default is equal to |unique_id|. |
| 154 std::string capabilities_id_; |
| 155 #endif |
| 142 #if defined(OS_MACOSX) | 156 #if defined(OS_MACOSX) |
| 143 TransportType transport_type_; | 157 TransportType transport_type_; |
| 144 // Flag used to mark blacklisted devices for QTKit Api. | 158 // Flag used to mark blacklisted devices for QTKit Api. |
| 145 bool is_blacklisted_; | 159 bool is_blacklisted_; |
| 146 #endif | 160 #endif |
| 147 // Allow generated copy constructor and assignment. | 161 // Allow generated copy constructor and assignment. |
| 148 }; | 162 }; |
| 149 | 163 |
| 150 // Manages a list of Name entries. | 164 // Manages a list of Name entries. |
| 151 typedef std::list<Name> Names; | 165 typedef std::list<Name> Names; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 int GetPowerLineFrequencyForLocation() const; | 273 int GetPowerLineFrequencyForLocation() const; |
| 260 | 274 |
| 261 protected: | 275 protected: |
| 262 static const int kPowerLine50Hz = 50; | 276 static const int kPowerLine50Hz = 50; |
| 263 static const int kPowerLine60Hz = 60; | 277 static const int kPowerLine60Hz = 60; |
| 264 }; | 278 }; |
| 265 | 279 |
| 266 } // namespace media | 280 } // namespace media |
| 267 | 281 |
| 268 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 282 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |