IFileSinkFilter Interface

This is a standard DirectShow interface exposed by several sink filters.

This page documents its use in the LEAD DICOM Writer (2.0) filter.

If you are using it with one of the streaming sink filters like LEAD MPEG2 Transport UDP Sink, LEAD MMS Sink, and LEAD RTSP Sink), you should go to IFileSinkFilter Interface (UDP, RTSP, MMS).

Methods

HRESULT SetFileName(LPCOLESTR pszFileName, const AM_MEDIA_TYPE * pmt)

Description

Sets the name of the output DICOM file.

Parameters

pszFileName

Pointer to a string that contains the name of the file to receive the media samples, as an OLESTR type.

pmt

Pointer to an AM_MEDIA_TYPE structure that indicates the type of media samples to be written to the file and the media type of the sink filter's input pin. This parameter is ignored and is provided only for compatibility. Always pass NULL.

Comments

If pszFileName does not exist, a file by that name will be created. If pszFileName currently exists, the existing file will be overwritten. For more information, refer to the DirectShow 9.0 IFileSinkFilter::SetFileName and AM_MEDIA_TYPE documentation in the DirectX documentation on MSDN.

Returns

Return Description
ERROR_FILENAME_EXCED_RANGE The file name is longer than 260 characters, so the name cannot be set.
S_FALSE The filter is in the streaming state, so the name cannot be set.
E_POINTER pszFileName is NULL, so the name cannot be set.
S_OK Success.

HRESULT GetCurFile (LPOLESTR * ppszFileName, AM_MEDIA_TYPE * pmt)

Description

Gets the name of the current file along with its media type information.

Parameters

ppszFileName

Address of a pointer to a string to be updated with the name of the current file receiving the media samples, as an OLESTR type. The method allocates the memory for the string returned in ppszFileName. The caller must free it by calling CoTaskMemFree.

pmt

Pointer to an AM_MEDIA_TYPE structure to be updated with the type of media samples being written to the file. This parameter can be NULL, in which case the method does not return the media type. If the filters input pin is not connected this variable will not be updated. If this method succeeds the caller must free the memory allocated for the structure by calling the FreeMediaType function in the base DirectShow class library.

Comments

For more information, refer to the DirectShow 9.0 IFileSinkFilter::GetCurFile and AM_MEDIA_TYPE documentation in the DirectX documentation on MSDN.

Returns

Return Description
E_OUTOFMEMORY Insufficient memory.
E_FAIL No file is open.
E_POINTER ppszFileName is NULL.
S_OK Success.

This filter is included as part of LEADTOOLS Medical Module

See Also

Help Version 22.0.2022.8.23
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Filters C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.