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. QVideoFilterRunnable
Forum Updated to NodeBB v4.3 + New Features

QVideoFilterRunnable

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 161 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.
  • T Offline
    T Offline
    Task Slayer
    wrote on last edited by Task Slayer
    #1

    Hello, I am looking for a possible implementation idea for my problem. I want to periodically (200ms) wake up a function to perform some arithmetic computation on the current QVideoFrame.

    I am using a QVideoFilterRunnable class to access the QVideoFrame of the current frame. In the QVideoFilterRunnable::run(), I obtain the pixel data for the frame and want to perform some synchronous processing of the pixel data.

    Originally, I was going to implement a QTimer within the QVideoFilterRunnable::run() and wait a certain time, obtain the frame and do some arithmetic on it. There were two problems with this approach:

    1. This will block the main GUI thread until the run() is completed.
    2. I was hoping to obtain different frames, rather than the same frame. Example: If we execute QVideoFilterRunnable::run(), obtain that QVideoFrame, wait 200ms, then obtain the next QVideoFrame, it will still be same frame; regardless of the time. To obtain the next frame, we need the previous run() to finish and execute QVideoFilterRunnable::run() again for the next frame. This brings me to my problem.

    I was hoping to implement some sort of thread that wakes up periodically, checks the QVideoFrame from QVideoFilterRunnable::run(), and performs this arithmetic computation. I have come across a couple possible implementations but not sure which one is the best. People recommended using QtConcurrent::run() in the timer slot to run a method in which you handle this but I am fairly new with QtConcurrent and another approach with using QFutureWatcher.

    How would you, the qt experts, go around to solving this problem?

    Any ideas will help,

    Thanks

    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