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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
2018-11-28 16:47:49 +01:00
|
|
|
#include <string.h>
|
2013-07-12 10:03:52 +00:00
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
#include <unistd.h>
|
2017-11-09 09:33:23 +01:00
|
|
|
// v4l includes
|
2011-07-07 08:21:25 +00:00
|
|
|
#include <linux/videodev2.h>
|
2019-07-05 19:08:33 +02:00
|
|
|
|
2018-11-28 16:47:49 +01:00
|
|
|
#include <vector>
|
2011-09-12 08:53:36 +00:00
|
|
|
|
2023-01-30 14:10:49 +01:00
|
|
|
#if defined(WEBRTC_USE_PIPEWIRE)
|
|
|
|
|
#include "modules/video_capture/linux/device_info_pipewire.h"
|
|
|
|
|
#endif
|
2022-05-10 15:01:32 +02:00
|
|
|
#include "modules/video_capture/linux/device_info_v4l2.h"
|
2018-11-28 16:47:49 +01:00
|
|
|
#include "modules/video_capture/video_capture.h"
|
|
|
|
|
#include "modules/video_capture/video_capture_defines.h"
|
|
|
|
|
#include "modules/video_capture/video_capture_impl.h"
|
2023-01-30 14:10:49 +01:00
|
|
|
#include "modules/video_capture/video_capture_options.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/logging.h"
|
2011-09-12 08:53:36 +00:00
|
|
|
|
2017-11-09 09:33:23 +01:00
|
|
|
namespace webrtc {
|
|
|
|
|
namespace videocapturemodule {
|
|
|
|
|
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo() {
|
2022-05-10 15:01:32 +02:00
|
|
|
return new videocapturemodule::DeviceInfoV4l2();
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2023-01-30 14:10:49 +01:00
|
|
|
|
|
|
|
|
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
|
|
|
|
|
VideoCaptureOptions* options) {
|
|
|
|
|
#if defined(WEBRTC_USE_PIPEWIRE)
|
|
|
|
|
if (options->allow_pipewire()) {
|
|
|
|
|
return new videocapturemodule::DeviceInfoPipeWire(options);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if (options->allow_v4l2())
|
|
|
|
|
return new videocapturemodule::DeviceInfoV4l2();
|
|
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace videocapturemodule
|
|
|
|
|
} // namespace webrtc
|