Skip to content

Commit

Permalink
vo_gpu_next: forwards compatibility with pl_cache
Browse files Browse the repository at this point in the history
Interrim solution, forwards compatible with new and backwards compatible
with old API. Eventually, we will want to discontinue the use of
deprecated pl_icc_params.save/load and pl_renderer_save/load, but that
requires minimum version bump.
  • Loading branch information
haasn committed Sep 8, 2023
1 parent 826ce82 commit 57a6a16
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions video/out/vo_gpu_next.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ struct priv {
pl_tex *sub_tex;
int num_sub_tex;

#if PL_API_VER >= 320
pl_cache cache;
#endif

struct mp_rect src, dst;
struct mp_osd_res osd_res;
struct osd_state osd_state;
Expand Down Expand Up @@ -1625,6 +1629,15 @@ static int preinit(struct vo *vo)
ra_hwdec_ctx_init(&p->hwdec_ctx, vo->hwdec_devs, gl_opts->hwdec_interop, false);
pthread_mutex_init(&p->dr_lock, NULL);

#if PL_API_VER >= 320
p->cache = pl_cache_create(pl_cache_params(
.log = p->pllog,
.max_object_size = 1 << 20, // 1 MB
.max_total_size = 10 << 20, // 10 MB
));
pl_gpu_set_cache(p->gpu, p->cache);
#endif

p->rr = pl_renderer_create(p->pllog, p->gpu);
p->queue = pl_queue_create(p->gpu);
p->osd_fmt[SUBBITMAP_LIBASS] = pl_find_named_fmt(p->gpu, "r8");
Expand Down

0 comments on commit 57a6a16

Please sign in to comment.