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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

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/source/rtcp_receiver_unittest.cc ('k') | no next file » | 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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
11 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h"
12 12
13 #include <assert.h> // assert 13 #include <assert.h> // assert
14 #include <string.h> // memcpy 14 #include <string.h> // memcpy
15 15
16 #include <algorithm> // min 16 #include <algorithm> // min
17 #include <limits> // max 17 #include <limits> // max
18 #include <utility> 18 #include <utility>
19 19
20 #include "webrtc/base/checks.h" 20 #include "webrtc/base/checks.h"
21 #include "webrtc/base/logging.h" 21 #include "webrtc/base/logging.h"
22 #include "webrtc/base/trace_event.h" 22 #include "webrtc/base/trace_event.h"
23 #include "webrtc/common_types.h" 23 #include "webrtc/common_types.h"
24 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 24 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
25 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h"
26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h"
27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h" 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h"
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h"
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.h"
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h" 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h"
31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h" 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h"
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" 33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
33 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" 34 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h"
34 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" 35 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
35 36
36 namespace webrtc { 37 namespace webrtc {
37 38
38 using RTCPUtility::RTCPCnameInformation; 39 using RTCPUtility::RTCPCnameInformation;
39 40
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 553 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
553 | First | Number | PictureID | 554 | First | Number | PictureID |
554 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 555 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555 */ 556 */
556 rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildSLI(const RtcpContext& ctx) { 557 rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildSLI(const RtcpContext& ctx) {
557 rtcp::Sli* sli = new rtcp::Sli(); 558 rtcp::Sli* sli = new rtcp::Sli();
558 sli->From(ssrc_); 559 sli->From(ssrc_);
559 sli->To(remote_ssrc_); 560 sli->To(remote_ssrc_);
560 // Crop picture id to 6 least significant bits. 561 // Crop picture id to 6 least significant bits.
561 sli->WithPictureId(ctx.picture_id_ & 0x3F); 562 sli->WithPictureId(ctx.picture_id_ & 0x3F);
562 sli->WithFirstMb(0);
563 sli->WithNumberOfMb(0x1FFF); // 13 bits, only ones for now.
564 563
565 return rtc::scoped_ptr<rtcp::Sli>(sli); 564 return rtc::scoped_ptr<rtcp::Sli>(sli);
566 } 565 }
567 566
568 /* 567 /*
569 0 1 2 3 568 0 1 2 3
570 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 569 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
571 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 570 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
572 | PB |0| Payload Type| Native RPSI bit string | 571 | PB |0| Payload Type| Native RPSI bit string |
573 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 572 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 Transport* const transport_; 1052 Transport* const transport_;
1054 bool send_failure_; 1053 bool send_failure_;
1055 } sender(transport_); 1054 } sender(transport_);
1056 1055
1057 uint8_t buffer[IP_PACKET_SIZE]; 1056 uint8_t buffer[IP_PACKET_SIZE];
1058 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && 1057 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) &&
1059 !sender.send_failure_; 1058 !sender.send_failure_;
1060 } 1059 }
1061 1060
1062 } // namespace webrtc 1061 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698