简体   繁体   中英

How to implement ReceiveMultiple method in DirectShow transform filter?

I've written directshow transform filter which is derived from class AM_NOVTABLE CIntTransformFilter : public CBaseFilter . It is working fine with receive method but after implementing with receivemultiple method it's not working or may be not getting called.

I've followed this document.

expected behavior : I want to extract multiple frames with receivemultiple method. therefore i implemented code which is similar to transform filter but instead of receive i used receivemultiple method.

observed behaviour : the receivemultiple method is not being called.

Is there any example or document which show how to implement receive multiple in transform filter.

Chances are high that you don't want to implement it because it is hardly called ever (it might be sometimes called when upstream filter implements a queue and by coincidence has a few samples to deliver at once). Especially in transform filter, which base is already designed to process samples one by one. Stock implementation simply converts to sequence of Receive calls.

To process multiple samples, keep receiving them using Receive method, accumulate internally, process when you are happy with the data you already hold. Be sure to handle stopping and flushing scenarios and release the data you keep references to internally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM