dav1d: add dav1d-all-layers flag
authorTristan Matthews <tmatth@videolan.org>
Thu, 5 Sep 2024 14:21:11 +0000 (10:21 -0400)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 14 Jan 2025 22:09:47 +0000 (23:09 +0100)
This will output all spatial layers if requested, defaults to false (the built-in dav1d
behavior would defaults this to true).

Fix suggested-by Maryla Ustarroz

Fixes #28776

(cherry picked from commit 6ffede3f445586e5d368de936666cabb84f6a16f)

Gbp-Pq: Name 0028-dav1d-add-dav1d-all-layers-flag.patch

modules/codec/dav1d.c

index 525a5e098c111842856cf1a8cfb5f0488cf3853c..42fcc5973e01b0e1a2261e40701796cf1571785c 100644 (file)
@@ -53,6 +53,8 @@ static void CloseDecoder(vlc_object_t *);
 #define THREAD_FRAMES_LONGTEXT N_( "Max number of threads used for frame decoding, default 0=auto" )
 #define THREAD_TILES_TEXT N_("Tiles Threads")
 #define THREAD_TILES_LONGTEXT N_( "Max number of threads used for tile decoding, default 0=auto" )
+#define LAYERS_TEXT N_("All Layers")
+#define LAYERS_LONGTEXT N_( "Whether or not to display all spatial layers, default false" )
 
 
 vlc_module_begin ()
@@ -73,6 +75,7 @@ vlc_module_begin ()
     add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
                 THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false)
 #endif
+    add_bool( "dav1d-all-layers", false, LAYERS_TEXT, LAYERS_LONGTEXT, false)
 vlc_module_end ()
 
 /*****************************************************************************
@@ -363,6 +366,7 @@ static int OpenDecoder(vlc_object_t *p_this)
     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.all_layers = var_InheritBool( p_this, "dav1d-all-layers" );
     p_sys->s.allocator.cookie = dec;
     p_sys->s.allocator.alloc_picture_callback = NewPicture;
     p_sys->s.allocator.release_picture_callback = FreePicture;