I have the Qt realtime broadcasting chat application for Android (v 4.1, API 16), that sends H.264/AAC chunks to RTMP server.
For now, application uses SurfaceView
for capturing frames from Camera
and in onPreviewFrame
function I encode frames to H.264 chunks and in other Thread
I create RTMP chunks, that sending to RTMP server, as I wrote above.
Background is transparent (with Qt::WindowStaysOnTopHint
flag) and QML UI draws above Camera
's SurfaceView
- works pretty well, without lags and other. But, when I tried to use QML's TextArea
(for writing chat messages), that also above SurfaceView
, there is a very long delays on some devices (and not on Samsung's) when I press on any key on Android's virtual keyboard, that did this app absolutely unusable. For example, I type "LAG" on keyboard, and there is 3-4 second delay between showing every symbol in TextArea
))): SurfaceView
and broadcast works without lags.
So, dear developers, what I shall do to solve this problem?
For now, I moved Camera
's preview to SurfaceTexture
and draw it using Qt's QSGGeometryNode
, but there is another problem: how to read pixels from SurfaceTexture
more efficient? Is it possible to make performance faster or similar to onPreviewFrame
? May be I am moving in wrong direction and I can do some trick with TextArea
?
Thanks!