Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 835787
Collapse All | Expand All

(-)vlc-3.0.17.3/modules/codec/dav1d.c (-1 / +18 lines)
Lines 63-72 Link Here
63
    set_category(CAT_INPUT)
63
    set_category(CAT_INPUT)
64
    set_subcategory(SUBCAT_INPUT_VCODEC)
64
    set_subcategory(SUBCAT_INPUT_VCODEC)
65
65
66
#if DAV1D_API_VERSION_MAJOR >= 6
67
    add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_THREADS,
68
                THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
69
    add_obsolete_string("dav1d-thread-tiles") // unused with dav1d 1.0
70
#else
66
    add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_FRAME_THREADS,
71
    add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_FRAME_THREADS,
67
                THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
72
                THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
68
    add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
73
    add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
69
                THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false)
74
                THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false)
75
#endif
70
vlc_module_end ()
76
vlc_module_end ()
71
77
72
/*****************************************************************************
78
/*****************************************************************************
Lines 294-299 Link Here
294
        return VLC_ENOMEM;
300
        return VLC_ENOMEM;
295
301
296
    dav1d_default_settings(&p_sys->s);
302
    dav1d_default_settings(&p_sys->s);
303
#if DAV1D_API_VERSION_MAJOR >= 6
304
    p_sys->s.n_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
305
    if (p_sys->s.n_threads == 0)
306
        p_sys->s.n_threads = __MAX(1, vlc_GetCPUCount());
307
#else
297
    p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
308
    p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
298
    if (p_sys->s.n_tile_threads == 0)
309
    if (p_sys->s.n_tile_threads == 0)
299
        p_sys->s.n_tile_threads =
310
        p_sys->s.n_tile_threads =
Lines 303-308 Link Here
303
    p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
314
    p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
304
    if (p_sys->s.n_frame_threads == 0)
315
    if (p_sys->s.n_frame_threads == 0)
305
        p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
316
        p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
317
#endif
306
    p_sys->s.allocator.cookie = dec;
318
    p_sys->s.allocator.cookie = dec;
307
    p_sys->s.allocator.alloc_picture_callback = NewPicture;
319
    p_sys->s.allocator.alloc_picture_callback = NewPicture;
308
    p_sys->s.allocator.release_picture_callback = FreePicture;
320
    p_sys->s.allocator.release_picture_callback = FreePicture;
Lines 313-325 Link Here
313
        return VLC_EGENERIC;
325
        return VLC_EGENERIC;
314
    }
326
    }
315
327
328
#if DAV1D_API_VERSION_MAJOR >= 6
329
    msg_Dbg(p_this, "Using dav1d version %s with %d threads",
330
            dav1d_version(), p_sys->s.n_threads);
331
    dec->i_extra_picture_buffers = (p_sys->s.n_threads - 1);
332
#else
316
    msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads",
333
    msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads",
317
            dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
334
            dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
318
335
319
    dec->pf_decode = Decode;
336
    dec->pf_decode = Decode;
320
    dec->pf_flush = FlushDecoder;
337
    dec->pf_flush = FlushDecoder;
321
    dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
338
    dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
322
339
#endif
323
    dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
340
    dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
324
    dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
341
    dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
325
    dec->fmt_out.i_codec = VLC_CODEC_I420;
342
    dec->fmt_out.i_codec = VLC_CODEC_I420;

Return to bug 835787