I am working on a new filter (the gps graphic one) and I have a few questions related to coding that don’t deserve individual threads.
What does this
_filter_privatedo? (as in:
mlt_properties_set_int( properties, "_filter_private", 1 );) I found the description (“Set this on a service to ensure that attached filters are handled privately”) but I still don’t know what it does or if I need it. Does this have an interaction with 3.?
One of the filters I looked at/inspired from had this check in filter process:
mlt_frame_is_test_card( frame ), from the references list it seems to be used only by audio filters but I don’t really understand what a test card is (I assume it’s testing for image presence?). I’m using QT to draw my stuff whether there is or not an image below, I’m thinking this might be needed to still be able to draw?
What exactly does parallel processing do in the export panel from the code perspective?
Here’s the context I’m asking this: I noticed that if I have more than 2-3 instances of my filter active, the export fails (with the popular -1073741819 code), but then it retries without parallel processing and it succeeds.
I did find a “workaround” as this started happening when I moved some code from the filter_process() call into the filter_get_image() call. This [=moving the code to filter_process()] seems to completely fix the parallel export issue BUT it somehow doesn’t work for my filter logic: I have some processing there that calculates the in-graph position depending on a UI property and current video time and if I read&calculate this in filter_process() the output does some jerky movement instead of smoothly panning around.
So this is what I’m trying to understand, how are filter_process() and filter_get_image() called when doing parallel processing and how/at what point is filter private_data struct or the filter properties I read get changed. I assume that one of these is read once for every batch of threads so it’s using a mix of previous and current data which makes the movement not appear smooth.
Is the private data duplicated for each “thread” if doing parallel or are they using the same memory and my crash is related to concurrent memory read/writes? How does this interact with reading filter properties? Is it done once per batch of threads?
Edit: ok, for 3. the parallel error might have been a coding mistake, it doesn’t crash anymore after a few code changes.