Problem with QML Video in Android
-
Hi!
I'm developing an app for android and faced with very strange problem.
This is my simple QML code:import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtMultimedia 5.7ApplicationWindow {
visible: true
width: 640
height: 480property int counter property string fileName: "file:///sdcard/Android/data/resources/004.mp4"
// property string fileName: "file:E:/Programm/CRM/Crm2/resources/004.mp4"
Video {
id: video
anchors.fill: parent
volume: 0property bool allowed: true onPlaying: { console.log("Playback started"); } onStatusChanged: { console.log("StatusChanged", video.status, video.source); if (video.status === MediaPlayer.EndOfMedia ) { console.log("++++++++++++++++++LOOP N ++++++++++++ ", counter); counter++; } } onErrorChanged: { console.log("Error....", video.errorString); } onPaused: { console.log("pause") } onStopped: { console.log("Stopped... Click to play again...") } onSourceChanged: { console.log("source changed", video.source) } onStateChanged: { console.log("STATE changed", video.playbackState) }
}
MouseArea {
anchors.fill: parent
onClicked: {
if (video.playbackState === MediaPlayer.StoppedState ){
console.log("CLICK TO PLAY AGAIN...")
video.playlist = pl;
video.play();
}}
}
Playlist {
id: pl
playbackMode: Playlist.LoopComponent.onCompleted: { addItem(fileName); }
}
}
This code works fine in Windows. It working some days long...
But not Android.
In Android 4.2.2 it works 250 sycles of repeat. 512 MB memory
In Android 4.4.2 it works about 600 sycles of repeat. 1 GB memory
And at the same device the limit of repeats is exectly the same.The error is:
E/EGL-ERROR: mali_image* _egl_android_map_native_buffer_yuv(android_native_buffer_t*):329: Unable to set data for YUV image (format: 12530)
E/GLConsumer(16280): [unnamed-16280-563] error creating EGLImage: 0x3003
W/GLConsumer(16280): [unnamed-16280-563] updateAndRelease: unable to createImage on display=0x1 slot=4
E/BufferQueue(16280): [unnamed-16280-563] acquireBuffer: max acquired buffer count reached: 2 (max=1)
E/GLConsumer(16280): [unnamed-16280-563] updateTexImage: acquire failed: Function not implemented (-38)
W/JNIHelp (16280): Discarding pending exception (java.lang.RuntimeException: Error during updateTexImage (see logcat for details)) to throw java/lang/IllegalStateExceptionEnybody can help???