OLD | NEW |
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/fec_receiver_impl.h" | 11 #include "webrtc/modules/rtp_rtcp/source/fec_receiver_impl.h" |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 #include <utility> | 14 #include <utility> |
15 | 15 |
16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
17 #include "webrtc/base/logging.h" | 17 #include "webrtc/base/logging.h" |
18 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 18 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
19 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h" | 19 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 FecReceiver* FecReceiver::Create(RtpData* callback) { | 23 FecReceiver* FecReceiver::Create(RtpData* callback) { |
24 return new FecReceiverImpl(callback); | 24 return new FecReceiverImpl(callback); |
25 } | 25 } |
26 | 26 |
27 FecReceiverImpl::FecReceiverImpl(RtpData* callback) | 27 FecReceiverImpl::FecReceiverImpl(RtpData* callback) |
28 : recovered_packet_callback_(callback) {} | 28 : recovered_packet_callback_(callback), |
| 29 fec_(ForwardErrorCorrection::CreateUlpfec()) {} |
29 | 30 |
30 FecReceiverImpl::~FecReceiverImpl() { | 31 FecReceiverImpl::~FecReceiverImpl() { |
31 received_packets_.clear(); | 32 received_packets_.clear(); |
32 fec_.ResetState(&recovered_packets_); | 33 fec_.ResetState(&recovered_packets_); |
33 } | 34 } |
34 | 35 |
35 FecPacketCounter FecReceiverImpl::GetPacketCounter() const { | 36 FecPacketCounter FecReceiverImpl::GetPacketCounter() const { |
36 rtc::CritScope cs(&crit_sect_); | 37 rtc::CritScope cs(&crit_sect_); |
37 return packet_counter_; | 38 return packet_counter_; |
38 } | 39 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 return -1; | 232 return -1; |
232 } | 233 } |
233 crit_sect_.Enter(); | 234 crit_sect_.Enter(); |
234 recovered_packet->returned = true; | 235 recovered_packet->returned = true; |
235 } | 236 } |
236 crit_sect_.Leave(); | 237 crit_sect_.Leave(); |
237 return 0; | 238 return 0; |
238 } | 239 } |
239 | 240 |
240 } // namespace webrtc | 241 } // namespace webrtc |
OLD | NEW |