How to detect the events to connect/disconnect to the avshws filter.

Hello, all

I’m trying to work something through the following GitHub source based on MSDN code sample “avshws”:
https://github.com/robot9706/VirtualCameraDriver

I’d like to add the feature that detects the events when an application tries to start/stop the usage of the avshws filter.
That’s, I’d like to capture the start/stop events of this filter.
capture-filter-disconnect
capture-filter-connect

Unfortunately, I am very new to device driver development, and I have no idea how to implement this feature.

Thanks.
Jimmy

I would think this was fairly obvious to someone who has looked at the code. The setting of the filter state is done in the pin’s SetState handler; in this case, in CCapturePin::SetState. The filter goes active when it transitions into KSSTATE_RUN, and inactive when it transitions out of that state. KS guarantees that it only moves one step at a time.

The SetState handler calls CCaptureDevice::Start and CCaptureDevice::Stop in response to that. Events are sometimes easier to handle in the device.