# RTPRTCP_ENDPOINT_PARMS

This structure sets configuration parameters for an RTP IPv4 endpoint. Use this structure as a parameter for the MSP_ENDPOINT_PARAMETER structure, which is used with mspCreateEndpoint.

typedef struct tag_RTPRTCP_ENDPOINT_PARMS
{
DWORD size;
// QoS parameters
BYTE TypeOfService; // Default = 0, type of service in IP header
DWORD startRtcp; // Set this to non-zero to start RTCP
// session. RTCP_SESSION_PARMS structure must be
// filled in for the RTCP session
/* RTCP parameters */
RTCP_SESSION_PARMS rtcpParms;
DWORD RtpTsFreq; // Default=8000, timestamp frequency
// For a Video Endpoint, RtpTsFreq is fixed to 90000
// and cannot be modified
DWORD Session_bw; // Default=64000, session bandwidth
DWORD dtmf_event_control; // Control DTMF RTP Event generation
DWORD frameQuota; // RTP Assembly frame quota
// For a Video Endpoint, frameQuota is fixed to 1
// and cannot be modified
DWORD linkEvents; // Controls link events
RTP_PAYLOAD_MAP PayloadMap;
} RTPRTCP_ENDPOINT_PARMS;

When using RTCP for audio/video synchronization purposes, the startRtcp parameter is used as a bit field containing several definitions. Use the following macros to set the bits in the startRtcp field:

#define RTCP_ENABLE(x) (x)=1 //Sets value to 1
#define RTCP_SET_0_INTERVAL(x) ((x) | 2) //Sets 2nd bit
#define RTCP_VIDEO_LEADS_AUDIO(x) ((x) | 4) //Sets 3rd bit
#define RTCP_ENABLE_RCV_SKEW_CALC(x) ((x) | 8) //Sets 4th bit
#define RTCP_VIDEO_SKEW(x,y) ((x) | (((y) & 0x0fff) << 4))
//Sets 5th to 16th bits to value of y (max of 4095)

The following table describes how to use these macros to set bits in the startRtcp field:

Use this macro... | To set these bits... | Description
RTCP_ENABLE | 0 | Enables RTCP for an endpoint. Use this macro for both endpoints of the audio/video stream pair to be synchronized.
RTCP_SET_0_INTERVAL | 1 | Determines how quickly the RCTP Sender Report is sent: When set to 1, the first RTCP Sender Report is generated and transmitted between 0 and 1 second after the first RTP packet is transmitted for the stream. When not set (macro is not used), the first Sender Report is sent five seconds after the first RTP packet is transmitted for the stream. Use this macro for both endpoints of the audio/video stream pair to be synchronized. NMS recommends that you always use this macro.
RTCP_VIDEO_LEADS_AUDIO | 2 | (Video endpoints only) Signals to the video endpoint whether the video data stream leads or lags behind the audio data stream. Set this bit to 1, if you know that the video leads audio in the skew between transmitted video and transmitted audio for a synchronization stream pair. Otherwise, do not use this macro.
RTCP_ENABLE_RCV_SKEW_CALC | 3 | Calculates an offset value that can be sent to the application as an unsolicited event, MSPEVN_SKEW_OFFSET. Use this macro for both endpoints of the audio/video stream pair to be synchronized. To determine the skew between audio and video, compare the returned offset value to the offset value from the other half of the stream pair.
RTCP_VIDEO_SKEW | 4 - 15 | Sets a value between 0 and 4095 ms of video skew that is communicated to the IP destination by RTCP Sender Reports.

If the application enables RTCP reports through the startRtcp parameter in the RTPRTCP_ENDPOINT_PARMS structure, it must also include the following substructure:

typedef struct RTCP_RTCP_SESSION_PARMS
{
DWORD forwardPkts;
char cname[32];
char name[32];
char email[32];
char phone[32];
char location[32];
char tool[32];
char note[32];
} RTCP_SESSION_PARMS;

For more information, see Using RTCP for audio/video synchronization, Creating an endpoint, and the MSPP Service Developer's Reference Manual.