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 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class ProducerFec { | 42 class ProducerFec { |
43 public: | 43 public: |
44 ProducerFec(); | 44 ProducerFec(); |
45 ~ProducerFec(); | 45 ~ProducerFec(); |
46 | 46 |
47 static std::unique_ptr<RedPacket> BuildRedPacket(const uint8_t* data_buffer, | 47 static std::unique_ptr<RedPacket> BuildRedPacket(const uint8_t* data_buffer, |
48 size_t payload_length, | 48 size_t payload_length, |
49 size_t rtp_header_length, | 49 size_t rtp_header_length, |
50 int red_payload_type); | 50 int red_payload_type); |
51 | 51 |
52 void SetFecParameters(const FecProtectionParams* params, | 52 void SetFecParameters(const FecProtectionParams* params); |
53 int num_first_partition); | |
54 | 53 |
55 // Adds a media packet to the internal buffer. When enough media packets | 54 // Adds a media packet to the internal buffer. When enough media packets |
56 // have been added, the FEC packets are generated and stored internally. | 55 // have been added, the FEC packets are generated and stored internally. |
57 // These FEC packets are then obtained by calling GetFecPacketsAsRed(). | 56 // These FEC packets are then obtained by calling GetFecPacketsAsRed(). |
58 int AddRtpPacketAndGenerateFec(const uint8_t* data_buffer, | 57 int AddRtpPacketAndGenerateFec(const uint8_t* data_buffer, |
59 size_t payload_length, | 58 size_t payload_length, |
60 size_t rtp_header_length); | 59 size_t rtp_header_length); |
61 | 60 |
62 // Returns true if there are generated FEC packets available. | 61 // Returns true if there are generated FEC packets available. |
63 bool FecAvailable() const; | 62 bool FecAvailable() const; |
(...skipping 29 matching lines...) Expand all Loading... |
93 // that, for the same amount of protection/overhead, longer codes | 92 // that, for the same amount of protection/overhead, longer codes |
94 // (e.g. (2k,2m) vs (k,m)) are generally more effective at recovering losses. | 93 // (e.g. (2k,2m) vs (k,m)) are generally more effective at recovering losses. |
95 bool MinimumMediaPacketsReached() const; | 94 bool MinimumMediaPacketsReached() const; |
96 | 95 |
97 void ResetState(); | 96 void ResetState(); |
98 | 97 |
99 std::unique_ptr<ForwardErrorCorrection> fec_; | 98 std::unique_ptr<ForwardErrorCorrection> fec_; |
100 ForwardErrorCorrection::PacketList media_packets_; | 99 ForwardErrorCorrection::PacketList media_packets_; |
101 std::list<ForwardErrorCorrection::Packet*> generated_fec_packets_; | 100 std::list<ForwardErrorCorrection::Packet*> generated_fec_packets_; |
102 int num_protected_frames_; | 101 int num_protected_frames_; |
103 int num_important_packets_; | |
104 int min_num_media_packets_; | 102 int min_num_media_packets_; |
105 FecProtectionParams params_; | 103 FecProtectionParams params_; |
106 FecProtectionParams new_params_; | 104 FecProtectionParams new_params_; |
107 }; | 105 }; |
108 | 106 |
109 } // namespace webrtc | 107 } // namespace webrtc |
110 | 108 |
111 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_PRODUCER_FEC_H_ | 109 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_PRODUCER_FEC_H_ |
OLD | NEW |