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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/producer_fec.h

Issue 2260803002: Generalize FEC header formatting. (pt. 4) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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
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 23 matching lines...) Expand all
34 size_t length() const; 34 size_t length() const;
35 35
36 private: 36 private:
37 std::unique_ptr<uint8_t[]> data_; 37 std::unique_ptr<uint8_t[]> data_;
38 size_t length_; 38 size_t length_;
39 size_t header_length_; 39 size_t header_length_;
40 }; 40 };
41 41
42 class ProducerFec { 42 class ProducerFec {
43 public: 43 public:
44 explicit ProducerFec(ForwardErrorCorrection* fec); 44 ProducerFec();
danilchap 2016/08/22 13:00:41 Isn't this reducing genearlization or ProducerFec
brandtr 2016/08/23 08:19:11 Correct, ProducerFec will only support Ulpfec. (In
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); 53 int num_first_partition);
54 54
(...skipping 15 matching lines...) Expand all
70 // |min_num_media_packets_|. This condition tries to capture the effect 70 // |min_num_media_packets_|. This condition tries to capture the effect
71 // that, for the same amount of protection/overhead, longer codes 71 // that, for the same amount of protection/overhead, longer codes
72 // (e.g. (2k,2m) vs (k,m)) are generally more effective at recovering losses. 72 // (e.g. (2k,2m) vs (k,m)) are generally more effective at recovering losses.
73 bool MinimumMediaPacketsReached() const; 73 bool MinimumMediaPacketsReached() const;
74 74
75 // Returns true if there are generated FEC packets available. 75 // Returns true if there are generated FEC packets available.
76 bool FecAvailable() const; 76 bool FecAvailable() const;
77 77
78 size_t NumAvailableFecPackets() const; 78 size_t NumAvailableFecPackets() const;
79 79
80 size_t MaxPacketOverhead() const;
81
80 // Returns generated FEC packets with RED headers added. 82 // Returns generated FEC packets with RED headers added.
81 std::vector<std::unique_ptr<RedPacket>> GetFecPacketsAsRed( 83 std::vector<std::unique_ptr<RedPacket>> GetFecPacketsAsRed(
82 int red_payload_type, 84 int red_payload_type,
83 int ulpfec_payload_type, 85 int ulpfec_payload_type,
84 uint16_t first_seq_num, 86 uint16_t first_seq_num,
85 size_t rtp_header_length); 87 size_t rtp_header_length);
86 88
87 private: 89 private:
88 void DeleteMediaPackets(); 90 void DeleteMediaPackets();
89 int Overhead() const; 91 int Overhead() const;
90 ForwardErrorCorrection* fec_; 92 ForwardErrorCorrection fec_;
91 ForwardErrorCorrection::PacketList media_packets_; 93 ForwardErrorCorrection::PacketList media_packets_;
92 std::list<ForwardErrorCorrection::Packet*> generated_fec_packets_; 94 std::list<ForwardErrorCorrection::Packet*> generated_fec_packets_;
93 int num_protected_frames_; 95 int num_protected_frames_;
94 int num_important_packets_; 96 int num_important_packets_;
95 int min_num_media_packets_; 97 int min_num_media_packets_;
96 FecProtectionParams params_; 98 FecProtectionParams params_;
97 FecProtectionParams new_params_; 99 FecProtectionParams new_params_;
98 }; 100 };
99 101
100 } // namespace webrtc 102 } // namespace webrtc
101 103
102 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_PRODUCER_FEC_H_ 104 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_PRODUCER_FEC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698