Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for OpenFX plugins that only accept half-float or float pixel depths by extending depth negotiation and introducing rgba64↔(half/float) conversion utilities in the OpenFX module.
Changes:
- Extend supported OpenFX pixel depths to include
halfandfloat, and advertise these in host properties. - Add conversion helpers between MLT rgba64 and OFX half/float buffers (optionally OpenMP-parallelized).
- Update the OpenFX filter render path to negotiate depth and perform half/float conversions around the plugin render call.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
src/modules/openfx/mlt_openfx.h |
Extends depth mask and API surface for clip depth overrides and new conversion helpers. |
src/modules/openfx/mlt_openfx.c |
Implements half/float conversion utilities and wires new depth strings into host/clip metadata. |
src/modules/openfx/filter_openfx.c |
Updates format/depth negotiation and adds half/float render-buffer conversion around OFX Render. |
src/modules/openfx/CMakeLists.txt |
Adds optional OpenMP detection/linking for faster conversions. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/modules/openfx/mlt_openfx.c:1721
- Same issue as the source clip: when
ofx_depthis non-NULL,depth_byte_sizeis hard-coded as if the clip is RGBA andprop_componentremains RGBA, ignoringformat == mlt_image_rgb. This makeskOfxImagePropRowBytes/kOfxImageEffectPropComponentspotentially inconsistent with the actual frame layout.
Suggestion: always set component/channels from format first, then compute row-bytes from channels × bytes-per-component derived from depth_format (byte/short/half/float).
int depth_byte_size = 4;
const char *depth_format = kOfxBitDepthByte;
const char *prop_component = kOfxImageComponentRGBA;
if (ofx_depth) {
depth_format = ofx_depth;
if (!strcmp(ofx_depth, kOfxBitDepthFloat))
depth_byte_size = 16;
else if (!strcmp(ofx_depth, kOfxBitDepthShort) || !strcmp(ofx_depth, kOfxBitDepthHalf))
depth_byte_size = 8;
else
depth_byte_size = 4;
} else if (format == mlt_image_rgba64) {
depth_byte_size = 8;
depth_format = kOfxBitDepthShort;
} else if (format == mlt_image_rgb) {
depth_byte_size = 3;
prop_component = kOfxImageComponentRGB;
}
| } else if (strcmp(type, "integer") == 0 || strcmp(type, "string") == 0 | ||
| || strcmp(type, "boolean") == 0) { | ||
| int value = mlt_properties_anim_get_int(properties, param_name, position, length); | ||
| mltofx_param_set_value(image_effect_params, param_name, mltofx_prop_int, value); |
There was a problem hiding this comment.
update_plugin_params() treats type == "string" the same as integer/boolean: it reads an int (mlt_properties_anim_get_int) and calls mltofx_param_set_value(..., mltofx_prop_int, value). But mltofx_fetch_params() also maps real OFX kOfxParamTypeString params to type="string", and paramGetValueImpl() supports kOfxParamTypeString by reading MltOfxParamValue as a string. As a result, string parameters can never be set (and choice vs string cannot be distinguished).
Consider distinguishing choice vs real string (e.g., presence of a values property indicates choice), and for real strings read the string value from properties and call mltofx_param_set_value(..., mltofx_prop_string, ...). You’ll also need to extend paramSetValueImpl() in mlt_openfx.c to handle kOfxParamTypeString/kOfxParamTypeStrChoice by storing the string into MltOfxParamValue.
| } else if (strcmp(type, "integer") == 0 || strcmp(type, "string") == 0 | |
| || strcmp(type, "boolean") == 0) { | |
| int value = mlt_properties_anim_get_int(properties, param_name, position, length); | |
| mltofx_param_set_value(image_effect_params, param_name, mltofx_prop_int, value); | |
| } else if (strcmp(type, "integer") == 0 || strcmp(type, "boolean") == 0) { | |
| int value = mlt_properties_anim_get_int(properties, param_name, position, length); | |
| mltofx_param_set_value(image_effect_params, param_name, mltofx_prop_int, value); | |
| } else if (strcmp(type, "string") == 0) { | |
| char *values = mlt_properties_get(param, "values"); | |
| if (values) { | |
| int value = mlt_properties_anim_get_int(properties, param_name, position, length); | |
| mltofx_param_set_value(image_effect_params, param_name, mltofx_prop_int, value); | |
| } else { | |
| char *value = mlt_properties_get(properties, param_name); | |
| mltofx_param_set_value(image_effect_params, | |
| param_name, | |
| mltofx_prop_string, | |
| value ? value : ""); | |
| } |
No description provided.