| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 #if defined(OS_WIN) || defined(OS_MACOSX) | 103 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 104 CaptureApiType capture_api_type() const { | 104 CaptureApiType capture_api_type() const { |
| 105 return capture_api_class_.capture_api_type(); | 105 return capture_api_class_.capture_api_type(); |
| 106 } | 106 } |
| 107 #endif | 107 #endif |
| 108 #if defined(OS_MACOSX) | 108 #if defined(OS_MACOSX) |
| 109 TransportType transport_type() const { | 109 TransportType transport_type() const { |
| 110 return transport_type_; | 110 return transport_type_; |
| 111 } | 111 } |
| 112 bool is_blacklisted() const { |
| 113 return is_blacklisted_; |
| 114 } |
| 115 void set_is_blacklisted(bool is_blacklisted) { |
| 116 is_blacklisted_ = is_blacklisted; |
| 117 } |
| 112 #endif // if defined(OS_WIN) | 118 #endif // if defined(OS_WIN) |
| 113 | 119 |
| 114 private: | 120 private: |
| 115 std::string device_name_; | 121 std::string device_name_; |
| 116 std::string unique_id_; | 122 std::string unique_id_; |
| 117 #if defined(OS_WIN) || defined(OS_MACOSX) | 123 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 118 // This class wraps the CaptureApiType to give it a by default value if not | 124 // This class wraps the CaptureApiType to give it a by default value if not |
| 119 // initialized. | 125 // initialized. |
| 120 class CaptureApiClass { | 126 class CaptureApiClass { |
| 121 public: | 127 public: |
| 122 CaptureApiClass(): capture_api_type_(API_TYPE_UNKNOWN) {} | 128 CaptureApiClass(): capture_api_type_(API_TYPE_UNKNOWN) {} |
| 123 CaptureApiClass(const CaptureApiType api_type) | 129 CaptureApiClass(const CaptureApiType api_type) |
| 124 : capture_api_type_(api_type) {} | 130 : capture_api_type_(api_type) {} |
| 125 CaptureApiType capture_api_type() const { | 131 CaptureApiType capture_api_type() const { |
| 126 DCHECK_NE(capture_api_type_, API_TYPE_UNKNOWN); | 132 DCHECK_NE(capture_api_type_, API_TYPE_UNKNOWN); |
| 127 return capture_api_type_; | 133 return capture_api_type_; |
| 128 } | 134 } |
| 129 private: | 135 private: |
| 130 CaptureApiType capture_api_type_; | 136 CaptureApiType capture_api_type_; |
| 131 }; | 137 }; |
| 132 | 138 |
| 133 CaptureApiClass capture_api_class_; | 139 CaptureApiClass capture_api_class_; |
| 134 #endif | 140 #endif |
| 135 #if defined(OS_MACOSX) | 141 #if defined(OS_MACOSX) |
| 136 TransportType transport_type_; | 142 TransportType transport_type_; |
| 143 // Flag used to mark blacklisted devices for QTKit Api. |
| 144 bool is_blacklisted_; |
| 137 #endif | 145 #endif |
| 138 // Allow generated copy constructor and assignment. | 146 // Allow generated copy constructor and assignment. |
| 139 }; | 147 }; |
| 140 | 148 |
| 141 // Manages a list of Name entries. | 149 // Manages a list of Name entries. |
| 142 typedef std::list<Name> Names; | 150 typedef std::list<Name> Names; |
| 143 | 151 |
| 144 class MEDIA_EXPORT Client { | 152 class MEDIA_EXPORT Client { |
| 145 public: | 153 public: |
| 146 // Memory buffer returned by Client::ReserveOutputBuffer(). | 154 // Memory buffer returned by Client::ReserveOutputBuffer(). |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 int GetPowerLineFrequencyForLocation() const; | 258 int GetPowerLineFrequencyForLocation() const; |
| 251 | 259 |
| 252 protected: | 260 protected: |
| 253 static const int kPowerLine50Hz = 50; | 261 static const int kPowerLine50Hz = 50; |
| 254 static const int kPowerLine60Hz = 60; | 262 static const int kPowerLine60Hz = 60; |
| 255 }; | 263 }; |
| 256 | 264 |
| 257 } // namespace media | 265 } // namespace media |
| 258 | 266 |
| 259 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 267 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |