DirectShow Filter: Transform

2019-08-30 06:56发布

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?

2条回答
唯我独甜
2楼-- · 2019-08-30 07:19

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.

查看更多
你好瞎i
3楼-- · 2019-08-30 07:25

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.

查看更多
登录 后发表回答