summaryrefslogtreecommitdiff
path: root/repo/vlc/dav1d-1.0.0.patch
blob: 717d02094221621406d339e4b7806f5210e061db (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Patch-Source: https://code.videolan.org/videolan/vlc/-/merge_requests/1611/diffs
From dbf45cea2a8abdfbef897b8a71f3eb782bb1b712 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 18 Mar 2022 11:42:49 +0100
Subject: [PATCH 1/2] dav1d: fix compilation with (upcoming) dav1d 1.0

---
 modules/codec/dav1d.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index 565ec94c8b2..e4c7c587829 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -63,10 +63,16 @@
     set_category(CAT_INPUT)
     set_subcategory(SUBCAT_INPUT_VCODEC)
 
+#if DAV1D_API_VERSION_MAJOR >= 6
+    add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_THREADS,
+                THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
+    add_obsolete_string("dav1d-thread-tiles") // unused with dav1d 1.0
+#else
     add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_FRAME_THREADS,
                 THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
     add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
                 THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false)
+#endif
 vlc_module_end ()
 
 /*****************************************************************************
@@ -294,6 +300,11 @@
         return VLC_ENOMEM;
 
     dav1d_default_settings(&p_sys->s);
+#if DAV1D_API_VERSION_MAJOR >= 6
+    p_sys->s.n_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
+    if (p_sys->s.n_threads == 0)
+        p_sys->s.n_threads = __MAX(1, vlc_GetCPUCount());
+#else
     p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
     if (p_sys->s.n_tile_threads == 0)
         p_sys->s.n_tile_threads =
@@ -303,6 +314,7 @@
     p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
     if (p_sys->s.n_frame_threads == 0)
         p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
+#endif
     p_sys->s.allocator.cookie = dec;
     p_sys->s.allocator.alloc_picture_callback = NewPicture;
     p_sys->s.allocator.release_picture_callback = FreePicture;
@@ -313,12 +325,19 @@
         return VLC_EGENERIC;
     }
 
+#if DAV1D_API_VERSION_MAJOR >= 6
+    msg_Dbg(p_this, "Using dav1d version %s with %d threads",
+            dav1d_version(), p_sys->s.n_threads);
+
+    dec->i_extra_picture_buffers = (p_sys->s.n_threads - 1);
+#else
     msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads",
             dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
 
+    dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
+#endif
     dec->pf_decode = Decode;
     dec->pf_flush = FlushDecoder;
-    dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
 
     dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
     dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
-- 
GitLab


From c857056738aec2e66d21b54d2d086c60255e6a91 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 12 Aug 2020 06:19:06 +0200
Subject: [PATCH 2/2] contrib: dav1d: update to 1.0.0

---
 contrib/src/dav1d/SHA512SUMS | 2 +-
 contrib/src/dav1d/rules.mak  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/src/dav1d/SHA512SUMS b/contrib/src/dav1d/SHA512SUMS
index 5d7d593ae20..641f4f75698 100644
--- a/contrib/src/dav1d/SHA512SUMS
+++ b/contrib/src/dav1d/SHA512SUMS
@@ -1 +1 @@
-87026f8b14e408ff50fc8f137ec2ede4b14c5f69687e615d2359d0f718ae5cb5176522490786d9ae1f7838182f82615c2674f7c2961b6dcec83f1ee587c3af7c  dav1d-0.9.2.tar.xz
+a3a7e162e45181449cd42af3a4d36669a850a4ee9ab17641dcd63d84406444566e8ebc7caa55b0620ab581039f36d19a90218a40f52ebbe525b37ed9493fb3f3  dav1d-1.0.0.tar.xz
diff --git a/contrib/src/dav1d/rules.mak b/contrib/src/dav1d/rules.mak
index f75c9e1fa0c..e4583228316 100644
--- a/contrib/src/dav1d/rules.mak
+++ b/contrib/src/dav1d/rules.mak
@@ -1,6 +1,6 @@
 # libdav1d
 
-DAV1D_VERSION := 0.9.2
+DAV1D_VERSION := 1.0.0
 DAV1D_URL := $(VIDEOLAN)/dav1d/$(DAV1D_VERSION)/dav1d-$(DAV1D_VERSION).tar.xz
 
 PKGS += dav1d
@@ -12,7 +12,7 @@ DAV1D_CONF = -D enable_tests=false -D enable_tools=false
 
 $(TARBALLS)/dav1d-$(DAV1D_VERSION).tar.xz:
 	$(call download_pkg,$(DAV1D_URL),dav1d)
-	#~ $(call download_git,$(DAV1D_URL),,$(DAV1D_HASH))
+	#~ $(call download_git,$(DAV1D_GITURL),,$(DAV1D_HASH))
 
 .sum-dav1d: dav1d-$(DAV1D_VERSION).tar.xz
 
-- 
GitLab