DirectShow Filter: Transform

假如想象 提交于 2019-12-13 05:09:27

问题


Is it correct that the filters transform method gets called whener one of the input pins sends data? If yes: How do I determine in the filter transform method which input pin it is?


回答1:


There is no built in way to do this. If your filter has multiple input pins, and each pin provides a distinct media type, you can figure out which pin by using the media type. Another way to do this may be to assign a unique id to each instance of your input pin and pass this on to your transform function. You may have to derive your input pin from the base class to do this.




回答2:


Transform is the method on CTransformFilter class. From MSDN:

The CTransformFilter class is a base class for implementing transform filters. This class is designed for implementing a transform filter with one input pin and one output pin.

On a single input pin filter, the method is designed to not give any identification as for data source, since there is one pin in first place where data could come from.

In general, data is coming to an input pin through IMemInputPin::Receive method. If you override it on pin class, you can attach information identifying source when passing data to filter class.



来源:https://stackoverflow.com/questions/22070390/directshow-filter-transform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!