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

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

Issue 1551893002: [rtp_rtcp] rtcp::Sli packet moved into own file and got Parse function (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 private: 265 private:
266 static const int kMaxNumberOfChunks = 0x1f; 266 static const int kMaxNumberOfChunks = 0x1f;
267 267
268 size_t BlockLength() const; 268 size_t BlockLength() const;
269 269
270 std::vector<Chunk> chunks_; 270 std::vector<Chunk> chunks_;
271 271
272 RTC_DISALLOW_COPY_AND_ASSIGN(Sdes); 272 RTC_DISALLOW_COPY_AND_ASSIGN(Sdes);
273 }; 273 };
274 274
275 // Slice loss indication (SLI) (RFC 4585).
276 //
277 // FCI:
278 // 0 1 2 3
279 // 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
280 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
281 // | First | Number | PictureID |
282 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
283
284 class Sli : public RtcpPacket {
285 public:
286 Sli() : RtcpPacket() {
287 memset(&sli_, 0, sizeof(sli_));
288 memset(&sli_item_, 0, sizeof(sli_item_));
289 }
290
291 virtual ~Sli() {}
292
293 void From(uint32_t ssrc) {
294 sli_.SenderSSRC = ssrc;
295 }
296 void To(uint32_t ssrc) {
297 sli_.MediaSSRC = ssrc;
298 }
299 void WithFirstMb(uint16_t first_mb) {
300 assert(first_mb <= 0x1fff);
301 sli_item_.FirstMB = first_mb;
302 }
303 void WithNumberOfMb(uint16_t number_mb) {
304 assert(number_mb <= 0x1fff);
305 sli_item_.NumberOfMB = number_mb;
306 }
307 void WithPictureId(uint8_t picture_id) {
308 assert(picture_id <= 0x3f);
309 sli_item_.PictureId = picture_id;
310 }
311
312 protected:
313 bool Create(uint8_t* packet,
314 size_t* index,
315 size_t max_length,
316 RtcpPacket::PacketReadyCallback* callback) const override;
317
318 private:
319 size_t BlockLength() const {
320 const size_t kFciLength = 4;
321 return kCommonFbFmtLength + kFciLength;
322 }
323
324 RTCPUtility::RTCPPacketPSFBSLI sli_;
325 RTCPUtility::RTCPPacketPSFBSLIItem sli_item_;
326
327 RTC_DISALLOW_COPY_AND_ASSIGN(Sli);
328 };
329
330 // Reference picture selection indication (RPSI) (RFC 4585). 275 // Reference picture selection indication (RPSI) (RFC 4585).
331 // 276 //
332 // FCI: 277 // FCI:
333 // 278 //
334 // 0 1 2 3 279 // 0 1 2 3
335 // 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 280 // 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
336 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 281 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
337 // | PB |0| Payload Type| Native RPSI bit string | 282 // | PB |0| Payload Type| Native RPSI bit string |
338 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 283 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
339 // | defined per codec ... | Padding (0) | 284 // | defined per codec ... | Padding (0) |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 513
569 private: 514 private:
570 const size_t buffer_length_; 515 const size_t buffer_length_;
571 size_t length_; 516 size_t length_;
572 rtc::scoped_ptr<uint8_t[]> buffer_; 517 rtc::scoped_ptr<uint8_t[]> buffer_;
573 }; 518 };
574 519
575 } // namespace rtcp 520 } // namespace rtcp
576 } // namespace webrtc 521 } // namespace webrtc
577 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ 522 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_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