I am confused, and don't know where I can be wrong.
Using my OpenCV lib, now I am translating some examples that I wrote using cameraEx, to JavaCameraView.
This class is executing some tasks on a different thread, with a Runnable.
From there, it raises an event. The called B4A Sub, will be executed in the same thread (non-UI) as the caller. I have added @RaisesSynchronousEvents before the "run()" in the Runnable.
A parameter is passed to the Sub, and the Sub modifies it in-place
Then, when the B4A Sub returns, the result is drawn into a surfaceView
There are some strange behaviours
My question: am I doing something wrong or is there any workaround?
Using my OpenCV lib, now I am translating some examples that I wrote using cameraEx, to JavaCameraView.
This class is executing some tasks on a different thread, with a Runnable.
From there, it raises an event. The called B4A Sub, will be executed in the same thread (non-UI) as the caller. I have added @RaisesSynchronousEvents before the "run()" in the Runnable.
A parameter is passed to the Sub, and the Sub modifies it in-place
Then, when the B4A Sub returns, the result is drawn into a surfaceView
There are some strange behaviours
- In release mode, it works correctly.--> OK
- In legacy debug mode, it also works, but if I put a breakpoint in the Sub, it crashes --> I think it is normal, and even think that I read about it somewhere, but can't remember where (if there is a post about it, please can someone give me the link?) --> so, let's assume that OK
- But rapid debug mode, even if without breakpoints, it works desynchronized (image has blinks and offsets). Also, operations are not performed (the shown result is the same as the original parameter, so it is as if it wasn't modified at all). This time I can place breakpoints in the Sub, but it seems as if in-place modifications are not working
My question: am I doing something wrong or is there any workaround?