diff options
author | Philip Langdale <philipl@overt.org> | 2018-11-26 20:35:47 -0800 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2019-04-21 23:55:22 +0300 |
commit | 4c133f3b452ce4f013d805faf5de182414de93f8 (patch) | |
tree | 9a20d9a78b1caebb0f8a685f23e7339f833ca821 /video/out/placebo | |
parent | b74b39dfb550b474624202efd193261a130fe191 (diff) | |
download | mpv-4c133f3b452ce4f013d805faf5de182414de93f8.tar.bz2 mpv-4c133f3b452ce4f013d805faf5de182414de93f8.tar.xz |
vo_gpu: ra_pl: Add getter for pl_gpu
We need access to the underlying pl_gpu to make libplacebo calls
from hwdecs.
Diffstat (limited to 'video/out/placebo')
-rw-r--r-- | video/out/placebo/ra_pl.c | 7 | ||||
-rw-r--r-- | video/out/placebo/ra_pl.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/video/out/placebo/ra_pl.c b/video/out/placebo/ra_pl.c index 334f2f135f..18d8f37070 100644 --- a/video/out/placebo/ra_pl.c +++ b/video/out/placebo/ra_pl.c @@ -8,7 +8,7 @@ struct ra_pl { const struct pl_gpu *gpu; }; -static inline const struct pl_gpu *get_gpu(struct ra *ra) +static inline const struct pl_gpu *get_gpu(const struct ra *ra) { struct ra_pl *p = ra->priv; return p->gpu; @@ -16,6 +16,11 @@ static inline const struct pl_gpu *get_gpu(struct ra *ra) static struct ra_fns ra_fns_pl; +const struct pl_gpu *ra_pl_get(const struct ra *ra) +{ + return ra->fns == &ra_fns_pl ? get_gpu(ra) : NULL; +} + struct ra *ra_create_pl(const struct pl_gpu *gpu, struct mp_log *log) { assert(gpu); diff --git a/video/out/placebo/ra_pl.h b/video/out/placebo/ra_pl.h index a342892963..c1c0c16af5 100644 --- a/video/out/placebo/ra_pl.h +++ b/video/out/placebo/ra_pl.h @@ -5,6 +5,8 @@ struct ra *ra_create_pl(const struct pl_gpu *gpu, struct mp_log *log); +const struct pl_gpu *ra_pl_get(const struct ra *ra); + // Wrap a pl_tex into a ra_tex struct, returns if successful bool mppl_wrap_tex(struct ra *ra, const struct pl_tex *pltex, struct ra_tex *out_tex); |