Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method creates the file writing section of the filter graph.

Syntax

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 Value

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 pTypeparameter. 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 IBaseFilterinterface in the ppfparameter.

If the multiplexer supports the IFileSinkFilter2interface, the method calls IFileSinkFilter::SetFileNameto set the output file name, using the value given in the lpwstrFileparameter.

You can use the pointer to the multiplexer filter, returned in the ppfparameter, as the pSinkparameter in the ICaptureGraphBuilder2::RenderStreammethod.

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 Interfacereturned in the ppfparameter has an outstanding reference count. If the method succeeds and pSinkis not NULL, the IFileSinkFilter Interfacealso has an outstanding reference count. Be sure to release both interfaces when you are done using them.

Requirements

Windows Embedded CE Windows Embedded CE 6.0 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment

See Also