Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 5 additions & 0 deletions ci/build-freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 5 additions & 0 deletions ci/build-linux-old.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 5 additions & 0 deletions ci/build-openbsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
7 changes: 0 additions & 7 deletions player/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions video/csputils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};

Expand Down Expand Up @@ -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}
};

Expand Down
25 changes: 5 additions & 20 deletions video/mp_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
}
Expand Down
5 changes: 0 additions & 5 deletions video/out/d3d11/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
30 changes: 4 additions & 26 deletions video/out/vo_gpu_next.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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,
},
};

Expand Down Expand Up @@ -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(&params),
.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;
Expand Down Expand Up @@ -1323,10 +1313,8 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame)
.radius = pl_frame_mix_radius(&params),
.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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions video/out/vulkan/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading