ICaptureGraphBuilder2::SetOutputFileName
This method creates the file writing section of the filter graph.
HRESULT SetOutputFileName(
const GUID* pType,
LPCOLESTR lpwstrFile,
IBaseFilter** ppf,
IFileSinkFilter** pSink
);
Parameters
pType
[in] Pointer to a GUID that represents either the media subtype of the output or the class identifier (CLSID) of a multiplexer filter or file writer filter. If you specify a media subtype, it must be one of the subtypes shown in the following table.Value Description MEDIASUBTYPE_Avi Audio-Video Interleaved (AVI) MEDIASUBTYPE_Asf Advanced Systems Format (ASF) lpwstrFile
[in] Pointer to a wide-character string that contains the output file name.ppf
[out] Address of a pointer that receives the multiplexer's IBaseFilter interface.pSink
[out] Address of a pointer that receives the file writer's IFileSinkFilter2 interface. Can be NULL.
Return Values
Returns an HRESULT value. The following table shows some possible return values.
Return code | Description |
---|---|
S_OK | Success. |
E_FAIL | Failure. |
E_POINTER | Null pointer argument. |
Remarks
This method creates a multiplexer filter based on the value of the pType parameter. For AVI, it creates the AVI Mux Filter. For ASF, it creates the WM ASF Writer. For other values, it creates the filter identified by the CLSID. It adds the multiplexer to the filter graph, and returns a pointer to its IBaseFilter interface in the ppf parameter.
If the multiplexer supports the IFileSinkFilter2 interface, the method calls IFileSinkFilter2::SetFileName to set the output file name, using the value given in the lpwstrFile parameter.
You can use the pointer to the multiplexer filter, returned in the ppf parameter, as the pSink parameter in the ICaptureGraphBuilder2::RenderStream method.
For custom multiplexer filters, the method fails if the filter does not support a connection on its output pin before its input pins are connected.
If the method succeeds, the IBaseFilter interface returned in the ppf parameter has an outstanding reference count. If the method succeeds and pSink is not NULL, the IFileSinkFilter interface also has an outstanding reference count. Be sure to release both interfaces when you are done using them.
Requirements
DirectShow applications and DirectShow filters have different include file and link library requirements.
For more information, see Setting Up the Build Environment.
Pocket PC: Windows Mobile 5.0 and later
Smartphone: Windows Mobile 5.0 and later
OS Versions: Windows CE 5.01 and later
Header:
See Also
ICaptureGraphBuilder2 Interface | IBaseFilter interface | IFileSinkFilter2 interface | IFileSinkFilter2::SetFileName | ICaptureGraphBuilder2::RenderStream | IFileSinkFilter interface
Send Feedback on this topic to the authors