| 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/ulpfec_generator.h" | 11 #include "webrtc/modules/rtp_rtcp/source/ulpfec_generator.h" |
| 12 | 12 |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <utility> | 14 #include <utility> |
| 15 | 15 |
| 16 #include "webrtc/base/basictypes.h" | |
| 17 #include "webrtc/base/checks.h" | |
| 18 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 16 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
| 19 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" | 17 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" |
| 20 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 18 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| 19 #include "webrtc/rtc_base/basictypes.h" |
| 20 #include "webrtc/rtc_base/checks.h" |
| 21 | 21 |
| 22 namespace webrtc { | 22 namespace webrtc { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 constexpr size_t kRedForFecHeaderLength = 1; | 26 constexpr size_t kRedForFecHeaderLength = 1; |
| 27 | 27 |
| 28 // This controls the maximum amount of excess overhead (actual - target) | 28 // This controls the maximum amount of excess overhead (actual - target) |
| 29 // allowed in order to trigger EncodeFec(), before |params_.max_fec_frames| | 29 // allowed in order to trigger EncodeFec(), before |params_.max_fec_frames| |
| 30 // is reached. Overhead here is defined as relative to number of media packets. | 30 // is reached. Overhead here is defined as relative to number of media packets. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 return (num_fec_packets << 8) / media_packets_.size(); | 249 return (num_fec_packets << 8) / media_packets_.size(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void UlpfecGenerator::ResetState() { | 252 void UlpfecGenerator::ResetState() { |
| 253 media_packets_.clear(); | 253 media_packets_.clear(); |
| 254 generated_fec_packets_.clear(); | 254 generated_fec_packets_.clear(); |
| 255 num_protected_frames_ = 0; | 255 num_protected_frames_ = 0; |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace webrtc | 258 } // namespace webrtc |
| OLD | NEW |