ICaptureGraphBuilder::CopyCaptureFile method (strmif.h)
[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
Syntax
HRESULT CopyCaptureFile(
[in] LPOLESTR lpwstrOld,
[in] LPOLESTR lpwstrNew,
[in] int fAllowEscAbort,
[in] IAMCopyCaptureFileProgress *pCallback
);
Parameters
[in] lpwstrOld
Pointer to a Unicode™ string containing the source file name.
[in] lpwstrNew
Pointer to a Unicode string containing the destination file name. Valid data is copied to this file.
[in] fAllowEscAbort
Value indicating whether pressing the ESC key will cancel the copy operation. TRUE indicates that it will; FALSE indicates that this method will ignore that keystroke.
[in] pCallback
Optional pointer to an IAMCopyCaptureFileProgress show the progress (percentage complete) of the copy operation.
Return value
Returns an HRESULT value.
Remarks
The new file will contain only valid data and therefore can be much shorter than the source file. Typically, you will always capture to the same huge preallocated file and use this method to copy the data you want to save from each capture to a new file.
If you specify pCallback, the Progress method on the IAMCopyCaptureFileProgress interface will be called periodically with an integer between 0 and 100 representing the percentage complete.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | strmif.h (include Dshow.h) |