OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 * | |
10 */ | |
11 | |
12 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_SDES_H_ | |
13 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_SDES_H_ | |
14 | |
15 #include <string> | |
16 #include <vector> | |
17 | |
18 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" | |
19 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | |
20 #include "webrtc/typedefs.h" | |
21 | |
22 namespace webrtc { | |
23 namespace rtcp { | |
24 | |
25 class Sdes : public RtcpPacket { | |
26 public: | |
27 static const uint8_t kPacketType = 202; | |
28 | |
29 Sdes() : RtcpPacket() {} | |
30 | |
31 virtual ~Sdes() {} | |
32 | |
33 // Parse assumes header is already parsed and validated. | |
34 bool Parse(const RTCPUtility::RtcpCommonHeader& header, | |
35 const uint8_t* payload); // Size of the payload is in the header. | |
36 | |
37 bool WithCName(uint32_t ssrc, const std::string& cname); | |
38 | |
39 struct Chunk { | |
40 uint32_t ssrc; | |
41 std::string name; | |
42 }; | |
43 | |
44 size_t chunks_count() const { return chunks_.size(); } | |
45 const Chunk& chunk(size_t index) const { return chunks_[index]; } | |
sprang_webrtc
2015/11/12 15:27:15
Could we just return a const std::vector<Chunk>& i
danilchap
2015/11/12 16:59:09
I do not want to disclose to user that vector is u
sprang_webrtc
2015/11/16 09:50:34
I get the sentiment, but I think this is premature
danilchap
2015/11/17 10:50:48
Done.
| |
46 | |
47 protected: | |
48 bool Create(uint8_t* packet, | |
49 size_t* index, | |
50 size_t max_length, | |
51 RtcpPacket::PacketReadyCallback* callback) const override; | |
52 | |
53 private: | |
54 static const int kMaxNumberOfChunks = 0x1f; | |
55 | |
56 size_t BlockLength() const override; | |
57 | |
58 std::vector<Chunk> chunks_; | |
59 | |
60 RTC_DISALLOW_COPY_AND_ASSIGN(Sdes); | |
61 }; | |
62 | |
63 } // namespace rtcp | |
64 } // namespace webrtc | |
65 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_SDES_H_ | |
OLD | NEW |