IFileSinkFilter Interface

This is a standard DirectShow interface. It is used by several filters, including the LEAD MPEG2 Transport UDP Sink, LEAD MMS Sink, LEAD RTSP Sink and LEAD SSF Writer filters to specify parameters that control the filters' behavior. See below the discussion for the SetFileName method for the syntax used for each filter.

This page documents the interface when used with the streaming filters. If you are using it in the LEAD DICOM Writer (2.0) filter, go to IFileSinkFilter Interface (DICOM).

Methods

HRESULT GetCurFile(LPOLESTR *ppszFileName, AM_MEDIA_TYPE *pmt);

Description

Gets the current URL string.

Parameters

ppszFileName

A valid pointer to a pointer that will receive a copy of the URL string. This cannot be NULL.

pmt

A pointer to an AM_MEDIA_TYPE structure. This pointer is optional and you can pass NULL if you do not need the media type.

Comments

This string contains the IP address, the port and (optional) the network card address. See the SetFileName method for more information on the format of the URL string.

If the method succeeds, the ppszFileName pointer will be updated with a pointer to a buffer containing the URL. This buffer has been allocated with CoTaskMemAlloc. You are responsible for freeing this buffer when you are done with it by calling CoTaskMemFree.

If the method succeeds and you set pmt to a valid pointer to AM_MEDIA_TYPE structure, this structure will be initialized with a copy of the stream media type. You are responsible for freeing the data allocated in this structure by calling the FreeMediaType function. Refer to the Microsoft documentation for more information on this method.

Returns

Return Description
S_OK Successful.
< 0 An error occurred.
E_POINTER ppszFilename is NULL

HRESULT SetFileName(LPCOLESTR pszFileName, const AM_MEDIA_TYPE *pmt);

Description

Sets the URL of the stream or output filename/folder.

Parameters

pszFileName

A valid pointer to a buffer containing the URL of the stream. This cannot be NULL.

pmt

A pointer to an AM_MEDIA_TYPE structure indicating the media type of the data being streamed. This pointer can be NULL, in which case a default media type will be assumed.

Comments

The syntax depends on the filter. Here are the URLs used by each filter (optional components are in square brackets):

LEAD MPEG2 Transport UDP Sink

udp://ip_address[:udp_port][/network_card][?MaxMsgSize=max_msg_size_value]

rtp://ip_address[:rtp_port][/network_card][?MaxMsgSize==max_msg_size_value]

tcp://ip_address[:rtp_port][/network_card][?MaxMsgSize==max_msg_size_value]

Examples:

URL Description
udp://127.0.0.1:9005 Stream UDP packets using the default network card and default message size (LEADTOOLS will pick a value less that 1452 bytes)
udp://127.0.0.1:9005?MaxMsgSize=1100 Stream UDP packets using a message size less than 1100 bytes

LEAD MMS Sink

mms://[username[:password]@]serveraddress[:port]/publishingpoint

LEAD RTSP Sink

rtsp://serveraddress[:rtsp_port]

LEAD SSF Writer

Name of the output folder that will contain the generated files. It is the usual Windows filename (e.g.: c:\MySSFOutputDirectory).

See the MPEG2 Transport UDP Sink Syntax, MMS Sink Syntax, and RTSP Source URL Syntax topics for more details.

Returns

Return Description
S_OK Successful
< 0 An error occurred.
E_OUTOFMEMORY (0x8007000E) Out of memory
E_FAIL (0x80004005) Unspecified error
HRESULT_FROM_WIN32(xxx) Windows error xxx has occurred. You can consult the Microsoft documentation for the definition of the HRESULT_FROM_WIN32 macro and the complete list of Windows error codes.
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Filters C API Help

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