From d899a84fe6a37350a72f9d2350324c34fe3b1c59 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 19 Jun 2023 00:51:53 +0200 Subject: [PATCH] Set libswscale option which doesn't work. --- src/lib/image.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/image.cc b/src/lib/image.cc index 3aba3ebd5..868245397 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -40,6 +40,7 @@ LIBDCP_DISABLE_WARNINGS extern "C" { #include +#include #include #include #include @@ -260,6 +261,17 @@ Image::crop_scale_window ( 0, 1 << 16, 1 << 16 ); + static int64_t uniform_color = -1; + if (uniform_color == -1) { + // auto error = av_opt_get_int(scale_context, "uniform_color", AV_OPT_SEARCH_CHILDREN, &uniform_color); + auto option = av_opt_find2(scale_context, "uniform_color", "alphablend", 0, AV_OPT_SEARCH_CHILDREN, nullptr); + DCPOMATIC_ASSERT(option->type == AV_OPT_TYPE_CONST); + uniform_color = option->default_val.i64; + std::cout << "uniform_color=" << uniform_color << "\n"; + } + + std::cout << "set it: " << av_opt_set_int(scale_context, "alphablend", uniform_color, AV_OPT_SEARCH_CHILDREN) << "\n"; + /* Prepare input data pointers with crop */ uint8_t* scale_in_data[planes()]; for (int c = 0; c < planes(); ++c) { -- 2.30.2