[vlc-commits] [Git][videolan/vlc][master] 2 commits: dav1d: fix compilation with (upcoming) dav1d 1.0

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Mar 21 06:26:23 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
dbf45cea by Steve Lhomme at 2022-03-21T05:30:37+00:00
dav1d: fix compilation with (upcoming) dav1d 1.0

- - - - -
c8570567 by Steve Lhomme at 2022-03-21T05:30:37+00:00
contrib: dav1d: update to 1.0.0

- - - - -


3 changed files:

- contrib/src/dav1d/SHA512SUMS
- contrib/src/dav1d/rules.mak
- modules/codec/dav1d.c


Changes:

=====================================
contrib/src/dav1d/SHA512SUMS
=====================================
@@ -1 +1 @@
-87026f8b14e408ff50fc8f137ec2ede4b14c5f69687e615d2359d0f718ae5cb5176522490786d9ae1f7838182f82615c2674f7c2961b6dcec83f1ee587c3af7c  dav1d-0.9.2.tar.xz
+a3a7e162e45181449cd42af3a4d36669a850a4ee9ab17641dcd63d84406444566e8ebc7caa55b0620ab581039f36d19a90218a40f52ebbe525b37ed9493fb3f3  dav1d-1.0.0.tar.xz


=====================================
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
 


=====================================
modules/codec/dav1d.c
=====================================
@@ -64,10 +64,16 @@ vlc_module_begin ()
     set_callbacks(OpenDecoder, CloseDecoder)
     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)
+    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)
     add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
                 THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT)
+#endif
 vlc_module_end ()
 
 /*****************************************************************************
@@ -401,12 +407,18 @@ static int OpenDecoder(vlc_object_t *p_this)
         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 = VLC_CLIP(vlc_GetCPUCount(), 1, 4);
     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 = __MAX(1, vlc_GetCPUCount());
+#endif
     p_sys->s.allocator.cookie = dec;
     p_sys->s.allocator.alloc_picture_callback = NewPicture;
     p_sys->s.allocator.release_picture_callback = FreePicture;
@@ -451,10 +463,17 @@ static int OpenDecoder(vlc_object_t *p_this)
         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->fmt_out.video.i_width  = (dec->fmt_out.video.i_width + 0x7F) & ~0x7F;
     dec->fmt_out.video.i_height = (dec->fmt_out.video.i_height + 0x7F) & ~0x7F;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dfe420ab665b81b3f0da47e6614b5e6acf7a42e0...c857056738aec2e66d21b54d2d086c60255e6a91

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dfe420ab665b81b3f0da47e6614b5e6acf7a42e0...c857056738aec2e66d21b54d2d086c60255e6a91
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list