niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
mallinath@webrtc.org | 12984f0 | 2012-02-16 18:18:21 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_VIDEO_CAPTURE_MAIN_SOURCE_DEVICE_INFO_IMPL_H_ |
| 12 | #define MODULES_VIDEO_CAPTURE_MAIN_SOURCE_DEVICE_INFO_IMPL_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
fischman@webrtc.org | 69fc315 | 2013-09-25 17:01:42 +0000 | [diff] [blame] | 14 | #include <vector> |
pbos@webrtc.org | 4ca7d3f | 2013-08-12 19:51:57 +0000 | [diff] [blame] | 15 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "modules/video_capture/video_capture.h" |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 17 | #include "rtc_base/synchronization/rw_lock_wrapper.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 18 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 19 | namespace webrtc { |
| 20 | namespace videocapturemodule { |
| 21 | class DeviceInfoImpl : public VideoCaptureModule::DeviceInfo { |
| 22 | public: |
| 23 | DeviceInfoImpl(); |
| 24 | virtual ~DeviceInfoImpl(void); |
| 25 | virtual int32_t NumberOfCapabilities(const char* deviceUniqueIdUTF8); |
| 26 | virtual int32_t GetCapability(const char* deviceUniqueIdUTF8, |
| 27 | const uint32_t deviceCapabilityNumber, |
| 28 | VideoCaptureCapability& capability); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 30 | virtual int32_t GetBestMatchedCapability( |
| 31 | const char* deviceUniqueIdUTF8, |
| 32 | const VideoCaptureCapability& requested, |
| 33 | VideoCaptureCapability& resulting); |
| 34 | virtual int32_t GetOrientation(const char* deviceUniqueIdUTF8, |
| 35 | VideoRotation& orientation); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 36 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 37 | protected: |
| 38 | /* Initialize this object*/ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 39 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 40 | virtual int32_t Init() = 0; |
| 41 | /* |
| 42 | * Fills the member variable _captureCapabilities with capabilities for the |
| 43 | * given device name. |
| 44 | */ |
| 45 | virtual int32_t CreateCapabilityMap(const char* deviceUniqueIdUTF8) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 46 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 47 | protected: |
| 48 | // Data members |
| 49 | typedef std::vector<VideoCaptureCapability> VideoCaptureCapabilities; |
| 50 | VideoCaptureCapabilities _captureCapabilities; |
| 51 | RWLockWrapper& _apiLock; |
| 52 | char* _lastUsedDeviceName; |
| 53 | uint32_t _lastUsedDeviceNameLength; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | }; |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 55 | } // namespace videocapturemodule |
| 56 | } // namespace webrtc |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 57 | #endif // MODULES_VIDEO_CAPTURE_MAIN_SOURCE_DEVICE_INFO_IMPL_H_ |