Source Filer 的手动连接 注意事项

在自己添加sourceFiilter的时候时候的注意事项。
这里要提到一个概念,就是当有些filer 在没有给出输入PIN的时候是不会给出outPut Pin


所以在自己手动链接source filler 到下一个filer的时候要先给出输入:
这里是手册上指出:
File Source (Async) Filter
The Async File Source filter opens and reads local files of many different data formats and passes the data to a parser filter. 


To downloading media files from the Web, use the File Source (URL) filter. To read ASF files, use the WM ASF Reader filter.


Filter Interfaces IBaseFilter, IFileSourceFilter 
Input Pin Media Types Not applicable 
Input Pin Interfaces Not applicable 
Output Pin Media Types MEDIATYPE_Stream. The subtype depends on the media format. (MEDIASUBTYPE_NULL if the filter doesn't recognize the format.) 
Output Pin Interfaces IAsyncReader, IPin 
Filter CLSID CLSID_AsyncReader 
Property Page CLSID No property page 
Executable quartz.dll 
Merit MERIT_UNLIKELY 
Filter Category CLSID_LegacyAmFilterCategory 
IFileSourceFilter Interface


The IFileSourceFilter interface is exposed by source filters to set the file name and media type of the media file that they are to render. It is an abbreviated version@@@ of the COM IPersistFile interface. If the file has a type that can be determined by the algorithm described in Registering a Custom File Type, the recommended file source filter CLSID is used when the filter graph manager attempts to render the filter graph. 


这里给出事例代码:
            HRESULT hr = AddFilterByClSID(pGraph,CLSID_AsyncReader,
TEXT(" Async File Reader"),&pAsyncFileReader);
if(FAILED(hr))
return FALSE ;


hr =pAsyncFileReader->QueryInterface((REFIID)IID_IFileSourceFilter, (void **) &pIFileSource); 
if(FAILED(hr))
return FALSE ;
if(lpszFile==NULL)
return FALSE ;
hr = pIFileSource->Load(lpszFile,NULL);


if(FAILED(hr))
return FALSE ;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值