Skip to content

Openfx filters#1271

Open
bmatherly wants to merge 4 commits into
masterfrom
openfx_filters
Open

Openfx filters#1271
bmatherly wants to merge 4 commits into
masterfrom
openfx_filters

Conversation

@bmatherly

Copy link
Copy Markdown
Member

This PR does not change the number of openfx filters that are available. It just skips registering a filter if it is a duplicate. It also adds some diagnostics that are useful when debugging plugin detection and capabilities.

Some plugins are registered twice in the library. This change will
not bother to create a filter service if it already exists.

Affected openfx plugins:
net.sf.openfx.HueCorrect
net.sf.openfx.MergePlugin
net.sf.openfx.MergePlus
net.sf.openfx.MergeMatte
net.sf.openfx.MergeMultiply
net.sf.openfx.MergeIn
net.sf.openfx.MergeOut
net.sf.openfx.MergeScreen
net.sf.openfx.MergeMax
net.sf.openfx.MergeMin
net.sf.openfx.MergeDifference
net.sf.openfx.MergeRoto
net.sf.openfx.Reformat
net.sf.openfx.ShufflePlugin
net.fxarena.openfx.Text
fr.inria.openfx.OIIOResize
net.sf.cimg.CImgBlur
net.sf.cimg.CImgLaplacian
net.sf.cimg.CImgChromaBlur
net.sf.cimg.CImgBloom
Only used for diagnostics, currently

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves OpenFX plugin discovery in the openfx module by adding optional diagnostics during repository initialization and by avoiding registering duplicate OpenFX filters (same derived MLT service key).

Changes:

  • Add compile-time toggles to enable OpenFX discovery diagnostics and optionally filter logs by plugin identifier substring.
  • Add detailed diagnostic logging around plugin detection decisions (load/describe/context/pixel-depth/clip info).
  • Skip registering OpenFX filters when the derived service key already exists.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
src/modules/openfx/mlt_openfx.h Adds diagnostic toggles and a helper to gate discovery logs.
src/modules/openfx/mlt_openfx.c Adds diagnostic logging helpers and logs acceptance/rejection reasons during plugin detection.
src/modules/openfx/factory.c Skips duplicate service keys and emits discovery/registration diagnostics during bundle scanning.

Comment on lines 2932 to 2940
if (status_code != kOfxStatOK) {
if (diagnostics) {
mlt_log_info(NULL,
"[openfx] rejected plugin `%s`: load failed status=%d\n",
plugin_id ? plugin_id : "(null)",
status_code);
}
return 0;
}
Comment on lines 2946 to 2955
if (status_code != kOfxStatOK) {
if (diagnostics) {
mlt_log_info(NULL,
"[openfx] rejected plugin `%s`: describe failed status=%d\n",
plugin_id ? plugin_id : "(null)",
status_code);
}
plugin->mainEntry(kOfxActionUnload, NULL, NULL, NULL);
return 0;
}
Comment on lines 2991 to 3000
if (i == count) {
if (diagnostics) {
mlt_log_info(NULL,
"[openfx] rejected plugin `%s`: missing filter context\n",
plugin_id ? plugin_id : "(null)");
}
mlt_log_debug(NULL, "[openfx] Plugin not a filter: %s\n", plugin->pluginIdentifier);
// since plugin is not filter then load fail so we must not unload it
return 0;
}
"[openfx] Plugin does not support byte, short, half, or float pixels: %s\n",
plugin->pluginIdentifier);
// since no pixel depth is supported by us then plugin is load fail so we must not unload it
return 0;
Comment on lines +3035 to +3040
if (describe_in_context_valid) {
if (diagnostics) {
mlt_log_info(NULL, "[openfx] accepted plugin `%s`\n", plugin_id ? plugin_id : "(null)");
}
return 1;
}
Comment on lines 266 to +269
char *s = NULL;
size_t pluginIdentifier_len = strlen(plugin_ptr->pluginIdentifier);
size_t pluginIdentifier_len = strlen(plugin_id);
s = malloc(pluginIdentifier_len + 8);
sprintf(s, "openfx.%s", plugin_ptr->pluginIdentifier);

// if colon `:` exists in plugin identifier
// change it to accent sign `^` because `:`
// can cause issues with mlt if put in filter
// name
sprintf(s, "openfx.%s", plugin_id);
Comment on lines 314 to 318
mlt_properties p = mlt_properties_new();
mlt_properties_set_properties(mltofx_context, s, p);
mlt_properties_close(p);
mlt_properties_set(p, "dli", dl_n);
mlt_properties_set_int(p, "index", i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants