From 51e73dac492a19a54deaa3e26f77adadc4a4ba74 Mon Sep 17 00:00:00 2001 From: Fela Ameghino Date: Mon, 23 Nov 2020 09:55:46 +0100 Subject: [PATCH] Handle single plane frames --- .../modules/video_capture/windows/video_capture_winrt.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/patches_for_WebRTC_org/m84/src/modules/video_capture/windows/video_capture_winrt.cc b/patches_for_WebRTC_org/m84/src/modules/video_capture/windows/video_capture_winrt.cc index 854f40e..af79f6d 100644 --- a/patches_for_WebRTC_org/m84/src/modules/video_capture/windows/video_capture_winrt.cc +++ b/patches_for_WebRTC_org/m84/src/modules/video_capture/windows/video_capture_winrt.cc @@ -513,15 +513,11 @@ HRESULT VideoCaptureWinRTInternal::FrameArrived( hr = bitmap_buffer->GetPlaneCount(&plane_count); } - if (SUCCEEDED(hr)) { - hr = plane_count == 2 ? S_OK : E_FAIL; - } - - if (SUCCEEDED(hr)) { + if (SUCCEEDED(hr) && plane_count >= 1) { hr = bitmap_buffer->GetPlaneDescription(0, &bitmap_plane_description_y); } - if (SUCCEEDED(hr)) { + if (SUCCEEDED(hr) && plane_count == 2) { hr = bitmap_buffer->GetPlaneDescription(1, &bitmap_plane_description_uv); }