2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-02-16 18:18:21 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_VIDEO_CAPTURE_MAIN_SOURCE_DEVICE_INFO_IMPL_H_
|
|
|
|
|
#define MODULES_VIDEO_CAPTURE_MAIN_SOURCE_DEVICE_INFO_IMPL_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-09-25 17:01:42 +00:00
|
|
|
#include <vector>
|
2013-08-12 19:51:57 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/video_capture/video_capture.h"
|
2018-03-23 14:53:54 +01:00
|
|
|
#include "rtc_base/synchronization/rw_lock_wrapper.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace videocapturemodule {
|
|
|
|
|
class DeviceInfoImpl : public VideoCaptureModule::DeviceInfo {
|
|
|
|
|
public:
|
2016-12-12 00:22:56 -08:00
|
|
|
DeviceInfoImpl();
|
2018-08-29 13:27:15 +02:00
|
|
|
~DeviceInfoImpl(void) override;
|
|
|
|
|
int32_t NumberOfCapabilities(const char* deviceUniqueIdUTF8) override;
|
|
|
|
|
int32_t GetCapability(const char* deviceUniqueIdUTF8,
|
|
|
|
|
const uint32_t deviceCapabilityNumber,
|
|
|
|
|
VideoCaptureCapability& capability) override;
|
|
|
|
|
|
|
|
|
|
int32_t GetBestMatchedCapability(const char* deviceUniqueIdUTF8,
|
|
|
|
|
const VideoCaptureCapability& requested,
|
|
|
|
|
VideoCaptureCapability& resulting) override;
|
|
|
|
|
int32_t GetOrientation(const char* deviceUniqueIdUTF8,
|
|
|
|
|
VideoRotation& orientation) override;
|
2018-06-19 15:03:05 +02:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
protected:
|
|
|
|
|
/* Initialize this object*/
|
2018-06-19 15:03:05 +02:00
|
|
|
|
2013-04-10 08:23:13 +00:00
|
|
|
virtual int32_t Init() = 0;
|
2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Fills the member variable _captureCapabilities with capabilities for the
|
|
|
|
|
* given device name.
|
|
|
|
|
*/
|
2013-04-10 08:23:13 +00:00
|
|
|
virtual int32_t CreateCapabilityMap(const char* deviceUniqueIdUTF8) = 0;
|
2018-06-19 15:03:05 +02:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
protected:
|
|
|
|
|
// Data members
|
2013-09-25 17:01:42 +00:00
|
|
|
typedef std::vector<VideoCaptureCapability> VideoCaptureCapabilities;
|
|
|
|
|
VideoCaptureCapabilities _captureCapabilities;
|
2011-07-07 08:21:25 +00:00
|
|
|
RWLockWrapper& _apiLock;
|
2012-03-01 16:30:40 +00:00
|
|
|
char* _lastUsedDeviceName;
|
2013-04-10 08:23:13 +00:00
|
|
|
uint32_t _lastUsedDeviceNameLength;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace videocapturemodule
|
|
|
|
|
} // namespace webrtc
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_VIDEO_CAPTURE_MAIN_SOURCE_DEVICE_INFO_IMPL_H_
|