#include "media/capture/video/linux/video_capture_device_linux.h"
#include <stddef.h>
#include <utility>
#include "base/functional/bind.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "media/capture/video/linux/v4l2_capture_delegate.h"
#if BUILDFLAG(IS_OPENBSD)
#include <sys/videoio.h>
#else
#include <linux/videodev2.h>
#endif
namespace media {
namespace {
int TranslatePowerLineFrequencyToV4L2(PowerLineFrequency frequency) { … }
}
VideoPixelFormat VideoCaptureDeviceLinux::V4l2FourCcToChromiumPixelFormat(
uint32_t v4l2_fourcc) { … }
std::vector<uint32_t> VideoCaptureDeviceLinux::GetListOfUsableFourCCs(
bool favour_mjpeg) { … }
VideoCaptureDeviceLinux::VideoCaptureDeviceLinux(
scoped_refptr<V4L2CaptureDevice> v4l2,
const VideoCaptureDeviceDescriptor& device_descriptor)
: … { … }
VideoCaptureDeviceLinux::~VideoCaptureDeviceLinux() { … }
void VideoCaptureDeviceLinux::AllocateAndStart(
const VideoCaptureParams& params,
std::unique_ptr<VideoCaptureDevice::Client> client) { … }
void VideoCaptureDeviceLinux::StopAndDeAllocate() { … }
void VideoCaptureDeviceLinux::TakePhoto(TakePhotoCallback callback) { … }
void VideoCaptureDeviceLinux::GetPhotoState(GetPhotoStateCallback callback) { … }
void VideoCaptureDeviceLinux::SetPhotoOptions(
mojom::PhotoSettingsPtr settings,
SetPhotoOptionsCallback callback) { … }
void VideoCaptureDeviceLinux::SetRotation(int rotation) { … }
void VideoCaptureDeviceLinux::StopAndDeAllocateInternal(
base::WaitableEvent* waiter) { … }
void VideoCaptureDeviceLinux::SetGPUEnvironmentForTesting(
std::unique_ptr<gpu::GpuMemoryBufferSupport> gmb_support) { … }
}