[vlc-commits] [Git][videolan/vlc][master] vpx: add an option to select the number of decoding threads to use

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Oct 24 07:09:23 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
772c7e02 by Steve Lhomme at 2023-10-24T06:41:17+00:00
vpx: add an option to select the number of decoding threads to use

This is the same option as libavcodec but with a different name.

- - - - -


1 changed file:

- modules/codec/vpx.c


Changes:

=====================================
modules/codec/vpx.c
=====================================
@@ -62,6 +62,8 @@ static const char* const quality_desc[] = {
     N_("Good"), N_("Realtime"), N_("Best"),
 };
 #endif
+#define THREADS_TEXT N_( "Threads" )
+#define THREADS_LONGTEXT N_( "Number of threads used for decoding, 0 meaning auto" )
 
 /*****************************************************************************
  * Module descriptor
@@ -72,6 +74,7 @@ vlc_module_begin ()
     set_description(N_("WebM video decoder"))
     set_capability("video decoder", 60)
     set_callbacks(OpenDecoder, CloseDecoder)
+    add_integer( "vpx-threads", 0, THREADS_TEXT, THREADS_LONGTEXT );
     set_subcategory(SUBCAT_INPUT_VCODEC)
 #ifdef ENABLE_SOUT
     add_submodule()
@@ -327,8 +330,9 @@ static int OpenDecoder(vlc_object_t *p_this)
         return VLC_ENOMEM;
     dec->p_sys = sys;
 
+    int i_thread_count = var_InheritInteger(p_this, "vpx-threads");
     struct vpx_codec_dec_cfg deccfg = {
-        .threads = __MIN(vlc_GetCPUCount(), 16)
+        .threads = i_thread_count ? i_thread_count : __MIN(vlc_GetCPUCount(), 16)
     };
 
     msg_Dbg(p_this, "VP%d: using libvpx version %s (build options %s)",



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/772c7e02fa7b74d72f3401e195d231c921d59f87

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/772c7e02fa7b74d72f3401e195d231c921d59f87
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