Prosody generic: API: sm_channel_output_source_datafeed_connect

Prototype Definition

int sm_channel_output_source_datafeed_connect(struct sm_channel_output_source_datafeed_connect_parms *outsrcp)

Parameters

*outsrcp
a structure of the following type:
typedef struct sm_channel_output_source_datafeed_connect_parms {
	tSMChannelId channel;					/* in */
	tSMDatafeedId data_source;				/* in */
	tSM_INT threshold;					/* in */
	tSM_INT timeout;					/* in */
} SM_CHANNEL_OUTPUT_SOURCE_DATAFEED_CONNECT_PARMS;

Description

Connects a datafeed to an output channel. The output channel will use the datafeed as its source of data (e.g. for replay or transmit operations).

The data can be buffered before being made available to the output channel for processing. The buffer will wait until it has either threshold octets of data, or timeout milliseconds have passed since data was last provided to the buffer, before allowing the output channel to process the data. This buffering is repeated if the buffer underruns.

There must be no operation in progress (e.g. replay) on the output half of the channel when this function is called.

Datafeed connections can only be made between objects allocated on the same tSMModuleId.

Requires the modules datafeed and redirect to have been downloaded.

Fields

channel
The channel to connect the source to
data_source
The datafeed supplying the data
threshold
The number of octets to collect before data is ready
timeout
The data ready timeout in milliseconds. Zero means no timeout is used.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody generic API.