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
594594 struct pl_frame *frame)
595595 {
596596 struct mp_image *mpi = src->frame_data;
597− const struct mp_image_params *par = &mpi->params;
597+ struct mp_image_params par = mpi->params;
598598 struct frame_priv *fp = mpi->priv;
599599 struct vo *vo = fp->vo;
600600 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
610610 return false;
611611 }
612612
613− par = &p->hwdec_mapper->dst_params;
613+ par = p->hwdec_mapper->dst_params;
614614 }
615615
616+ mp_image_params_guess_csp(&par);
617+
616618 *frame = (struct pl_frame) {
617− .color = par->color,
618− .repr = par->repr,
619+ .color = par.color,
620+ .repr = par.repr,
619621 .profile = {
620622 .data = mpi->icc_profile ? mpi->icc_profile->data : NULL,
621623 .len = mpi->icc_profile ? mpi->icc_profile->size : 0,
622624 },
623− .rotation = par->rotate / 90,
625+ .rotation = par.rotate / 90,
624626 .user_data = mpi,
625627 };
626628
627629 if (fp->hwdec) {
628630
629− struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(par->imgfmt);
631+ struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(par.imgfmt);
630632 frame->acquire = hwdec_acquire;
631633 frame->release = hwdec_release;
632634 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
686688 }
687689
688690 // 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);
690692
691693 if (mpi->film_grain)
692694 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