summaryrefslogtreecommitdiff
path: root/service/src/com/android/telephony/imsmedia/lib/libimsmedia/protocol/interface/rtp/RtpServiceTypes.h
blob: ea3796be2ff83a3808429bc55e12795e50961365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/** \addtogroup  RTP_Stack
 *  @{
 */

/**
 * @brief   This file contains RTP protocol stack related constants, enums, structures and
 * callback defines.
 *
 */

/**
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _RTP_SERVICE_TYPES_H_
#define _RTP_SERVICE_TYPES_H_

#include <RtpPfDatatypes.h>

typedef void* RTPSESSIONID;

typedef enum
{
    RTPSVC_RECEIVE_RTP_IND,
    RTPSVC_RECEIVE_RTCP_SR_IND,
    RTPSVC_RECEIVE_RTCP_RR_IND,
    RTPSVC_RECEIVE_RTCP_SDES_IND,
    RTPSVC_RECEIVE_RTCP_BYE_IND,
    RTPSVC_RECEIVE_RTCP_APP_IND,  // 5
    RTPSVC_SESS_READY_DEL_IND,
    RTPSVC_CREATE_MEMBER_IND,
    RTPSVC_DELETE_MEMBER_IND,
    RTPSVC_SSRC_COLLISION_CHANGED_IND,
    RTPSVC_MEMBER_COLLISION_IND,  // 10
    RTPSVC_RECEIVE_RTCP_TIMER_EXPIRY_IND,
    RTPSVC_UNKNOWN_ERR_IND,
    RTPSVC_RECEIVE_RTCP_FB_IND,
    RTPSVC_RECEIVE_RTCP_PAYLOAD_FB_IND,
    RTPSVC_LAST_IND_FROM_STACK = 0x7fff
} tRtpSvc_IndicationFromStack;

typedef RtpDt_Void (*RtpSvc_AppIndCbFunc)(
        tRtpSvc_IndicationFromStack eIndType, RtpDt_Void* pData, RtpDt_Void* pvUserData);

typedef RtpDt_Void (*RtpSvc_AppIndCbRtcp)(RtpDt_Void* pData, RtpDt_Void* pvUserData);
typedef RtpDt_Int32 (*RtpSvc_SendToPeerCb)(RtpDt_UChar*, RtpSvc_Length, RtpDt_Void* pvUserData);
typedef RtpDt_Int32 (*RtcpSvc_SendToPeerCb)(RtpDt_UChar*, RtpSvc_Length, RtpDt_Void* pvUserData);

typedef struct
{
    RtpDt_UInt32 payloadType;
    RtpDt_UInt32 samplingRate;
    RtpDt_UInt32 frameInterval;
} tRtpSvc_SetPayloadParam;

typedef struct
{
    eRtp_Bool bMbit;
    RtpDt_UChar byPayLoadType;
    eRtp_Bool bUseLastTimestamp;
    RtpDt_UInt32 diffFromLastRtpTimestamp;

    // [CVO] for extension header
    eRtp_Bool bXbit;
    RtpDt_UInt16 nDefinedByProfile;
    RtpDt_UInt16 nLength;
    RtpDt_UInt16 nExtensionData;
} tRtpSvc_SendRtpPacketParm;

/*
typedef struct
{
    eRtp_Bool    bMbit;
    RtpDt_UChar    byPayLoadType;
    eRtp_Bool    bUseLastTimestamp;
    RtpDt_UInt32    ssrc;
}RtpSvc_SendRtcpAppPacketParm;    */

typedef struct
{
    eRtp_Bool bMbit;
    RtpDt_UInt32 dwTimestamp;
    RtpDt_UInt32 dwPayloadType;
    RtpDt_UInt16 dwSeqNum;

    RtpDt_UInt16 wMsgHdrLen;
    RtpDt_UChar* pMsgHdr;

    RtpDt_UInt16 wMsgBodyLen;
    RtpDt_UChar* pMsgBody;

    /* [CVO] for RTP Header Extension, seokhwan.chung@, 2013.05.22 */
    RtpDt_UInt16 extensionData;
    eRtp_Bool bExtension;

} tRtpSvcIndSt_ReceiveRtpInd;

typedef struct
{
    RtpDt_UInt16 wSubType;
    RtpDt_UInt32 dwName;
    RtpDt_UInt16 wMsgLen;  // total RTCP length
    RtpDt_UChar* pMsg;     // total RTCP Packet(Hdr + App Info)
} tRtpSvcIndSt_ReceiveRtcpAppInd;

// To support RTCP Feedback
typedef struct
{
    RtpDt_UInt16 wPayloadType;
    RtpDt_UInt16 wFmt;
    RtpDt_UInt32 dwMediaSsrc;
    RtpDt_UInt16 wMsgLen;  // total RTCP length
    RtpDt_UChar* pMsg;     // total RTCP Packet(Hdr + App Info)
} tRtpSvcIndSt_ReceiveRtcpFeedbackInd;

typedef struct
{
    RtpDt_UInt16 wMsgLen;
    RtpDt_UChar* pMsg;
} tRtpSvcIndSt_ReceiveOtherRtcpInd;

typedef struct
{
    RtpDt_UInt32 dwOldSsrc;
    RtpDt_UInt32 dwNewSsrc;
} tRtpSvcIndSt_SsrcCollisionInd;

typedef struct
{
    unsigned int ssrc;
    unsigned int fractionLost;
    unsigned int cumPktsLost;
    unsigned int extHighSeqNum;
    unsigned int jitter;
    unsigned int lsr;
    unsigned int delayLsr;
} tRtpSvcRecvReport;

typedef struct
{
    unsigned int ntpTimestampMsw;
    unsigned int ntpTimestampLsw;
    unsigned int rtpTimestamp;
    unsigned int sendPktCount;
    unsigned int sendOctCount;
    tRtpSvcRecvReport stRecvRpt;  // only one RR block is supported.
} tNotifyReceiveRtcpSrInd;

typedef struct
{
    tRtpSvcRecvReport stRecvRpt;  // only one RR block is supported.
} tNotifyReceiveRtcpRrInd;

#endif /* End of _RTP_SERVICE_TYPES_H_*/

/** @}*/