"ioan" wrote:
Ha! You are right... and you know what sucks? You can't (at least I don't know how) to force a redraw. I have to provide images with different names to be able to redraw, so I have to always delete the prev. image saved, save the current image with a new name, pass it to the poster. I would save some time if I could just reuse the same name, I wouldn't have to delete prev. image. Anyway, it's not that bad. I was able to get about 10fps decoding a stream coming from a remote location. On the PC, using the exactly same code I get 30fps here, but the roku has slow roByteArray operations so I waste a lot of time when I move bytes from the receiving buffer to the image array.
I have to thank you for the progress I made today, you pointed me in the right direction and I was able to figure it out from the sample channels:
Thank you!
Sure thing. Implementing mjpeg actually has been on my "to do" list of ideas (which is +inf in 8-bit float long).
In theory you could use only 2 files and flip-flop between them. Or a circular buffer of size small N. It bears the risk of out-smarting yourself though, if say RSG did not notice the URL change last time - or had no time to decode/redraw - and now sees the URLs the old one again. I don't know how it's implemented - maybe there is observer on the .uri field which forces re-load on every assignment. The better-safe-than-sorry approach would be to include an always increasing counter in the name and delete the file two steps behind.
Btw, for your special purpose here you might be better off using roScreen and leaving RSG alone. With that one you are in full control in the redrawing, in fact nothing will draw itself.
PS. assigning field value between threads has a perhaps unexpected sync effect - last i checked (last year) you could do only 1 cross-thread assignment per frame (as in, max 60 per second)