Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem with QML Video in Android
Forum Updated to NodeBB v4.3 + New Features

Problem with QML Video in Android

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sergio66
    wrote on last edited by
    #1

    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.7

    ApplicationWindow {
    visible: true
    width: 640
    height: 480

    property 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: 0

    property 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.Loop

    Component.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/IllegalStateException

    Enybody can help???

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved