summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-11-04 07:10:31 +0100
committerDudemanguy <random342@airmail.cc>2024-01-22 14:54:55 +0000
commit431759c70c1dcd00e5726747c16022c0ff582732 (patch)
tree56beda771945b3670bb793d3fa9b41ea3bf59143
parent475f76dc6d0154a109cb83d123e1839d22455ef8 (diff)
downloadmpv-431759c70c1dcd00e5726747c16022c0ff582732.tar.bz2
mpv-431759c70c1dcd00e5726747c16022c0ff582732.tar.xz
vo_gpu_next: simplify after recent changes
-rw-r--r--video/out/vo_gpu_next.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 06a9ce4a4f..7df0966eca 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -238,8 +238,6 @@ static struct mp_image *get_image(struct vo *vo, int imgfmt, int w, int h,
return mpi;
}
-static struct pl_color_space get_mpi_csp(struct vo *vo, struct mp_image *mpi);
-
static void update_overlays(struct vo *vo, struct mp_osd_res res,
int flags, enum pl_overlay_coords coords,
struct osd_state *state, struct pl_frame *frame,
@@ -322,7 +320,7 @@ static void update_overlays(struct vo *vo, struct mp_osd_res res,
ol->repr.alpha = PL_ALPHA_PREMULTIPLIED;
// Infer bitmap colorspace from source
if (src) {
- ol->color = get_mpi_csp(vo, src);
+ ol->color = src->params.color;
// Seems like HDR subtitles are targeting SDR white
if (pl_color_transfer_is_hdr(ol->color.transfer)) {
ol->color.hdr = (struct pl_hdr_metadata) {
@@ -441,16 +439,6 @@ static int plane_data_from_imgfmt(struct pl_plane_data out_data[4],
return desc.num_planes;
}
-static struct pl_color_space get_mpi_csp(struct vo *vo, struct mp_image *mpi)
-{
- struct pl_color_space csp = {
- .primaries = mpi->params.color.primaries,
- .transfer = mpi->params.color.transfer,
- .hdr = mpi->params.color.hdr,
- };
- return csp;
-}
-
static bool hwdec_reconfig(struct priv *p, struct ra_hwdec *hwdec,
const struct mp_image_params *par)
{
@@ -571,12 +559,8 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src
}
*frame = (struct pl_frame) {
- .color = get_mpi_csp(vo, mpi),
- .repr = {
- .sys = par->repr.sys,
- .levels = par->repr.levels,
- .alpha = par->repr.alpha,
- },
+ .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,
@@ -940,7 +924,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
}
if (p->target_hint && frame->current) {
- struct pl_color_space hint = get_mpi_csp(vo, frame->current);
+ struct pl_color_space hint = frame->current->params.color;
if (opts->target_prim)
hint.primaries = opts->target_prim;
if (opts->target_trc)