I have a Directshow application that needs to preview a webcam video, and when user clicks \'Record\' it needs to start capturing the video to a file.
To that end I
Filter graph can change state as a whole, you cannot run its part individually and separately.
The easiest solution is to build preview graph separately, and when you need to start recording, stop/close preview graph and rebuild new capture graph. This certainly would involve a certain delay in response to "start recording" command.
Another option is to use multiple graphs, share data between the two, in code or using "bridging", and start/stop graphs separately.
You can try to switch between two different graphs:
1) First simple graph, than user just watch
2) Second complex graph, than user watch and record simultaneously