Skip to content

Commit

Permalink
vo_gpu_next: fix mp_image colorspace with some hwdecs
Browse files Browse the repository at this point in the history
Fixes: ef6052c
  • Loading branch information
kasper93 committed Nov 23, 2024
1 parent e2a23e0 commit 2183f77
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions video/out/vo_gpu_next.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src
struct pl_frame *frame)
{
struct mp_image *mpi = src->frame_data;
const struct mp_image_params *par = &mpi->params;
struct mp_image_params par = mpi->params;
struct frame_priv *fp = mpi->priv;
struct vo *vo = fp->vo;
struct priv *p = vo->priv;
Expand All @@ -610,23 +610,25 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src
return false;
}

par = &p->hwdec_mapper->dst_params;
par = p->hwdec_mapper->dst_params;
}

mp_image_params_guess_csp(&par);

*frame = (struct pl_frame) {
.color = par->color,
.repr = par->repr,
.color = par.color,
.repr = par.repr,
.profile = {
.data = mpi->icc_profile ? mpi->icc_profile->data : NULL,
.len = mpi->icc_profile ? mpi->icc_profile->size : 0,
},
.rotation = par->rotate / 90,
.rotation = par.rotate / 90,
.user_data = mpi,
};

if (fp->hwdec) {

struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(par->imgfmt);
struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(par.imgfmt);
frame->acquire = hwdec_acquire;
frame->release = hwdec_release;
frame->num_planes = desc.num_planes;
Expand Down Expand Up @@ -686,7 +688,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src
}

// Update chroma location, must be done after initializing planes
pl_frame_set_chroma_location(frame, par->chroma_location);
pl_frame_set_chroma_location(frame, par.chroma_location);

if (mpi->film_grain)
pl_film_grain_from_av(&frame->film_grain, (AVFilmGrainParams *) mpi->film_grain->data);
Expand Down

0 comments on commit 2183f77

Please sign in to comment.