I'm programming a DirectShow filter that reads data from a cam. I wonder which is the most suitable point on the whole DirectShow pipeline to initialize this cam. On the filter pause method, on the OnThreadCreate overrided method... ?
It depends on what exactly "cam initialization" is. If it is something trivial and simple, you can do it any time. Should this be related to runtime delay and/or exclusive resource management, then you don't want to do it too early because you don't want an idling instantiated filter to produce errors and cause unexpected freezes. It makes sense to do this sort of initialization on UI action (filter or pin property pages) or transition from stopped state (CSourceStream::OnThreadCreate
looks good), whatever takes place first.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments