整天和视频打交道,从网上down了一段代码,修改了一下作为程序框架,没想到在VS2005环境下出现内存访问冲突的严重bug,而且原来的框架实现步进的功能还有缺陷,所以只好再看Directshow 的SDK。在SDK中的playwndasf是一个播放器的例子,没有想到出现如下错误:
******************************************************************************************
PlayWndASF.cpp
urllaunch.cpp
Linking...
LINK : fatal error LNK1181: cannot open input file "../../common/wmstub.lib"
Error executing link.exe.
PlayWndASF.exe - 1 error(s), 0 warning(s)
******************************************************************************************
从网上搜了一下和框架中的keyprovider.cpp中的说明:
NOTE: To link and run this sample, you must install the Windows Media Format SDK 7.1.1.
After downloading the Format SDK, you can extract a public version of the
WMStub.LIB library, which should be copied to the Samples/C++/DirectShow/Common folder.
This library is necessary for enabling Windows Media content.
Without this library in the Common folder, the link will fail with:
LNK1104: cannot open file '../../common/wmstub.lib'
If you remove the WMStub.lib from the project's linker settings, the linker
will fail with this unresolved reference:
WMCreateCertificate
看来需要wmstub.lib库支持,还好这个库从网上可以下到,需要注册的:
http://bbs.lmtw.com/dispbbs.asp?BoardID=102&ID=120939&replyID=7912&skin=1
按照说明拷贝到: /DXSDK/Samples/C++/DirectShow/Common/ 下面重新编译还存在上述错误,只好重新装了一次Directshow,一切OK。
其中wmstub.lib下载在陆其明的blog里面有说明,但是我没有找到该文件:
http://jemylu.spaces.live.com/blog/cns!E1C9F572B6A2D19!377.entry
此外微软论坛上有高人的指点,但是我没有搞定:
https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=284729&SiteID=1