I'm currently working on a small program using directshow library.The program among others should be able to select any camera connected to computer and record stream. My problem is that I'm not sure how to free of memory dshow filters. Let's give you an example:
For example when I want to set the output filename I have to create an AVI Mux filter like so:
IBaseFilter * aviMux;
bGraph->SetOutputFileName(
&MEDIASUBTYPE_Avi,
L"example.avi",
&aviMux,
NULL);
Now I'd like to change the filename and use the SetOutputFileName() function again, but how to free of memory AVI Mux (by the way obviously the function creates a FileWriter filter as well which I'd like to free as well)? Only I can do is that:
aviMux->Release();
fGraph->RemoveFilter(aviMux);
But will the memory be freed before the end of the program now? I'd like to do something like this:
delete aviMux;
but that's an error obviously. Thanks in advice for any answers and help..