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

QVideoFrames sent to QML as signal arguments are deallocated too late

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5, 6.7.3, 6.8
    • 6.8
    • Multimedia
    • None
    • All
    • 00558a91b (dev), 78d2f104a (6.8), 5f0a7f635 (6.7), 1c413c06b (tqtc/lts-6.5)

    Description

      When connecting to a signal inside a Connections QML type, objects received as arguments in that signal are kept alive until exiting the QML application. This seems like a memory leak.

      Edit: The objects are destroyed when the garbage collector is run, either automatically or by calling gc() in the QML code. The QVideoFrame issue described below happens because the gc is run only every 3-4 seconds during playback, which is too rare to avoid problems.

      When connecting to onVideoFrameChanged in VideoOutput.videoSink, it causes video playback to fail when using FFmpeg with VAAPI hardware texture conversion on Linux, because the QVideoFrames are occupying hw texture buffers. This is reported here: QTBUG-122757

      I've attached a reproducer simulating the behaviour of explicitly shared QVideoFrames (SharedTestObject) being sent to QML as signal arguments, but I also implemented a simple test object class (SimpleTestObject). I get the same behaviour / bug with both classes.

      Edit: Attached a new reproducer (including test video files) using MediaPlayer and VideoOutput QML types as in the original bug report. Running this on Linux with VAAPI causes playback to fail.

      Attachments

        Issue Links

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

          Activity

            People

              qtmultimediateam Qt Multimedia Team
              lars.sutterud Lars Sutterud
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes