Capturing to Multiple Files (Windows CE 5.0)
Applies to: Devices based on Windows Mobile Version 5.0 and later
After you have captured some video to a file, you can switch to a new file by stopping the graph and setting the file name on the filter the writes the file. Call the IFileSinkFilter::SetFileName method on the filter. You can get a pointer to the IFileSinkFilter Interface when you build the graph, through the pSink parameter of the ICaptureGraphBuilder2::SetOutputFileName method. The following code shows how to do this:
IBaseFilter *pMux;
IFileSinkFilter *pSink
hr = pBuild->SetOutputFileName(&MEDIASUBTYPE_Avi, L"C:\\YourFileName.avi",
&pMux, &pSink);
if (SUCCEEDED(hr))
{
hr = pBuild->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,
pCap, NULL, pMux);
if (SUCCEEDED(hr))
{
pControl->Run();
/* Wait awhile, then stop the graph. */
pControl->Stop();
// Change the file name and run the graph again.
pSink->SetFileName(L"YourFileName02.avi", 0);
pControl->Run();
}
pMux->Release();
pSink->Release();
}
See Also
Send Feedback on this topic to the authors