1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-07 02:06:57 +00:00

multimedia/vlc: unbreak with dav1d 1.0.0

codec/dav1d.c:286:14: error: no member named 'n_tile_threads' in 'struct Dav1dSettings'
    p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
    ~~~~~~~~ ^
codec/dav1d.c:292:14: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
    p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
    ~~~~~~~~ ^
This commit is contained in:
Jan Beich 2022-02-20 14:58:51 +00:00
parent 62ea914468
commit eca2986ede

View File

@ -0,0 +1,136 @@
https://code.videolan.org/videolan/vlc/-/merge_requests/605
codec/dav1d.c:66:57: error: use of undeclared identifier 'DAV1D_MAX_FRAME_THREADS'; did you mean 'DAV1D_OBU_FRAME_HDR'?
add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_FRAME_THREADS,
^~~~~~~~~~~~~~~~~~~~~~~
DAV1D_OBU_FRAME_HDR
../include/vlc_plugin.h:434:34: note: expanded from macro 'add_integer_with_range'
change_integer_range( i_min, i_max )
^
../include/vlc_plugin.h:490:66: note: expanded from macro 'change_integer_range'
vlc_config_set (VLC_CONFIG_RANGE, (int64_t)(minv), (int64_t)(maxv));
^
../include/vlc_plugin.h:246:54: note: expanded from macro 'vlc_config_set'
#define vlc_config_set(...) vlc_set (opaque, config, __VA_ARGS__)
^
/usr/local/include/dav1d/headers.h:48:5: note: 'DAV1D_OBU_FRAME_HDR' declared here
DAV1D_OBU_FRAME_HDR = 3,
^
codec/dav1d.c:68:56: error: use of undeclared identifier 'DAV1D_MAX_TILE_THREADS'
add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
^
codec/dav1d.c:286:14: error: no member named 'n_tile_threads' in 'struct Dav1dSettings'
p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
~~~~~~~~ ^
codec/dav1d.c:287:18: error: no member named 'n_tile_threads' in 'struct Dav1dSettings'
if (p_sys->s.n_tile_threads == 0)
~~~~~~~~ ^
codec/dav1d.c:288:18: error: no member named 'n_tile_threads' in 'struct Dav1dSettings'
p_sys->s.n_tile_threads =
~~~~~~~~ ^
codec/dav1d.c:292:14: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
~~~~~~~~ ^
codec/dav1d.c:293:18: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
if (p_sys->s.n_frame_threads == 0)
~~~~~~~~ ^
codec/dav1d.c:294:18: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
~~~~~~~~ ^
codec/dav1d.c:306:39: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
~~~~~~~~ ^
../include/vlc_messages.h:87:38: note: expanded from macro 'msg_Dbg'
msg_Generic(p_this, VLC_MSG_DBG, __VA_ARGS__)
^~~~~~~~~~~
../include/vlc_messages.h:79:23: note: expanded from macro 'msg_Generic'
__func__, __VA_ARGS__)
^~~~~~~~~~~
codec/dav1d.c:306:65: error: no member named 'n_tile_threads' in 'struct Dav1dSettings'
dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
~~~~~~~~ ^
../include/vlc_messages.h:87:38: note: expanded from macro 'msg_Dbg'
msg_Generic(p_this, VLC_MSG_DBG, __VA_ARGS__)
^~~~~~~~~~~
../include/vlc_messages.h:79:23: note: expanded from macro 'msg_Generic'
__func__, __VA_ARGS__)
^~~~~~~~~~~
codec/dav1d.c:310:46: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
~~~~~~~~ ^
--- modules/codec/dav1d.c.orig 2021-04-27 13:18:39 UTC
+++ modules/codec/dav1d.c
@@ -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 THREAD_TEXT N_("Threads")
+#define THREAD_LONGTEXT N_( "Max number of threads used for decoding, default 0=auto" )
vlc_module_begin ()
@@ -63,10 +65,18 @@ vlc_module_begin ()
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
+#if DAV1D_API_VERSION_MAJOR <= 5
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)
+#else
+ add_obsolete_integer("dav1d-thread-frames")
+ add_obsolete_integer("dav1d-thread-tiles")
+
+ add_integer_with_range("dav1d-threads", 0, 0, DAV1D_MAX_THREADS,
+ THREAD_TEXT, THREAD_LONGTEXT, false)
+#endif
vlc_module_end ()
/*****************************************************************************
@@ -283,6 +293,8 @@ static int OpenDecoder(vlc_object_t *p_this)
return VLC_ENOMEM;
dav1d_default_settings(&p_sys->s);
+
+#if DAV1D_API_VERSION_MAJOR <= 5
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 =
@@ -292,6 +304,12 @@ static int OpenDecoder(vlc_object_t *p_this)
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;
+#else
+ p_sys->s.n_threads = var_InheritInteger(p_this, "dav1d-threads");
+ if (p_sys->s.n_threads == 0)
+ p_sys->s.n_threads = i_core_count;
+#endif
+
p_sys->s.allocator.cookie = dec;
p_sys->s.allocator.alloc_picture_callback = NewPicture;
p_sys->s.allocator.release_picture_callback = FreePicture;
@@ -302,13 +320,20 @@ static int OpenDecoder(vlc_object_t *p_this)
return VLC_EGENERIC;
}
+#if DAV1D_API_VERSION_MAJOR <= 5
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->pf_decode = Decode;
- dec->pf_flush = FlushDecoder;
dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
+#else
+ 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.max_frame_delay - 1);
+#endif
+
+ dec->pf_decode = Decode;
+ dec->pf_flush = FlushDecoder;
dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
dec->fmt_out.i_codec = VLC_CODEC_I420;