Skip to content

Draft: Initial work on OpenFX module support#1051

Closed
joinlaw wants to merge 8 commits into
mltframework:masterfrom
joinlaw:openfx
Closed

Draft: Initial work on OpenFX module support#1051
joinlaw wants to merge 8 commits into
mltframework:masterfrom
joinlaw:openfx

Conversation

@joinlaw

@joinlaw joinlaw commented Nov 16, 2024

Copy link
Copy Markdown
Contributor

Since I reached presentable state I published this change so I can receive feedback from the community.

This video shows testing the module with the uk.co.thefoundry.OfxInvertExample openfx sample plugin:

openfxtest.mp4

Yes this implementation still lack many things such as opengl, draw suit (which is something the plugins could use for drawing vector graphics like post script or cairo), multi-threading, openfx logging extension and still many things ignored and implemented as dummy functions.

Also this is still under testing it crashes for my many times.

@ddennedy ddennedy marked this pull request as draft November 17, 2024 19:21
@ddennedy

Copy link
Copy Markdown
Member

I will require that you fix some bugs before you can submit new features. It is not fair to other developers if a person only does the more fun work of features but never helps fixing bugs.

@joinlaw

joinlaw commented Nov 20, 2024

Copy link
Copy Markdown
Contributor Author

I will require that you fix some bugs before you can submit new features. It is not fair to other developers if a person only does the more fun work of features but never helps fixing bugs.

That's fair. you have some bugs in mind? is it something related to my module (lv2, vst2) or in general?

@YakoYakoYokuYoku YakoYakoYokuYoku 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.

Just want to address the elephant in the room, ... where did you get the OpenFX headers? Just want this to be clarified so then its upstream is pulled for changes.

Comment thread src/modules/openfx/CMakeLists.txt Outdated

target_compile_options(mltopenfx PRIVATE ${MLT_COMPILE_OPTIONS})

target_link_libraries(mltopenfx PRIVATE mlt m)

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.

This assumes that every platform has libm though that might not be the case, just link it if it's needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed; I do not see math.h being included anywhere.

Comment thread src/modules/openfx/factory.c Outdated

static const char *getArchStr()
{
if(sizeof(void *) == 4) {

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.

I think that there's a precompiler definition out there that describes the architecture bits, look for it if there's one.

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.

I've found that there's __WORDSIZE from bits/wordsize.h and you can access that macro by including sys/cdefs.h.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seems to be unix only thing but if mlt built with MinGW64/MSYS it might be supported I'm not sure about that.

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.

I have a better alternative, SIZE_MAX from the standard C library.

#if SIZE_MAX == 0xFFFFFFFFFFFFFFFF // 64 bits
...
#elif SIZE_MAX == 0xFFFFFFFF // 32 bits
...
#else
#error "Unsupported architecture bits"
#endif

Comment thread src/modules/openfx/factory.c Outdated
MltOfxHost.host = (OfxPropertySetHandle) mlt_properties_new ();
mltofx_init_host_properties (MltOfxHost.host);

char *dir, *openfx_path = getenv("OFX_PLUGIN_PATH");

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.

Brilliant that you've thought ahead about multiple paths, though, is there a way to set a default?

Comment thread src/modules/openfx/factory.c Outdated

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.

You have lots of places that are yet to be worked on, and that's okay. I mean, this PR is meant to be the starting point. Albeit, I'd do a pair of things, comment TODO where appropriate to let know why the feature is incomplete and split suites into their own files to organize code better.

Comment thread src/modules/openfx/mlt_openfx.c Outdated
propSetString ((OfxPropertySetHandle) clip_prop, kOfxImagePropField, 0, kOfxImageFieldNone); /* I'm not sure about this */

char *tstr = calloc(1, strlen ("Output") + 11);
sprintf (tstr, "%s%04d%04d", "Output", rand () % 9999, rand () % 9999); /* WIP: do something better */

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.

There's a chance for collision if you use random numbers, but what about hashing? That's what Natron does.

Comment thread src/modules/openfx/mlt_openfx.c Outdated
Comment thread src/modules/openfx/mlt_openfx.h Outdated
Comment on lines +60 to +64
void
mltofx_set_source_clip_data (OfxPlugin *plugin, mlt_properties image_effect, uint8_t *image, int width, int height);

void
mltofx_set_output_clip_data (OfxPlugin *plugin, mlt_properties image_effect, uint8_t *image, int width, int height);

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.

Either name the first as mltofx_set_input_clip_data or the second as mltofx_set_destination_clip_data.

Comment thread src/modules/openfx/mlt_openfx.c Outdated
@luzpaz

luzpaz commented Aug 7, 2025

Copy link
Copy Markdown
Contributor

@joinlaw any response ?

@luzpaz

luzpaz commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

JFYI, that if/when this feature is merged the https://www.mltframework.org/changes/todo/ will need to be updated. OpenFX is in the 'Old Roadmap'

@joinlaw

joinlaw commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

JFYI, that if/when this feature is merged the https://www.mltframework.org/changes/todo/ will need to be updated. OpenFX is in the 'Old Roadmap'

Thank you for your curiosity.

Yes, I stopped working on this because of my personal situation I will do my best to get back working on this.

@joinlaw

joinlaw commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

Just want to address the elephant in the room, ... where did you get the OpenFX headers? Just want this to be clarified so then its upstream is pulled for changes.

From the official source:

https://github.com/AcademySoftwareFoundation/openfx

The license notice on every header refer to that also

@ddennedy

Copy link
Copy Markdown
Member

I want to close this PR because whenever you push to your branch, I am getting email notifications. Please wait until you are ready for review to open a new PR.

@ddennedy ddennedy closed this Aug 26, 2025
@luzpaz

luzpaz commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

@ddennedy but what if OP is utilizing the CIs for orientation and fixes as well ? If OP set this as draft would that be a workaround ?

@luzpaz

luzpaz commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

JFYI, that if/when this feature is merged the https://www.mltframework.org/changes/todo/ will need to be updated. OpenFX is in the 'Old Roadmap'

Note: kdenlive also points to this ticket as part of a Long Term Roadmap entry https://kdenlive.org/roadmap/#long-term

@luzpaz

luzpaz commented Sep 14, 2025

Copy link
Copy Markdown
Contributor

@joinlaw @mr.fantastic is there a place you're coordinating this (now that the PR has been closed) ? Besides master...joinlaw:mlt:openfx ?

@joinlaw

joinlaw commented Sep 14, 2025

Copy link
Copy Markdown
Contributor Author

@joinlaw @mr.fantastic is there a place you're coordinating this (now that the PR has been closed) ? Besides master...joinlaw:mlt:openfx ?

Yeah there is no other place. Anyway the code is more mature now and many plugins that didn't run before now running and I tested changing options from kdenlive and It works fine for comboboxes, sliders, and color buttons. More progress will happen when I'm free.

@luzpaz

luzpaz commented Sep 14, 2025

Copy link
Copy Markdown
Contributor

@joinlaw perhaps you can post on the kdenlive subforum ? https://discuss.kde.org/tag/kdenlive

cc @j-b-m @balooii @xwg2 (just putting this on your radar)

@smdstudios

Copy link
Copy Markdown

Why was this closed?

@luzpaz

luzpaz commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Why was this closed?

#1051 (comment)

When OP has a working version they plan to make a new PR

Edit: in the meantime you can follow their work on their branch https://github.com/joinlaw/mlt/tree/openfx

@luzpaz

luzpaz commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

@joinlaw any chance we can get this feature implemented, as a new years present ? 😊

@joinlaw joinlaw mentioned this pull request Dec 16, 2025
@luzpaz

luzpaz commented Dec 20, 2025

Copy link
Copy Markdown
Contributor

New PR #1186

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.

5 participants