summaryrefslogtreecommitdiff
path: root/src/lib/image.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-06-19 00:51:53 +0200
committerCarl Hetherington <cth@carlh.net>2023-06-19 00:51:53 +0200
commitd899a84fe6a37350a72f9d2350324c34fe3b1c59 (patch)
tree5477614d6ca14933a9debf80697af5c17c00b1ad /src/lib/image.cc
parent19823038e1a676dbcc38692fa20a4aa904230a08 (diff)
Set libswscale option which doesn't work.2564-alpha
Diffstat (limited to 'src/lib/image.cc')
-rw-r--r--src/lib/image.cc12
1 files changed, 12 insertions, 0 deletions
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 <libavutil/frame.h>
+#include <libavutil/opt.h>
#include <libavutil/pixdesc.h>
#include <libavutil/pixfmt.h>
#include <libswscale/swscale.h>
@@ -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) {