Openfx filters#1271
Open
bmatherly wants to merge 4 commits into
Open
Conversation
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
Contributor
There was a problem hiding this comment.
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.