summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0095.patch
blob: 560b9137abcbcbdc56e7c3f55b4d48bb000946b8 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From: Andreas Pehrson <apehrson@mozilla.com>
Date: Wed, 10 May 2023 07:06:00 +0000
Subject: Bug 1810949 - cherry-pick upstream libwebrtc commit ba41b40461.
 r=webrtc-reviewers,mjf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream commit: https://webrtc.googlesource.com/src/+/ba41b40461df191624c61f0c98ae76e69fe1d46b
    webrtc_libyuv: Add support for more video types for consistency

    Bug: webrtc:14830
    Change-Id: I0998fb04a03745131f9f5cca878b0cdb46f3b62b
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291529
    Reviewed-by: Erik Språng <sprang@webrtc.org>
    Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
    Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#39940}

Differential Revision: https://phabricator.services.mozilla.com/D177229
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b6eaef560895caa06e11cce40083eb87fd8724a8
---
 common_video/libyuv/include/webrtc_libyuv.h | 3 ++-
 common_video/libyuv/webrtc_libyuv.cc        | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/common_video/libyuv/include/webrtc_libyuv.h b/common_video/libyuv/include/webrtc_libyuv.h
index 6d9071bcd5..253a33294d 100644
--- a/common_video/libyuv/include/webrtc_libyuv.h
+++ b/common_video/libyuv/include/webrtc_libyuv.h
@@ -32,8 +32,9 @@ enum class VideoType {
   kI420,
   kIYUV,
   kRGB24,
-  kABGR,
+  kBGR24,
   kARGB,
+  kABGR,
   kARGB4444,
   kRGB565,
   kARGB1555,
diff --git a/common_video/libyuv/webrtc_libyuv.cc b/common_video/libyuv/webrtc_libyuv.cc
index d07d739119..8c68162624 100644
--- a/common_video/libyuv/webrtc_libyuv.cc
+++ b/common_video/libyuv/webrtc_libyuv.cc
@@ -39,9 +39,11 @@ size_t CalcBufferSize(VideoType type, int width, int height) {
     case VideoType::kUYVY:
       return width * height * 2;
     case VideoType::kRGB24:
+    case VideoType::kBGR24:
       return width * height * 3;
     case VideoType::kBGRA:
     case VideoType::kARGB:
+    case VideoType::kABGR:
       return width * height * 4;
     case VideoType::kMJPEG:
     case VideoType::kUnknown:
@@ -92,6 +94,8 @@ int ConvertVideoType(VideoType video_type) {
       return libyuv::FOURCC_YV12;
     case VideoType::kRGB24:
       return libyuv::FOURCC_24BG;
+    case VideoType::kBGR24:
+      return libyuv::FOURCC_RAW;
     case VideoType::kABGR:
       return libyuv::FOURCC_ABGR;
     case VideoType::kRGB565:
-- 
2.34.1