请问IGraphBuilder::AddSourceFilter函数怎么用,我知道操作一个本地文件时可以这么用hr=pGraphBuilder->AddSourceFilter(L"D:\\avi.avi",L"FileSource",&pFileSourceFilter);但现在我要操作的是来自摄像头的视频。请各位大侠帮助。
解决方案 »
- vc release 第一次运行 崩溃!!!急急!!
- mfc 中链表问题求助!
- 工作需要,改用MSN,建了个MSN群,有兴趣朋友请加。[email protected]
- 9 号上POPO跟一MM 聊天的内容。看了想扁她的请进来
- SQL SERVER2000与VC6问题
- 请大虾指教:组件服务端和客户端怎么联调?
- 我在视图类中做了个WM_VSCROLL消息的函数,用来滚动视图,结果按住鼠标左键拖动可以让视图往下滚动,但是滚动鼠标中键却不能滚动视图,这
- 信誉分被扣5分,放分,每人20分,前10个。
- 如何编程保证某个进程对cpu的使用不超过10%?
- Windows 2000访问别的机子需要登录,如何用程序来实现自动登录?
- 在windows下如何获得本机IPV6地址?
- GetPrivateProfileString()在98和2000里效果不一样, 急~~~~~~~~~~
IBaseFilter *pSourceFilter;
m_pGB->AddFilter(m_pSourceFilter, L"SourceFilterName");在AddFilter之前,pSourceFilter要先初始化,通常是通过枚举得到的。SourceFilterName可以自己随便取。
The AddSourceFilter method adds a source filter for a specified file to the filter graph. SyntaxHRESULT AddSourceFilter(
LPCWSTR lpwstrFileName,
LPCWSTR lpwstrFilterName,
IBaseFilter **ppFilter
);ParameterslpwstrFileName[in] Specifies the name of the file to load. lpwstrFilterName[in] Specifies a name for the source filter. ppFilter[out] Pointer to a variable that receives the IBaseFilter interface pointer of the source filter. Return ValueReturns an HRESULT. Possible values include the following.Value Description
S_OK Success.
E_NOINTERFACE The source filter does not support the IFileSourceFilter interface.
E_OUTOFMEMORY Insufficient memory.
E_POINTER NULL pointer argument.
VFW_E_CANNOT_LOAD_SOURCE_FILTER The source filter for this file could not be loaded.
VFW_E_NOT_FOUND File or object not found.
VFW_E_UNKNOWN_FILE_TYPE The media type of this file was not recognized.
ResThis method searches for an installed filter that can read the specified file. If it finds one, the method adds it to the filter graph and returns a pointer to the filter's IBaseFilter interface. To determine the media type and compression scheme of the file, the Filter Graph Manager reads the first few bytes of the file, looking for specific patterns of bytes, as documented in the article Registering a Custom File Type.The application is responsible for building the rest of the filter graph. To do so, call IBaseFilter::EnumPins to enumerate the output pins on the source filter. Then use either the IGraphBuilder::Connect method or the IGraphBuilder::Render method.If the method succeeds, the IBaseFilter interface has an outstanding reference count. The caller must release the interface.To render a file for default playback, use the IGraphBuilder::RenderFile method.See Also