File: 02-Better-support-for-nv21-format.patch

package info (click to toggle)
yuview 2.14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,712 kB
  • sloc: cpp: 62,506; python: 788; xml: 54; makefile: 6
file content (29 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download
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
From: Roger Shimizu <rosh@debian.org>
Date: Fri, 12 Jun 2020 03:20:06 +0900
Subject: Better support for nv21 format

Improve nv21 format by two ways:
- Prefer nv21 than nv12, because nv21 is Android's default format.

Forwarded: not-needed
---
 YUViewLib/src/video/yuv/videoHandlerYUV.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/YUViewLib/src/video/yuv/videoHandlerYUV.cpp b/YUViewLib/src/video/yuv/videoHandlerYUV.cpp
index fee6e2d..812d15b 100644
--- a/YUViewLib/src/video/yuv/videoHandlerYUV.cpp
+++ b/YUViewLib/src/video/yuv/videoHandlerYUV.cpp
@@ -3290,9 +3290,10 @@ void videoHandlerYUV::setFormatFromSizeAndName(Size             frameSize,
 
   if (!fmt.isValid())
   {
-    // Guessing failed. Set YUV 4:2:0 8 bit so that we can show something.
+    // Guessing failed. Set NV21 (YVU 4:2:0 8 bit) so that we can show something.
+    // Since NV21 is default in Android
     // This will probably be wrong but we are out of options
-    fmt = PixelFormatYUV(Subsampling::YUV_420, 8, PlaneOrder::YUV);
+    fmt = PixelFormatYUV(Subsampling::YUV_420, 8, PlaneOrder::YVU, false, {}, true);
   }
 
   setSrcPixelFormat(fmt, false);