IRTCSession::AddStream

The AddStream method adds one new stream to the session. The session must be in the RTCSS_CONNECTED or RTCSS_INPROGRESS state. The call will start a renegotiation with the other end of the call, and an RTCE_SESSION_STATE_CHANGE event will be triggered.

HRESULT AddStream(longlMediaType,
LONG_PTRlCookie);

Parameters

  • lMediaType
    [in] An RTCMT_ constant specifying the media for which the stream will be added. You can add only one stream at a time.
  • lCookie
    [in] Application-provided cookie used in the completion notification.

Return Values

RTC methods may return an RTC_E_ constant.

Value Meaning
RTC_E_INVALID_SESSION_STATE The session must be connected or in progress.
RTC_E_INVALID_SESSION_TYPE Session must be PC-PC or PC-phone.

Remarks

This function may send media such as audio or video over the wire in unencrypted form; therefore, someone eavesdropping on the network may be able to render the media. The security risk of sending this media stream should be considered before using this method in an unencrypted session.

Note  This method will add a media type to the list of preferred media types specified in the call to IRTCClient::SetPreferredMediaTypes.

Requirements

Client: Requires Windows XP.
Server: Requires Windows Server 2003.
Redistributable: Requires Rtcdll.dll on Windows 2000, and Windows Me/98.
Header: Declared in Rtccore.h.
Library: Included as a resource in Rtcdll.dll.
GUID: IID_IRTCSession is defined as 387c8086-99be-42fb-9973-7c0fc0ca9fa8.

See Also

IRTCSession, IRTCSession::RemoveStream, RTCMT_