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_CHUNK_H__
22 #define __RTCP_CHUNK_H__
23 
24 #include <RtpGlobal.h>
25 #include <RtcpConfigInfo.h>
26 #include <RtpBuffer.h>
27 #include <list>
28 
29 /**
30  * @class RtcpChunk
31  *
32  * It holds RTCP Chunk information
33  */
34 class RtcpChunk
35 {
36 private:
37     RtpDt_UInt32 m_uiSsrc;
38     std::list<tRTCP_SDES_ITEM*> m_stSdesItemList;
39 
40 public:
41     RtcpChunk();
42     ~RtcpChunk();
43 
44     /**
45      * set method for m_uiSsrc
46      */
47     RtpDt_Void setSsrc(IN RtpDt_UInt32 uiSsrc);
48 
49     /**
50      * get method for m_uiSsrc
51      */
52     RtpDt_UInt32 getSsrc();
53 
54     /**
55      * get method for m_stSdesItemList
56      */
57     std::list<tRTCP_SDES_ITEM*>& getSdesItemList();
58 
59     /**
60      * Decodes and stores the information of the RTCP CHUNKS
61      * This function does not allocate memory required for decoding.
62      * @param pucChunkBuf Received RTCP chunk buffer
63      * @param usChunkLen Length of the RTCP chunk
64      * @param pobjRtcpCfgInfo RTCP configuration information
65      */
66     eRTP_STATUS_CODE decodeRtcpChunk(IN RtpDt_UChar* pucChunkBuf, IN RtpDt_UInt16& usChunkLen,
67             IN RtcpConfigInfo* pobjRtcpCfgInfo);
68 
69     /**
70      * Performs the encoding of the RTCP CHUNKS.
71      * This function does not allocate memory required for encoding.
72      * @param pobjRtcpPktBuf Memory for the buffer is pre-allocated by caller
73      * @param uiStartPos from which RTCP CHUNKS shall be encoded.
74      */
75     eRTP_STATUS_CODE formRtcpChunk(OUT RtpBuffer* pobjRtcpPktBuf);
76 
77 };  // end of RtcpChunk
78 
79 #endif  //__RTCP_CHUNK_H__
80 /** @}*/
81