Compartir a través de


ICaptureGraphBuilder2::SetOutputFileName

A version of this page is also available for

Windows Embedded CE 6.0 R3

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.

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 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 IFileSinkFilter::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

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

Reference

ICaptureGraphBuilder2 Interface
IBaseFilter Interface
IFileSinkFilter2 Interface
IFileSinkFilter::SetFileName
ICaptureGraphBuilder2::RenderStream
IFileSinkFilter Interface