diff options
Diffstat (limited to 'www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc')
-rw-r--r-- | www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc b/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc index 389350204726..161a7954da60 100644 --- a/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc +++ b/www/ungoogled-chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc @@ -1,4 +1,4 @@ ---- media/capture/video/linux/v4l2_capture_delegate.cc.orig 2023-07-21 09:49:17 UTC +--- media/capture/video/linux/v4l2_capture_delegate.cc.orig 2023-09-17 07:59:53 UTC +++ media/capture/video/linux/v4l2_capture_delegate.cc @@ -4,8 +4,10 @@ @@ -11,7 +11,15 @@ #include <poll.h> #include <sys/fcntl.h> #include <sys/ioctl.h> -@@ -28,10 +30,12 @@ +@@ -26,17 +28,19 @@ + #include "media/capture/video/blob_utils.h" + #include "media/capture/video/linux/video_capture_device_linux.h" + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + #include "media/capture/capture_switches.h" + #include "media/capture/video/linux/v4l2_capture_delegate_gpu_helper.h" + #endif // BUILDFLAG(IS_LINUX) using media::mojom::MeteringMode; @@ -24,7 +32,7 @@ // TODO(aleksandar.stojiljkovic): Wrap this with kernel version check once the // format is introduced to kernel. -@@ -255,7 +259,7 @@ bool V4L2CaptureDelegate::IsBlockedControl(int control +@@ -260,7 +264,7 @@ bool V4L2CaptureDelegate::IsBlockedControl(int control // static bool V4L2CaptureDelegate::IsControllableControl( int control_id, @@ -33,7 +41,25 @@ const int special_control_id = GetControllingSpecialControl(control_id); if (!special_control_id) { // The control is not controlled by a special control thus the control is -@@ -772,7 +776,7 @@ base::WeakPtr<V4L2CaptureDelegate> V4L2CaptureDelegate +@@ -316,7 +320,7 @@ V4L2CaptureDelegate::V4L2CaptureDelegate( + is_capturing_(false), + timeout_count_(0), + rotation_(rotation) { +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + use_gpu_buffer_ = switches::IsVideoCaptureUseGpuMemoryBufferEnabled(); + #endif // BUILDFLAG(IS_LINUX) + } +@@ -443,7 +447,7 @@ void V4L2CaptureDelegate::AllocateAndStart( + + client_->OnStarted(); + +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + if (use_gpu_buffer_) { + v4l2_gpu_helper_ = std::make_unique<V4L2CaptureDelegateGpuHelper>( + std::move(gmb_support_test_)); +@@ -793,7 +797,7 @@ void V4L2CaptureDelegate::SetGPUEnvironmentForTesting( V4L2CaptureDelegate::~V4L2CaptureDelegate() = default; @@ -42,7 +68,7 @@ int num_retries = 0; for (; DoIoctl(request, argp) < 0 && num_retries < kMaxIOCtrlRetries; ++num_retries) { -@@ -782,7 +786,7 @@ bool V4L2CaptureDelegate::RunIoctl(int request, void* +@@ -803,7 +807,7 @@ bool V4L2CaptureDelegate::RunIoctl(int request, void* return num_retries != kMaxIOCtrlRetries; } @@ -51,7 +77,7 @@ return HANDLE_EINTR(v4l2_->ioctl(device_fd_.get(), request, argp)); } -@@ -793,6 +797,7 @@ bool V4L2CaptureDelegate::IsControllableControl(int co +@@ -814,6 +818,7 @@ bool V4L2CaptureDelegate::IsControllableControl(int co } void V4L2CaptureDelegate::ReplaceControlEventSubscriptions() { @@ -59,7 +85,7 @@ constexpr uint32_t kControlIds[] = {V4L2_CID_AUTO_EXPOSURE_BIAS, V4L2_CID_AUTO_WHITE_BALANCE, V4L2_CID_BRIGHTNESS, -@@ -820,6 +825,7 @@ void V4L2CaptureDelegate::ReplaceControlEventSubscript +@@ -841,6 +846,7 @@ void V4L2CaptureDelegate::ReplaceControlEventSubscript << ", {type = V4L2_EVENT_CTRL, id = " << control_id << "}"; } } @@ -67,7 +93,7 @@ } mojom::RangePtr V4L2CaptureDelegate::RetrieveUserControlRange(int control_id) { -@@ -1000,7 +1006,11 @@ void V4L2CaptureDelegate::DoCapture() { +@@ -1021,7 +1027,11 @@ void V4L2CaptureDelegate::DoCapture() { pollfd device_pfd = {}; device_pfd.fd = device_fd_.get(); @@ -79,7 +105,7 @@ const int result = HANDLE_EINTR(v4l2_->poll(&device_pfd, 1, kCaptureTimeoutMs)); -@@ -1038,6 +1048,7 @@ void V4L2CaptureDelegate::DoCapture() { +@@ -1059,6 +1069,7 @@ void V4L2CaptureDelegate::DoCapture() { timeout_count_ = 0; } @@ -87,7 +113,7 @@ // Dequeue events if the driver has filled in some. if (device_pfd.revents & POLLPRI) { bool controls_changed = false; -@@ -1072,6 +1083,7 @@ void V4L2CaptureDelegate::DoCapture() { +@@ -1093,6 +1104,7 @@ void V4L2CaptureDelegate::DoCapture() { client_->OnCaptureConfigurationChanged(); } } @@ -95,3 +121,12 @@ // Deenqueue, send and reenqueue a buffer if the driver has filled one in. if (device_pfd.revents & POLLIN) { +@@ -1147,7 +1159,7 @@ void V4L2CaptureDelegate::DoCapture() { + // matrix = v4l2_format->fmt.pix.ycbcr_enc; + // transfer = v4l2_format->fmt.pix.xfer_func; + // See http://crbug.com/959919. +-#if BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) + if (use_gpu_buffer_) { + v4l2_gpu_helper_->OnIncomingCapturedData( + client_.get(), buffer_tracker->start(), |