在自己添加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 ;
这里要提到一个概念,就是当有些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 ;