1 /**
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /** \addtogroup  RTP_Stack
18  *  @{
19  */
20 
21 #ifndef __RTCP_APP_PACKET_H__
22 #define __RTCP_APP_PACKET_H__
23 
24 #include <RtpGlobal.h>
25 #include <RtpBuffer.h>
26 #include <RtcpHeader.h>
27 
28 /**
29  * @class RtcpAppPacket
30  * @brief It holds RTCP APP information
31  */
32 class RtcpAppPacket
33 {
34 private:
35     RtcpHeader m_objRtcpHdr;
36 
37     /**
38      * A name chosen by the person defining the set of APP packets to be
39      * unique with respect to other APP packets this application might
40      * receive.
41      */
42     RtpDt_UInt32 m_uiName;
43 
44     RtpBuffer* m_pAppData;
45 
46 public:
47     RtcpAppPacket();
48 
49     ~RtcpAppPacket();
50 
51     /**
52      *  Set method for m_objRtcpHdr
53      */
54     RtpDt_Void setRtcpHdrInfo(RtcpHeader& objHeader);
55 
56     /**
57      *  Get method for m_objRtcpHdr
58      */
59     RtcpHeader* getRtcpHdrInfo();
60 
61     /**
62      * get method for m_uiName
63      */
64     RtpDt_UInt32 getName();
65 
66     /**
67      * set method for m_uiName
68      */
69     RtpDt_Void setName(IN RtpDt_UInt32 uiName);
70 
71     /**
72      * get method for m_pAppData
73      */
74     RtpBuffer* getAppData();
75 
76     /**
77      * set method for m_pAppData
78      */
79     RtpDt_Void setAppData(IN RtpBuffer* pobjAppData);
80 
81     /**
82      * Decodes and stores the information of the RTCP APP packet
83      * This function does not allocate memory required for decoding.
84      * @param pucAppBuf received RTCP APP packet
85      * @param usAppLen length of the APP packet
86      */
87     eRTP_STATUS_CODE decodeAppPacket(IN RtpDt_UChar* pucAppBuf, IN RtpDt_UInt16 usAppLen);
88 
89     /**
90      * Performs the encoding of the RTCP APP packet.
91      * This function does not allocate memory required for encoding.
92      * @param pobjRtcpPktBuf Memory for the buffer is pre-allocated by caller
93      */
94     eRTP_STATUS_CODE formAppPacket(OUT RtpBuffer* pobjRtcpPktBuf);
95 
96 };  // end of RtcpAppPacket
97 
98 #endif  //__RTCP_APP_PACKET_H__
99 
100 /** @}*/
101