OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 27 matching lines...) Expand all Loading... |
38 recovered_packet_receiver_(recovered_packet_receiver), | 38 recovered_packet_receiver_(recovered_packet_receiver), |
39 clock_(Clock::GetRealTimeClock()), | 39 clock_(Clock::GetRealTimeClock()), |
40 last_recovered_packet_ms_(-1) { | 40 last_recovered_packet_ms_(-1) { |
41 // It's OK to create this object on a different thread/task queue than | 41 // It's OK to create this object on a different thread/task queue than |
42 // the one used during main operation. | 42 // the one used during main operation. |
43 sequence_checker_.Detach(); | 43 sequence_checker_.Detach(); |
44 } | 44 } |
45 | 45 |
46 FlexfecReceiver::~FlexfecReceiver() = default; | 46 FlexfecReceiver::~FlexfecReceiver() = default; |
47 | 47 |
48 bool FlexfecReceiver::AddAndProcessReceivedPacket(RtpPacketReceived packet) { | 48 bool FlexfecReceiver::AddAndProcessReceivedPacket( |
| 49 const RtpPacketReceived& packet) { |
49 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); | 50 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); |
50 if (!AddReceivedPacket(std::move(packet))) { | 51 if (!AddReceivedPacket(std::move(packet))) { |
51 return false; | 52 return false; |
52 } | 53 } |
53 return ProcessReceivedPackets(); | 54 return ProcessReceivedPackets(); |
54 } | 55 } |
55 | 56 |
56 FecPacketCounter FlexfecReceiver::GetPacketCounter() const { | 57 FecPacketCounter FlexfecReceiver::GetPacketCounter() const { |
57 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); | 58 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); |
58 return packet_counter_; | 59 return packet_counter_; |
59 } | 60 } |
60 | 61 |
61 bool FlexfecReceiver::AddReceivedPacket(RtpPacketReceived packet) { | 62 bool FlexfecReceiver::AddReceivedPacket(const RtpPacketReceived& packet) { |
62 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); | 63 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); |
63 | 64 |
64 // RTP packets with a full base header (12 bytes), but without payload, | 65 // RTP packets with a full base header (12 bytes), but without payload, |
65 // could conceivably be useful in the decoding. Therefore we check | 66 // could conceivably be useful in the decoding. Therefore we check |
66 // with a non-strict inequality here. | 67 // with a non-strict inequality here. |
67 RTC_DCHECK_GE(packet.size(), kRtpHeaderSize); | 68 RTC_DCHECK_GE(packet.size(), kRtpHeaderSize); |
68 | 69 |
69 // Demultiplex based on SSRC, and insert into erasure code decoder. | 70 // Demultiplex based on SSRC, and insert into erasure code decoder. |
70 std::unique_ptr<ReceivedPacket> received_packet(new ReceivedPacket()); | 71 std::unique_ptr<ReceivedPacket> received_packet(new ReceivedPacket()); |
71 received_packet->seq_num = packet.SequenceNumber(); | 72 received_packet->seq_num = packet.SequenceNumber(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 ForwardErrorCorrection::ParseSsrc(recovered_packet->pkt->data); | 145 ForwardErrorCorrection::ParseSsrc(recovered_packet->pkt->data); |
145 LOG(LS_INFO) << "Recovered media packet with SSRC: " << media_ssrc | 146 LOG(LS_INFO) << "Recovered media packet with SSRC: " << media_ssrc |
146 << " from FlexFEC stream with SSRC: " << ssrc_ << "."; | 147 << " from FlexFEC stream with SSRC: " << ssrc_ << "."; |
147 last_recovered_packet_ms_ = now_ms; | 148 last_recovered_packet_ms_ = now_ms; |
148 } | 149 } |
149 } | 150 } |
150 return true; | 151 return true; |
151 } | 152 } |
152 | 153 |
153 } // namespace webrtc | 154 } // namespace webrtc |
OLD | NEW |