问题
I'm extending an application to play one of several videos on a control in a dialog. Starting with the Windowless sample, I've got this working, though the videos have to be separate files from the main executable.
The ideal scenario from a packaging standpoint is for the videos to be included with the executable as resources. I did a bit of googling for this, and there's a fair amount of "somebody should do this", and several pointers to the Async sample, though it's not clear how to get where I want from there.
Does anybody know a simple way to do this? It doesn't seem like this is a corner case, and I'm a bit surprised that this wasn't in the box.
回答1:
Look for Async Filter Sample in the DirectShow SDK, It has impl something called CMemStream which can stream data (read: media) from memory. more info on this blog post
回答2:
Why don't you extract the video from the EXE/DLL and store it in the temp path? Then play the temp file.
来源:https://stackoverflow.com/questions/530998/how-do-you-get-directshow-to-play-a-video-from-a-resource