Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.24
LEADTOOLS Filters Help

IFileSinkFilter Interface

Show in webframe

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

Interface Methods:

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

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.

Description

Gets the current URL string. 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 function 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 function 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. Please refer to the Microsoft documentation for more information on this function.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

E_POINTER

ppszFilename is NULL

 

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

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.

Description

This function sets the URL of the stream. 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]

rtp://ip_address[:rtp_port][/network_card]

tcp://ip_address[:rtp_port][/network_card]

LEAD MMS Sink:

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

LEAD RTSP Sink

rtsp://serveraddress[:rtsp_port]

 

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

Returns

S_OK if successful, < 0 if an error occurred.   

Common error codes:

Value

Meaning

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.

 

Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.