History

vo_gpu_next: fix mp_image colorspace with some hwdecs

Kacper Michajłow committed 1 year ago

Commit 2183f771 parent e2a23e01 file · +9 −7Browse files

Unified · Split

video/out/vo_gpu_next.c+9−7
@@ -594,7 +594,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src · 593 unmodified lines
594 struct pl_frame *frame)594 struct pl_frame *frame)
595{595{
596 struct mp_image *mpi = src->frame_data;596 struct mp_image *mpi = src->frame_data;
597 const struct mp_image_params *par = &mpi->params;597 struct mp_image_params par = mpi->params;
598 struct frame_priv *fp = mpi->priv;598 struct frame_priv *fp = mpi->priv;
599 struct vo *vo = fp->vo;599 struct vo *vo = fp->vo;
600 struct priv *p = vo->priv;600 struct priv *p = vo->priv;
@@ -610,23 +610,25 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src · 9 unmodified lines
610 return false;610 return false;
611 }611 }
612 612
613 par = &p->hwdec_mapper->dst_params;613 par = p->hwdec_mapper->dst_params;
614 }614 }
615 615
616 mp_image_params_guess_csp(&par);
617
616 *frame = (struct pl_frame) {618 *frame = (struct pl_frame) {
617 .color = par->color,619 .color = par.color,
618 .repr = par->repr,620 .repr = par.repr,
619 .profile = {621 .profile = {
620 .data = mpi->icc_profile ? mpi->icc_profile->data : NULL,622 .data = mpi->icc_profile ? mpi->icc_profile->data : NULL,
621 .len = mpi->icc_profile ? mpi->icc_profile->size : 0,623 .len = mpi->icc_profile ? mpi->icc_profile->size : 0,
622 },624 },
623 .rotation = par->rotate / 90,625 .rotation = par.rotate / 90,
624 .user_data = mpi,626 .user_data = mpi,
625 };627 };
626 628
627 if (fp->hwdec) {629 if (fp->hwdec) {
628 630
629 struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(par->imgfmt);631 struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(par.imgfmt);
630 frame->acquire = hwdec_acquire;632 frame->acquire = hwdec_acquire;
631 frame->release = hwdec_release;633 frame->release = hwdec_release;
632 frame->num_planes = desc.num_planes;634 frame->num_planes = desc.num_planes;
@@ -686,7 +688,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src · 53 unmodified lines
686 }688 }
687 689
688 // Update chroma location, must be done after initializing planes690 // Update chroma location, must be done after initializing planes
689 pl_frame_set_chroma_location(frame, par->chroma_location);691 pl_frame_set_chroma_location(frame, par.chroma_location);
690 692
691 if (mpi->film_grain)693 if (mpi->film_grain)
692 pl_film_grain_from_av(&frame->film_grain, (AVFilmGrainParams *) mpi->film_grain->data);694 pl_film_grain_from_av(&frame->film_grain, (AVFilmGrainParams *) mpi->film_grain->data);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t