• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** \addtogroup  RTP_Stack
2  *  @{
3  */
4 
5 /**
6  * @brief   This file contains RTP protocol stack related constants, enums, structures and
7  * callback defines.
8  *
9  */
10 
11 /**
12  * Copyright (C) 2022 The Android Open Source Project
13  *
14  * Licensed under the Apache License, Version 2.0 (the "License");
15  * you may not use this file except in compliance with the License.
16  * You may obtain a copy of the License at
17  *
18  *      http://www.apache.org/licenses/LICENSE-2.0
19  *
20  * Unless required by applicable law or agreed to in writing, software
21  * distributed under the License is distributed on an "AS IS" BASIS,
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23  * See the License for the specific language governing permissions and
24  * limitations under the License.
25  */
26 
27 #ifndef _RTP_SERVICE_TYPES_H_
28 #define _RTP_SERVICE_TYPES_H_
29 
30 #include <RtpPfDatatypes.h>
31 
32 typedef void* RTPSESSIONID;
33 
34 typedef enum
35 {
36     RTPSVC_RECEIVE_RTP_IND,
37     RTPSVC_RECEIVE_RTCP_SR_IND,
38     RTPSVC_RECEIVE_RTCP_RR_IND,
39     RTPSVC_RECEIVE_RTCP_SDES_IND,
40     RTPSVC_RECEIVE_RTCP_BYE_IND,
41     RTPSVC_RECEIVE_RTCP_APP_IND,  // 5
42     RTPSVC_SESS_READY_DEL_IND,
43     RTPSVC_CREATE_MEMBER_IND,
44     RTPSVC_DELETE_MEMBER_IND,
45     RTPSVC_SSRC_COLLISION_CHANGED_IND,
46     RTPSVC_MEMBER_COLLISION_IND,  // 10
47     RTPSVC_RECEIVE_RTCP_TIMER_EXPIRY_IND,
48     RTPSVC_UNKNOWN_ERR_IND,
49     RTPSVC_RECEIVE_RTCP_FB_IND,
50     RTPSVC_RECEIVE_RTCP_PAYLOAD_FB_IND,
51     RTPSVC_LAST_IND_FROM_STACK = 0x7fff
52 } tRtpSvc_IndicationFromStack;
53 
54 typedef RtpDt_Void (*RtpSvc_AppIndCbFunc)(
55         tRtpSvc_IndicationFromStack eIndType, RtpDt_Void* pData, RtpDt_Void* pvUserData);
56 
57 typedef RtpDt_Void (*RtpSvc_AppIndCbRtcp)(RtpDt_Void* pData, RtpDt_Void* pvUserData);
58 typedef RtpDt_Int32 (*RtpSvc_SendToPeerCb)(RtpDt_UChar*, RtpSvc_Length, RtpDt_Void* pvUserData);
59 typedef RtpDt_Int32 (*RtcpSvc_SendToPeerCb)(RtpDt_UChar*, RtpSvc_Length, RtpDt_Void* pvUserData);
60 
61 typedef struct
62 {
63     RtpDt_UInt32 payloadType;
64     RtpDt_UInt32 samplingRate;
65     RtpDt_UInt32 frameInterval;
66 } tRtpSvc_SetPayloadParam;
67 
68 typedef struct
69 {
70     eRtp_Bool bMbit;
71     RtpDt_UChar byPayLoadType;
72     eRtp_Bool bUseLastTimestamp;
73     RtpDt_UInt32 diffFromLastRtpTimestamp;
74 
75     // Rtp extension header
76     eRtp_Bool bXbit;
77     RtpDt_UInt16 wDefinedByProfile;
78     RtpDt_UInt16 wExtLen;
79     RtpDt_Int8* pExtData;
80     RtpDt_Int32 nExtDataSize;
81 } tRtpSvc_SendRtpPacketParam;
82 
83 /*
84 typedef struct
85 {
86     eRtp_Bool    bMbit;
87     RtpDt_UChar    byPayLoadType;
88     eRtp_Bool    bUseLastTimestamp;
89     RtpDt_UInt32    ssrc;
90 }RtpSvc_SendRtcpAppPacketParm;    */
91 
92 typedef struct
93 {
94     eRtp_Bool bMbit;
95     RtpDt_UInt32 dwTimestamp;
96     RtpDt_UInt32 dwPayloadType;
97     RtpDt_UInt16 dwSeqNum;
98     RtpDt_UInt32 dwSsrc;
99 
100     RtpDt_UInt16 wMsgHdrLen;
101     RtpDt_UChar* pMsgHdr;
102 
103     RtpDt_UInt16 wMsgBodyLen;
104     RtpDt_UChar* pMsgBody;
105 
106     /* RTP Header extension */
107     RtpDt_UInt16 wDefinedByProfile;
108     RtpDt_UInt16 wExtLen;
109     RtpDt_UChar* pExtData;
110     RtpDt_UInt16 wExtDataSize;
111 } tRtpSvcIndSt_ReceiveRtpInd;
112 
113 typedef struct
114 {
115     RtpDt_UInt16 wSubType;
116     RtpDt_UInt32 dwName;
117     RtpDt_UInt16 wMsgLen;  // total RTCP length
118     RtpDt_UChar* pMsg;     // total RTCP Packet(Hdr + App Info)
119 } tRtpSvcIndSt_ReceiveRtcpAppInd;
120 
121 // To support RTCP Feedback
122 typedef struct
123 {
124     RtpDt_UInt16 wPayloadType;
125     RtpDt_UInt16 wFmt;
126     RtpDt_UInt32 dwMediaSsrc;
127     RtpDt_UInt16 wMsgLen;  // total RTCP length
128     RtpDt_UChar* pMsg;     // total RTCP Packet(Hdr + App Info)
129 } tRtpSvcIndSt_ReceiveRtcpFeedbackInd;
130 
131 typedef struct
132 {
133     RtpDt_UInt16 wMsgLen;
134     RtpDt_UChar* pMsg;
135 } tRtpSvcIndSt_ReceiveOtherRtcpInd;
136 
137 typedef struct
138 {
139     RtpDt_UInt32 dwOldSsrc;
140     RtpDt_UInt32 dwNewSsrc;
141 } tRtpSvcIndSt_SsrcCollisionInd;
142 
143 typedef struct
144 {
145     unsigned int ssrc;
146     unsigned int fractionLost;
147     unsigned int cumPktsLost;
148     unsigned int extHighSeqNum;
149     unsigned int jitter;
150     unsigned int lsr;
151     unsigned int delayLsr;
152 } tRtpSvcRecvReport;
153 
154 typedef struct
155 {
156     unsigned int ntpTimestampMsw;
157     unsigned int ntpTimestampLsw;
158     unsigned int rtpTimestamp;
159     unsigned int sendPktCount;
160     unsigned int sendOctCount;
161     tRtpSvcRecvReport stRecvRpt;  // only one RR block is supported.
162 } tNotifyReceiveRtcpSrInd;
163 
164 typedef struct
165 {
166     tRtpSvcRecvReport stRecvRpt;  // only one RR block is supported.
167 } tNotifyReceiveRtcpRrInd;
168 
169 #endif /* End of _RTP_SERVICE_TYPES_H_*/
170 
171 /** @}*/
172