Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualBornToCode

Posted 01 June 2013 - 09:40 AM

I did a similar system like that in the past. What I did is that in my background thread it just decode the frame and store it into an buffer. then send an event to my main thread letting it know it has a buffer available. Then that frame get send down to the main thread along with movie handle which contains an array of PBO. then that frame get inserted into one of the PBO. When it comes time to render I figure which frame the movie is on then grab the correct PBO and apply that to the image and draw. Once the frame changed, I marked that PBO index as invalid and when the thread sends the next event that PBO will be used. So to summarize you have two threads one that is doing Decoding and the main thread which uploads the decoding data to the PBO. then on your render function you just draw the correct pbo.


#1BornToCode

Posted 01 June 2013 - 09:40 AM

I did a similar system like that in the past. What I did is that in my background thread if just decode the frame and store it into an buffer. then send an event to my main thread letting it know it has a buffer available. Then that frame get send down to the main thread along with movie handle which contains an array of PBO. then that frame get inserted into one of the PBO. When it comes time to render I figure which frame the movie is on then grab the correct PBO and apply that to the image and draw. Once the frame changed, I marked that PBO index as invalid and when the thread sends the next event that PBO will be used. So to summarize you have two threads one that is doing Decoding and the main thread which uploads the decoding data to the PBO. then on your render function you just draw the correct pbo.


PARTNERS