Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#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