Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vo_gpu_next: fix mp_image colorspace with some hwdecs #15357

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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