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

Side by Side Diff: webrtc/call/rtp_rtcp_demuxer_helper.cc

Issue 2943693003: Create RtcpDemuxer (Closed)
Patch Set: CR response Created 3 years, 6 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
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2017 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 #include "webrtc/call/rtp_rtcp_demuxer_helper.h"
12
13 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
14 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h"
15 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h"
16 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h"
17 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h"
18 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h"
19 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h"
20
21 namespace webrtc {
22
23 bool ParseSenderSsrc(rtc::ArrayView<const uint8_t> packet,
24 uint32_t* ssrc_sender) {
25 rtcp::CommonHeader header;
26 for (const uint8_t* next_packet = packet.begin(); next_packet != packet.end();
27 next_packet = header.NextPacket()) {
28 if (!header.Parse(next_packet, packet.end() - next_packet)) {
29 return false;
30 }
31
32 if (header.payload_size_bytes() >= sizeof(uint32_t)) {
33 switch (header.type()) {
34 case rtcp::Bye::kPacketType:
35 case rtcp::Psfb::kPacketType:
36 case rtcp::ReceiverReport::kPacketType:
37 case rtcp::Rtpfb::kPacketType:
38 case rtcp::SenderReport::kPacketType:
39 // Sender SSRC at the beginning of of the RTCP payload.
danilchap 2017/06/16 16:46:19 of of -> of
eladalon 2017/06/19 11:28:47 Done.
40 *ssrc_sender =
41 webrtc::ByteReader<uint32_t>::ReadBigEndian(header.payload());
42 return true;
43 }
44 }
45 }
46
47 return false;
48 }
49
50 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698