How does XNA's VideoPlayer Class internally work?
Having some trouble with the VideoPlayer Class in XNA (see: XNA VideoPlayer object causes 'CrossThreadMessagingException' and Playing a Video (MSDN Tutorial))
I was wondering how the VideoPlayer class is implem开发者_如何学Cented.
I know that the XNA media framework is based on DirectX to access the GPU, but I am unaware of the details. It seems to me that the VideoPlayer object somehow creates a GPU thread and has problems reading from it under certain circumstances.
It's a threading issue; it's not related to how it is internally implemented.
Threading issues are normally related to timing. If you don't have two threads accessing the same object at the same time you may not notice it - which can lead to an inconsistent presentation of the issue.
Perhaps you should consider creating a background thread and actually martial the content between the treads rather than relying on the update call.
精彩评论