|
|
|
| Written by Daniel P | |
| Tuesday, 16 January 2007 | |
|
When I was testing the Mpeg decoder with movies of size 320x240, I didn't notice the problem. But when I started playing movies of size 640x480, I had a problem with writing the data to the GraphicsStream of my backbuffer object. So I rewrote the code as follow to get rid of the ineffeciency introduced by calling the GraphicsStream Write method for every bytes. The code will copy the y, u, v components of the decoder output to the NV12 format of the DirectDraw surface. And it's almost identical to C/C++ code.
GraphicsStream gs; // our stream object
gs = backBuffer.Lock(LockFlags.WriteOnly).Data; I googled on the topic and I didn't come up with much. So if you're finding your GraphicsStream object writing too slow, you might want to try something like the above. My situation was a bit particular because my decoder output is in native memory, but that's a start. |
| < Prev | Next > |
|---|














