ICaptureGraphBuilder::SetOutputFileName 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 SetOutputFileName(
[in] const GUID *pType,
[in] LPCOLESTR lpstrFile,
[out] IBaseFilter **ppf,
[out] IFileSinkFilter **ppSink
);
Parameters
[in] pType
Pointer to a GUID representing the media subtype. Must be &MEDIASUBTYPE_Avi
.
[in] lpstrFile
Pointer to a wide-character string containing the output file name.
[out] ppf
Address of a pointer to an IBaseFilter interface representing the multiplexer filter. This method increments the reference count on the IBaseFilter interface so you must decrement the reference count by using the Release method on this parameter when done using the filter.
[out] ppSink
Address of a pointer to an IFileSinkFilter interface representing the file writer. This method increments the reference count on the IFileSinkFilter interface so you must decrement the reference count using Release when done using the filter.
Return value
Returns an HRESULT value. Possible values include the following.
Return code | Description |
---|---|
|
Failure. |
|
Invalid argument. Audio-Video Interleaved (AVI) is the only supported output format. |
|
Out of memory. |
|
NULL pointer argument. |
|
Unexpected error occurred. |
|
Success. |
|
Instance of the AVI multiplexer filter was successfully created. |
Remarks
This method inserts the multiplexer and the file writer into the filter graph and calls IFileSinkFilter::SetFileName to set the output file name.
You can use the ppf parameter returned by this method as the pfRenderer parameter in calls to RenderStream.
You can use the pSink parameter from this method in a call to SetFileName to change the file name set by ICaptureGraphBuilder::SetOutputFileName
.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Reference:_Dshowh |
Target Platform | Windows |
Header | strmif.h |
DLL | Quartz.dll |