Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Phonon: Move disk access off the main thread
Forum Update on Monday, May 27th 2025

Phonon: Move disk access off the main thread

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.2k 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.
  • H Offline
    H Offline
    haikoschol
    wrote on last edited by
    #1

    Hi,

    I am writing a "digital signage" application that needs to run on Windows, Mac OS X and (maybe/later) Linux. The app displays various kinds of media in multiple zones on the screen. For example; A slideshow of images on the left side, videos on the right side and a text ticker on the bottom. The tricky part is, as one would expect ;), the ticker. I'm using QPropertyAnimation to animate the "pos" of a QLabel.

    This works fine until a new file gets loaded for the slide show or the video. AFAIK the QPropertyAnimation uses a QTimeLine or some other kind of timer that fires every 40 ms to achieve a decent framerate. Accessing the disk usually takes longer than 40 ms, which results in the ticker pausing.

    Since I can't put the ticker on another thread, I need to move the disk access off the main thread. To easily try different approaches, I've created a small test app that only contains the relevant parts. The code is available here: "http://bitbucket.org/haikoschol/tickertest":http://bitbucket.org/haikoschol/tickertest

    For images I've found a solution that works without taking up too much memory (as did simply caching all images); "http://bitbucket.org/haikoschol/tickertest/src/eb800a2c7474/imagecache.cpp":http://bitbucket.org/haikoschol/tickertest/src/eb800a2c7474/imagecache.cpp

    I'm sure this could be improved, but it works. Since videos can get really large, I can't do the same thing there. So I tried to at least create a MediaSource object in advance, in the hope of saving the disk seek time. This doesn't seem to make a difference, though. I considered subclassing QIODevice to buffer parts of the file on a thread, but then I found this in the docs: "Warning: On Windows, we only support QIODevices containing the avi, mp3, or mpg formats."

    Any ideas what else I could try?

    edit: fixed links

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Smar
      wrote on last edited by
      #2

      Would QtMultimedia in 4.7 be any good? From my experience, Phonon is more or less now only suitable for dummy playback, and nothing else.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        haikoschol
        wrote on last edited by
        #3

        I haven't looked into 4.7, yet. Will do that now. Thanks for the hint.

        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