File: 0016.patch

package info (click to toggle)
thunderbird 1%3A143.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,703,968 kB
  • sloc: cpp: 7,770,492; javascript: 5,943,842; ansic: 3,918,754; python: 1,418,263; xml: 653,354; asm: 474,045; java: 183,079; sh: 111,238; makefile: 20,410; perl: 14,359; objc: 13,059; yacc: 4,583; pascal: 3,405; lex: 1,720; ruby: 999; exp: 762; sql: 715; awk: 580; php: 436; lisp: 430; sed: 69; csh: 10
file content (44 lines) | stat: -rw-r--r-- 1,815 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From: Dan Minor <dminor@mozilla.com>
Date: Fri, 29 Mar 2019 18:43:00 +0000
Subject: Bug 1539220 - Prefer non-RGB24 capabilities when available;
 r=pehrsons

We've hit a number of problems with handling of RGB24 video capture on
Windows. This adds a check that will ignore any RGB24 capture capabilities
when determining a best match if there are other capabilities available to
workaround the problems.

Differential Revision: https://phabricator.services.mozilla.com/D25449
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/c12307f3817bec87712ab5930493c3135c76b0a0
---
 modules/video_capture/device_info_impl.cc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/video_capture/device_info_impl.cc b/modules/video_capture/device_info_impl.cc
index ba69a46334..14db41937d 100644
--- a/modules/video_capture/device_info_impl.cc
+++ b/modules/video_capture/device_info_impl.cc
@@ -107,10 +107,23 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
   const int32_t numberOfCapabilies =
       static_cast<int32_t>(_captureCapabilities.size());
 
+  bool hasNonRGB24Capability = false;
   for (int32_t tmp = 0; tmp < numberOfCapabilies;
        ++tmp)  // Loop through all capabilities
   {
     VideoCaptureCapability& capability = _captureCapabilities[tmp];
+    if (capability.videoType != VideoType::kRGB24) {
+      hasNonRGB24Capability = true;
+    }
+  }
+
+  for (int32_t tmp = 0; tmp < numberOfCapabilies;
+       ++tmp)  // Loop through all capabilities
+  {
+    VideoCaptureCapability& capability = _captureCapabilities[tmp];
+    if (hasNonRGB24Capability && capability.videoType == VideoType::kRGB24) {
+      continue;
+    }
 
     const int32_t diffWidth = capability.width - requested.width;
     const int32_t diffHeight = capability.height - requested.height;