|
1 | 1 | /* |
2 | 2 | * frei0r_helper.c -- frei0r helper |
3 | 3 | * Copyright (c) 2008 Marco Gittler <g.marco@freenet.de> |
4 | | - * Copyright (C) 2009-2023 Meltytech, LLC |
| 4 | + * Copyright (C) 2009-2025 Meltytech, LLC |
5 | 5 | * |
6 | 6 | * This library is free software; you can redistribute it and/or |
7 | 7 | * modify it under the terms of the GNU Lesser General Public |
|
19 | 19 | */ |
20 | 20 | #include "frei0r_helper.h" |
21 | 21 | #include <frei0r.h> |
22 | | -#include <stdlib.h> |
23 | 22 | #include <string.h> |
24 | 23 | #ifdef _WIN32 |
25 | 24 | #include <windows.h> |
@@ -93,6 +92,7 @@ int process_frei0r_item(mlt_service service, |
93 | 92 | { |
94 | 93 | int i = 0; |
95 | 94 | mlt_properties prop = MLT_SERVICE_PROPERTIES(service); |
| 95 | + mlt_properties frame_properties = MLT_FRAME_PROPERTIES(frame); |
96 | 96 | f0r_instance_t (*f0r_construct)(unsigned int, unsigned int) |
97 | 97 | = mlt_properties_get_data(prop, "f0r_construct", NULL); |
98 | 98 | if (!f0r_construct) { |
@@ -191,11 +191,11 @@ int process_frei0r_item(mlt_service service, |
191 | 191 |
|
192 | 192 | // Special cairoblend handling for an override from the cairoblend_mode filter. |
193 | 193 | if (is_cairoblend && i == 1) { |
194 | | - if (mlt_properties_get(MLT_FRAME_PROPERTIES(frame), CAIROBLEND_MODE_PROPERTY)) { |
| 194 | + if (mlt_properties_get(frame_properties, CAIROBLEND_MODE_PROPERTY)) { |
195 | 195 | name = CAIROBLEND_MODE_PROPERTY; |
196 | | - prop = MLT_FRAME_PROPERTIES(frame); |
| 196 | + prop = frame_properties; |
197 | 197 | val = mlt_properties_get(prop, name); |
198 | | - } else if (!val && !mlt_properties_get(MLT_FRAME_PROPERTIES(frame), name)) { |
| 198 | + } else if (!val && !mlt_properties_get(frame_properties, name)) { |
199 | 199 | // Reset plugin back to its default value. |
200 | 200 | char *default_val = "normal"; |
201 | 201 | char *plugin_val = NULL; |
@@ -242,6 +242,10 @@ int process_frei0r_item(mlt_service service, |
242 | 242 | = mlt_properties_get(prop, index) |
243 | 243 | ? mlt_properties_anim_get_color(prop, index, position, length) |
244 | 244 | : mlt_properties_anim_get_color(prop, pinfo.name, position, length); |
| 245 | + if (type != mlt_service_producer_type) { |
| 246 | + const char *trc = mlt_properties_get(frame_properties, "color_trc"); |
| 247 | + m_color = mlt_color_convert_trc(m_color, trc); |
| 248 | + } |
245 | 249 | f_color.r = (float) m_color.r / 255.0f; |
246 | 250 | f_color.g = (float) m_color.g / 255.0f; |
247 | 251 | f_color.b = (float) m_color.b / 255.0f; |
|
0 commit comments