Multithreading not effective for Camera frame processing on Samsung S4 (android 5.0)
I have app that processing video frames on Android phone. Frames grab by Qml Camera filter, and collect in synchronized buffer. Frame processing performed
in 2 additional qthreads. App works greate on Samsung galaxy j7 2016:
- without additional qthreads camera rate is 10 and processing rate is 10(all logic in QVideoFilterRunnable::run(QVideoFrame *, const QVideoSurfaceFormat &, RunFlags );
- with 2 additional qthreads camera rate 28 and processing rate is 26-28(processing is out of QVideoFilterRunnable::run :-)) .
But on Samsung galaxy s4 i9506:
- without additional qthreads camera rate is 10 and processing rate is 10(processing is in QVideoFilterRunnable::run);
- but with 2 additional threads (even only 1) camera rate is still near 10 and processing rate is near 10.
On all phones time of converting OpenGL texture to QImage is 15 - 20 ms (with additional threads and without). But on Galaxy s4 frames rarely come to filter in case with 1 additional processing thread (2 - the same situation). Camera rate should increase. The code does not change.
Theoretically, what could be the reason for such behavior? Why camera rate does not increase? J7 has 8 cores, and S4 - 4. J7 has Android 7.0, and S4 - Android 5.0.
The specs are pretty different so you can't expect the same level of performance for both phones. You are comparing phones with radically different processors, GPUS and RAM availability. Also the S7 camera is 12MP while the S4 is 13MP.