Methods
ChannelInfoGet
Retrieves information about the current channel.
Syntax
void ChannelInfoGet(out CHANNEL_INFO _pChannelInfo)| Parameter | Description |
|---|---|
| _pChannelInfo | Output CHANNEL_INFO structure containing the channel information. |
Example:
public string GetChannelInfoDetails()
{
currentChannel.ChannelInfoGet(out CHANNEL_INFO info);
return
$"eDataState: {info.eDataState}\n" +
$"eChannelMode: {info.eChannelMode}\n" +
$"eSGNState: {info.eSGNState}\n" +
$"nChannelsConnected: {info.nChannelsConnected}\n" +
$"cbDataSend: {info.cbDataSend}\n" +
$"cbDataReceived: {info.cbDataReceived}\n" +
$"dblRcvBandwidth: {info.dblRcvBandwidth}\n" +
$"dblSendBandwidth: {info.dblSendBandwidth}";
}ChannelDisconnect
Disconnects from the specified peer on the channel.
Syntax
void ChannelDisconnect(string _bsConnectedUPIorID, string _bsReason)Parameters
| Parameter | Description |
|---|---|
| _bsConnectedUPIorID | Identifier of the connected peer. |
| _bsReason | Reason for disconnection. |
ChannelSend
Sends a frame or data to the channel. This frame can be get by all the peers through ChannelReceive() method.
Syntax
void ChannelSend(int _nStreamIdx, object _pFrameOrData, string _bsHints)| Parameter | Description |
|---|---|
| _nStreamIdx | Index of the stream. The argument is reserved for future usage. Default value is -1. |
| _pFrameOrData | Frame or data encapsulated to be sent to channel as an object. |
| _bsHints | Hints for receiving frame is string format. The argument is reserved for future usage. Leave it empty. |
Example:
m_objVideoSource.SourceFrameConvertedGet(ref m_AV_PROPS_Source, -1, out MFFrame pFrame, "");
currentChannel.ChannelSend(-1, pFrame, "");
m_objPreview.ReceiverFramePut(pFrame, -1, "");
Marshal.ReleaseComObject(pFrame); ChannelReceive
Receives a frame or data from the channel, which was sent by ChannelSend() method.
Syntax
void ChannelReceive(int _nTimeoutMsec, int _nStreamIdx, string _bsFromUPIorID, out object _ppFrameOrData, string _bsHints)| Parameter | Description |
|---|---|
| _nTimeoutMsec | Timeout in milliseconds. Typical value is 100. If no valid frame is received from the specified peer within this period, an exception is thrown. |
| _nStreamIdx | Index of the stream. The argument is reserved for future usage. Default value is -1. |
| _bsFromUPIorID | Sender's identifier. The available values can be obtained via .ChannelInfoGet() method. |
| _ppFrameOrData | Received frame or data encapsulated as an object. |
| _bsHints | Hints for receiving frame is string format. The argument is reserved for future usage. Leave it empty. |
Example:
currentChannel.ChannelReceive(100, -1, peerID, out object objFrame, "");
if (objFrame != null)
{
pFrame = (MFFrame)objFrame;
return;
} ChannelMsgSend
Sends a text-based message over the channel.
Syntax
void ChannelMsgSend(string _bsMessageName, string _bsMessageBody, string _bsHints)| Parameter | Description |
|---|---|
| _bsMessageName | Name of the message. |
| _bsMessageBody | Message content. |
| _bsHints | Hints for receiving frame is string format. The argument is reserved for future usage. Leave it empty. |
ChannelMsgReceive
Receives a message from the channel.
Syntax
void ChannelMsgReceive(int _nTimeoutMsec, out string _pbsFromUPIorID, out string _pbsMessageName, out string _pbsMessageBody, string _bsHints)| Parameter | Description |
|---|---|
| _nTimeoutMsec | Timeout in milliseconds. Typical value is 100. If no valid frame is received from the specified peer within this period, an exception is thrown. |
| _pbsFromUPIorID | Output sender identifier |
| _pbsMessageName | Output message name |
| _pbsMessageBody | Output message content |
| _bsHints | Hints for receiving frame is string format. The argument is reserved for future usage. Leave it empty. |
ChannelClose
Closes the channel gracefully.
Syntax
void ChannelClose(string _bsHints)| Parameter | Description |
|---|---|
| _bsHints | Hints for closing behavior. |
ChannelAuthOperation
Performs authentication-related operations and updates remote properties.
Syntax
void ChannelAuthOperation(string _bsOperation, string _bsUpdateRemotePropsList, out string _pbsAuthInfoJson, out string _pbsPrevInfoJson)| Parameter | Description |
|---|---|
| _bsOperation | Authentication operation identifier. |
| _bsUpdateRemotePropsList | Properties to update on the remote peer. |
| _pbsAuthInfoJson | Output authentication result as JSON. |
| _pbsPrevInfoJson | Output previous authentication info as JSON. |