mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
vo_gpu: ra_pl: Add getter for pl_gpu
We need access to the underlying pl_gpu to make libplacebo calls from hwdecs.
This commit is contained in:
parent
b74b39dfb5
commit
4c133f3b45
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user