Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1080)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet.h

Issue 1453083002: rtcp::ReceiverReport moved into own file and got Parse function (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/rtp_rtcp.gypi ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 * 9 *
10 */ 10 */
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return kSrHeaderLength + kSenderInfoLength + 209 return kSrHeaderLength + kSenderInfoLength +
210 report_blocks_.size() * kReportBlockLength; 210 report_blocks_.size() * kReportBlockLength;
211 } 211 }
212 212
213 RTCPUtility::RTCPPacketSR sr_; 213 RTCPUtility::RTCPPacketSR sr_;
214 std::vector<ReportBlock> report_blocks_; 214 std::vector<ReportBlock> report_blocks_;
215 215
216 RTC_DISALLOW_COPY_AND_ASSIGN(SenderReport); 216 RTC_DISALLOW_COPY_AND_ASSIGN(SenderReport);
217 }; 217 };
218 218
219 //
220 // RTCP receiver report (RFC 3550).
221 //
222 // 0 1 2 3
223 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
224 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
225 // |V=2|P| RC | PT=RR=201 | length |
226 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
227 // | SSRC of packet sender |
228 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
229 // | report block(s) |
230 // | .... |
231
232 class ReceiverReport : public RtcpPacket {
233 public:
234 ReceiverReport() : RtcpPacket() {
235 memset(&rr_, 0, sizeof(rr_));
236 }
237
238 virtual ~ReceiverReport() {}
239
240 void From(uint32_t ssrc) {
241 rr_.SenderSSRC = ssrc;
242 }
243 bool WithReportBlock(const ReportBlock& block);
244
245 protected:
246 bool Create(uint8_t* packet,
247 size_t* index,
248 size_t max_length,
249 RtcpPacket::PacketReadyCallback* callback) const override;
250
251 private:
252 static const int kMaxNumberOfReportBlocks = 0x1F;
253
254 size_t BlockLength() const {
255 const size_t kRrHeaderLength = 8;
256 return kRrHeaderLength + report_blocks_.size() * kReportBlockLength;
257 }
258
259 RTCPUtility::RTCPPacketRR rr_;
260 std::vector<ReportBlock> report_blocks_;
261
262 RTC_DISALLOW_COPY_AND_ASSIGN(ReceiverReport);
263 };
264
265 // Source Description (SDES) (RFC 3550). 219 // Source Description (SDES) (RFC 3550).
266 // 220 //
267 // 0 1 2 3 221 // 0 1 2 3
268 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 222 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
269 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 223 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
270 // header |V=2|P| SC | PT=SDES=202 | length | 224 // header |V=2|P| SC | PT=SDES=202 | length |
271 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 225 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
272 // chunk | SSRC/CSRC_1 | 226 // chunk | SSRC/CSRC_1 |
273 // 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 227 // 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
274 // | SDES items | 228 // | SDES items |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 849
896 private: 850 private:
897 const size_t buffer_length_; 851 const size_t buffer_length_;
898 size_t length_; 852 size_t length_;
899 rtc::scoped_ptr<uint8_t[]> buffer_; 853 rtc::scoped_ptr<uint8_t[]> buffer_;
900 }; 854 };
901 855
902 } // namespace rtcp 856 } // namespace rtcp
903 } // namespace webrtc 857 } // namespace webrtc
904 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ 858 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/rtp_rtcp.gypi ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698