From: Martin H. <mar...@ma...> - 2008-11-19 08:29:14
|
Hi, I am currently experimenting with libmpeg2 for use in a video player project. I am currently using it straight out of the box and it works fine. When the decoder is finished and gives me back a display picture I just copy the display_fbuf to another buffer which can be queued for later playback. However this method is not very efficient since copying a block of memory as huge as a picture always imposes the burden of a big system load. I was wondering if I could simply switch the buffer pointers, say I give display_fbuf->buf[...] the pointers to the memory region that I would normaly queue up and queue up the display_fbuf->buf instead. However this is currently not possible due to being display_fbuf defined as const. I removed the const for testing only, but it seems that this is not a valid method, since my app crashes at some point. My question now is, is there a legal method of switching buffers or does anybody have a better solution? Best regards Martin |