Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-102075

QVideoPlayer on iOS is not producing any frames

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS

    Description

      When setting QAbstractVideoSurface inheriting class(PlayerVideoSurface) like this.

      QUrl url("file:///video.mp4"); // or http resource
      auto surface = new PlayerVideoSurface;
      auto player = new QMediaPlayer;
      player->setVideoOutput(surface);
      player->setMedia(url);
      player->play();
      

      For desktop(Windows, Linux, macOS) and Android, it works as expected, that is
      after video player status change to LoadingMedia and then to BufferedMedia to finally become EndOfMedia, it can be seen that there are QMediaPlayer::positionChanged signals emitted and frames are presented in the present function of a PlayerVideoSurface.

      // Log from the sample project on macOS

      positionChanged:  0
      mediaStatusChanged:  QMediaPlayer::LoadingMedia
      stateChanged:  QMediaPlayer::PlayingState
      positionChanged:  0
      positionChanged:  0
      positionChanged:  0
      positionChanged:  0
      videoAvailableChanged:  true
      mediaStatusChanged:  QMediaPlayer::BufferedMedia
      start
      present, frame valid: true
      present, frame valid: true
      present, frame valid: true
      

      However, in iOS, PlayerVideoSurface::start() is never called and no frames are presented.
      There is no error reported. It happens with both local and/or remote resource. The video is still playable.

      // Log from iOS

      stale focus object 0x0 , doing manual update
      positionChanged:  0
      mediaStatusChanged:  QMediaPlayer::LoadingMedia
      stateChanged:  QMediaPlayer::PlayingState
      positionChanged:  0
      positionChanged:  0
      positionChanged:  0
      positionChanged:  0
      videoAvailableChanged:  true
      mediaStatusChanged:  QMediaPlayer::BufferedMedia
      positionChanged:  0
      positionChanged:  0
      positionChanged:  1
      positionChanged:  2
      positionChanged:  248
      positionChanged:  1246
      positionChanged:  2248
      

      How to reproduce
      https://github.com/bialasjaroslaw/qmediaplayer

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            laknoll Lars Knoll
            nagrohn Nahomi Gröhn (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes