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. Recomendations to create a logic for a video buffer
QtWS25 Last Chance

Recomendations to create a logic for a video buffer

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 537 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.
  • A Offline
    A Offline
    aurquiel
    wrote on last edited by aurquiel
    #1

    Hello i am trying to do the logic for implement a buffer and there are some questions about it.

    I am receiving data from usb, the function of usb receiving returns a buffer

    That buffer i have to send it to video player.

    Here is the first question, the program always are going to be receiving data and the player will read it simultaneously, maybe sounds silly, but the buffer that reads the player always are going to be expand it, getting more a more bigger because i always be storing the data there for the player reads it. How to avoid the buffer gets bigger without interrupt the video.

    For another part i have to use threads one thread to fill the buffer for the video and the main thread window for default to reproduce it, i will wait certain time to fill the buffer (milisenconds) and then reproduce it, in the same of the playing i will fill the buffer whit new data.

    The problem if the size how to deal with adding new data to the buffer without increase the size, and not delaying the video.

    1 Reply Last reply
    1
    • DPalhariniD Offline
      DPalhariniD Offline
      DPalharini
      wrote on last edited by
      #2

      Hi aurquiel,

      You may implement a circular buffer, it will guarantee a fixed memory use, will allow you to hold a feel data and further more, will overwrite old data information (video with a increasing delay is not helpful nor desired).

      I use this solution in a UAV software, one thread to receive and buffered the data in a circular buffer and another thread to get the data (draw over it) and show to the user.

      Fell free to as if You have any more questions.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Is it some sort of camera ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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