diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0eb3f5b4d9188..0bea8ec89a670 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -528,7 +528,7 @@ jobs: uses: cross-platform-actions/action@v0.32.0 with: operating_system: freebsd - version: '14.3' + version: '15.0' run: | sudo pkg update sudo pkg install -y \ diff --git a/ci/build-freebsd.sh b/ci/build-freebsd.sh index 69239b9a15dec..7ac7c4010273f 100755 --- a/ci/build-freebsd.sh +++ b/ci/build-freebsd.sh @@ -9,6 +9,11 @@ export LDFLAGS="$LDFLAGS -L/usr/local/lib" # TODO: re-add -Ddvbin=enabled +mkdir -p subprojects +git clone https://code.videolan.org/videolan/libplacebo.git \ + --recurse-submodules --shallow-submodules \ + --depth=1 --branch v7.360.1 subprojects/libplacebo + meson setup build $common_args \ -Db_sanitize=address,undefined \ -Diconv=disabled \ diff --git a/ci/build-linux-old.sh b/ci/build-linux-old.sh index 054adaf217e61..6e91d7b76e1d6 100755 --- a/ci/build-linux-old.sh +++ b/ci/build-linux-old.sh @@ -3,6 +3,11 @@ set -e . ./ci/build-common.sh +mkdir -p subprojects +git clone https://code.videolan.org/videolan/libplacebo.git \ + --recurse-submodules --shallow-submodules \ + --depth=1 --branch v7.360.1 subprojects/libplacebo + meson setup build $common_args \ -Dlibplacebo:vulkan=disabled \ -Dlua=enabled \ diff --git a/ci/build-openbsd.sh b/ci/build-openbsd.sh index 7da5f4e6e4807..e82aa7ca2a48e 100755 --- a/ci/build-openbsd.sh +++ b/ci/build-openbsd.sh @@ -3,6 +3,11 @@ set -e . ./ci/build-common.sh +mkdir -p subprojects +git clone https://code.videolan.org/videolan/libplacebo.git \ + --recurse-submodules --shallow-submodules \ + --depth=1 --branch v7.360.1 subprojects/libplacebo + meson setup build $common_args \ -Dffmpeg:vulkan=auto \ -Dffmpeg:werror=false \ diff --git a/meson.build b/meson.build index 5ffe5597688f2..84b41dface1ec 100644 --- a/meson.build +++ b/meson.build @@ -26,7 +26,7 @@ libavutil = dependency('libavutil', version: '>= 58.29.100') libswresample = dependency('libswresample', version: '>= 4.12.100') libswscale = dependency('libswscale', version: '>= 7.5.100') -libplacebo = dependency('libplacebo', version: '>=6.338.2', +libplacebo = dependency('libplacebo', version: '>=7.360.1', default_options: ['default_library=static', 'demos=false']) libass = dependency('libass', version: '>= 0.12.2') diff --git a/player/command.c b/player/command.c index ae38ed9c8b297..751f676921598 100644 --- a/player/command.c +++ b/player/command.c @@ -2422,16 +2422,9 @@ static int property_imgparams(const struct mp_image_params *p, int action, void for (int i = 0; i < desc.num_planes; i++) bpp += desc.bpp[i] >> (desc.xs[i] + desc.ys[i]); -#if PL_API_VER >= 344 // If PL_ALPHA_NONE is supported, use it directly, unless in auto mode. if ((desc.flags & MP_IMGFLAG_ALPHA) && alpha == PL_ALPHA_UNKNOWN) alpha = PL_ALPHA_INDEPENDENT; -#else - // Alpha type is not supported by FFmpeg, so PL_ALPHA_UNKNOWN may mean alpha - // is of an unknown type, or simply not present. Normalize to AUTO=no alpha. - if (!!(desc.flags & MP_IMGFLAG_ALPHA) != (alpha != PL_ALPHA_UNKNOWN)) - alpha = (desc.flags & MP_IMGFLAG_ALPHA) ? PL_ALPHA_INDEPENDENT : PL_ALPHA_UNKNOWN; -#endif } const struct pl_hdr_metadata *hdr = &p->color.hdr; diff --git a/video/csputils.c b/video/csputils.c index 2f50fbd2311d1..0b618afc6a2dc 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -43,10 +43,8 @@ const struct m_opt_choice_alternatives pl_csp_names[] = { {"rgb", PL_COLOR_SYSTEM_RGB}, {"xyz", PL_COLOR_SYSTEM_XYZ}, {"ycgco", PL_COLOR_SYSTEM_YCGCO}, -#if PL_API_VER >= 358 {"ycgco-re", PL_COLOR_SYSTEM_YCGCO_RE}, {"ycgco-ro", PL_COLOR_SYSTEM_YCGCO_RO}, -#endif {0} }; @@ -127,9 +125,7 @@ const struct m_opt_choice_alternatives pl_alpha_names[] = { {"auto", PL_ALPHA_UNKNOWN}, {"straight", PL_ALPHA_INDEPENDENT}, {"premul", PL_ALPHA_PREMULTIPLIED}, -#if PL_API_VER >= 344 {"none", PL_ALPHA_NONE}, -#endif {0} }; diff --git a/video/mp_image.c b/video/mp_image.c index b289f51cdb714..f73f44a1d30b2 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -196,11 +196,7 @@ void mp_image_sethwfmt(struct mp_image *mpi, enum mp_imgfmt hw_fmt, enum mp_imgf mpi->imgfmt = hw_fmt; mpi->num_planes = fmt.num_planes; mpi->params.repr.alpha = (fmt.flags & MP_IMGFLAG_ALPHA) ? PL_ALPHA_INDEPENDENT -#if PL_API_VER >= 344 : PL_ALPHA_NONE; -#else - : PL_ALPHA_UNKNOWN; -#endif // Calculate bit encoding from all components (excluding alpha) struct pl_bit_encoding bits = {0}; const int num_comps = mp_imgfmt_desc_get_num_comps(&fmt); @@ -978,11 +974,9 @@ void mp_image_params_guess_csp(struct mp_image_params *params) params->repr.sys != PL_COLOR_SYSTEM_BT_2100_HLG && params->repr.sys != PL_COLOR_SYSTEM_DOLBYVISION && params->repr.sys != PL_COLOR_SYSTEM_SMPTE_240M && - params->repr.sys != PL_COLOR_SYSTEM_YCGCO -#if PL_API_VER >= 358 - && params->repr.sys != PL_COLOR_SYSTEM_YCGCO_RE - && params->repr.sys != PL_COLOR_SYSTEM_YCGCO_RO -#endif + params->repr.sys != PL_COLOR_SYSTEM_YCGCO && + params->repr.sys != PL_COLOR_SYSTEM_YCGCO_RE && + params->repr.sys != PL_COLOR_SYSTEM_YCGCO_RO ) { // Makes no sense, so guess instead // YCGCO should be separate, but libavcodec disagrees @@ -1130,12 +1124,12 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) dst->params.stereo3d = p->stereo3d; // Might be incorrect if colorspace changes. dst->params.light = p->light; -#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(60, 11, 100) || PL_API_VER < 356 +#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(60, 11, 100) dst->params.repr.alpha = p->repr.alpha; #endif } -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(60, 11, 100) && PL_API_VER >= 356 +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(60, 11, 100) // mp_image_setfmt sets to PL_ALPHA_INDEPENDENT, if format has alpha. if (dst->params.repr.alpha == PL_ALPHA_INDEPENDENT) dst->params.repr.alpha = pl_alpha_from_av(src->alpha_mode); @@ -1183,17 +1177,8 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) if (header->disable_residual_flag) { dst->dovi = dovi = av_buffer_alloc(sizeof(struct pl_dovi_metadata)); MP_HANDLE_OOM(dovi); -#if PL_API_VER >= 343 pl_map_avdovi_metadata(&dst->params.color, &dst->params.repr, (void *)dst->dovi->data, metadata); -#else - struct pl_frame frame; - frame.repr = dst->params.repr; - frame.color = dst->params.color; - pl_frame_map_avdovi_metadata(&frame, (void *)dst->dovi->data, metadata); - dst->params.repr = frame.repr; - dst->params.color = frame.color; -#endif } #endif } diff --git a/video/out/d3d11/context.c b/video/out/d3d11/context.c index d51e0cc1ccf88..70c5f497079a5 100644 --- a/video/out/d3d11/context.c +++ b/video/out/d3d11/context.c @@ -597,7 +597,6 @@ void ra_d3d11_ctx_set_swapchain_params(struct ra_ctx *ra, struct priv *p = ra->priv; int fmt = p->opts->output_format; -#if PL_API_VER >= 360 switch (fmt) { case DXGI_FORMAT_R8G8B8A8_UNORM: case DXGI_FORMAT_B8G8R8A8_UNORM: @@ -618,10 +617,6 @@ void ra_d3d11_ctx_set_swapchain_params(struct ra_ctx *ra, default: params->alpha_bits = ra->opts.want_alpha ? 8 : 0; }; -#else - if (fmt == DXGI_FORMAT_R8G8B8A8_UNORM || fmt == DXGI_FORMAT_B8G8R8A8_UNORM) - params->disable_10bit_sdr = true; -#endif } #endif diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 0968bdb6385bd..2e2369b7bed53 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -200,12 +200,8 @@ const struct m_sub_options gl_next_conf = { {"none", BACKGROUND_NONE}, {"color", BACKGROUND_COLOR}, {"tiles", BACKGROUND_TILES} -#if PL_API_VER < 355 - )}, -#else ,{"blur", BACKGROUND_BLUR})}, {"background-blur-radius", OPT_FLOAT(background_blur_radius)}, -#endif {"corner-rounding", OPT_FLOAT(corner_rounding), M_RANGE(0, 1)}, {"interpolation-preserve", OPT_BOOL(inter_preserve)}, {"lut", OPT_STRING(lut.opt), .flags = M_OPT_FILE}, @@ -942,17 +938,13 @@ static void apply_crop(struct pl_frame *frame, struct mp_rect crop, static bool set_colorspace_hint(struct priv *p, struct pl_color_space *hint) { struct ra_swapchain *sw = p->ra_ctx->swapchain; - enum pl_alpha_mode alpha = PL_ALPHA_UNKNOWN; -#if PL_API_VER >= 344 - alpha = PL_ALPHA_NONE; -#endif struct mp_image_params params = { .color = hint ? *hint : pl_color_space_srgb, .repr = { .sys = PL_COLOR_SYSTEM_RGB, .levels = p->output_levels ? p->output_levels : PL_COLOR_LEVELS_FULL, - .alpha = p->ra_ctx->opts.want_alpha ? PL_ALPHA_INDEPENDENT : alpha, + .alpha = p->ra_ctx->opts.want_alpha ? PL_ALPHA_INDEPENDENT : PL_ALPHA_NONE, }, }; @@ -1242,10 +1234,8 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame) .pts = frame->current->pts + pts_offset, .radius = pl_frame_mix_radius(¶ms), .vsync_duration = can_interpolate ? frame->ideal_frame_vsync_duration : 0, + .drift_compensation = 0, ); -#if PL_API_VER >= 340 - qparams.drift_compensation = 0; -#endif pl_queue_update(p->queue, NULL, &qparams); } return VO_FALSE; @@ -1323,10 +1313,8 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame) .radius = pl_frame_mix_radius(¶ms), .vsync_duration = can_interpolate ? frame->ideal_frame_vsync_duration : 0, .interpolation_threshold = opts->interpolation_threshold, + .drift_compensation = 0, ); -#if PL_API_VER >= 340 - qparams.drift_compensation = 0; -#endif // Depending on the vsync ratio, we may be up to half of the vsync // duration before the current frame time. This works fine because @@ -1586,10 +1574,8 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args) enum pl_queue_status status; struct pl_queue_params qparams = *pl_queue_params( .pts = p->last_pts, + .drift_compensation = 0, ); -#if PL_API_VER >= 340 - qparams.drift_compensation = 0; -#endif status = pl_queue_update(p->queue, &mix, &qparams); mp_assert(status != PL_QUEUE_EOF); if (status == PL_QUEUE_ERR) { @@ -2497,23 +2483,15 @@ static void update_render_options(struct vo *vo) pars->params.disable_linear_scaling = !opts->linear_downscaling && !opts->linear_upscaling; pars->params.disable_fbos = opts->dumb_mode == 1; -#if PL_API_VER >= 346 static const int map_background_types[] = { [BACKGROUND_NONE] = PL_CLEAR_SKIP, [BACKGROUND_COLOR] = PL_CLEAR_COLOR, [BACKGROUND_TILES] = PL_CLEAR_TILES, -#if PL_API_VER >= 355 [BACKGROUND_BLUR] = PL_CLEAR_BLUR, -#endif }; pars->params.background = map_background_types[opts->background]; pars->params.border = map_background_types[p->next_opts->border_background]; -#if PL_API_VER >= 355 pars->params.blur_radius = p->next_opts->background_blur_radius; -#endif -#else - pars->params.blend_against_tiles = opts->background == BACKGROUND_TILES; -#endif pars->params.tile_size = opts->background_tile_size * 2; for (int i = 0; i < 2; ++i) { pars->params.tile_colors[i][0] = opts->background_tile_color[i].r / 255.0f; diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index efa72121054a8..9528a04f87bf6 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -425,9 +425,7 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk, .surface = vk->surface, .present_mode = preferred_mode, .swapchain_depth = ctx->vo->opts->swapchain_depth, -#if PL_API_VER >= 359 .alpha_bits = ctx->opts.want_alpha ? 8 : 0, -#endif }; if (p->opts->swap_mode >= 0) // user override