OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ | |
12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ | |
13 | |
14 #include <memory> | |
15 #include <vector> | |
16 | |
17 #include "webrtc/config.h" | |
18 #include "webrtc/base/basictypes.h" | |
19 #include "webrtc/modules/include/module_common_types.h" | |
20 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" | |
21 #include "webrtc/system_wrappers/include/clock.h" | |
22 | |
23 namespace webrtc { | |
24 | |
25 // TODO(brandtr): Update this interface when FlexfecSender is hooked up | |
26 // to PacedSender. | |
27 class FlexfecSender { | |
28 public: | |
29 static std::unique_ptr<FlexfecSender> Create( | |
30 int flexfec_payload_type, | |
31 uint32_t flexfec_ssrc, | |
32 uint32_t protected_media_ssrc, | |
33 const std::vector<RtpExtension>& rtp_header_extensions, | |
34 Clock* clock); | |
35 virtual ~FlexfecSender() = default; | |
36 | |
37 // Sets the FEC rate, max frames sent before FEC packets are sent, | |
38 // and what type of generator matrices are used. | |
39 virtual void SetFecParameters(const FecProtectionParams& params) = 0; | |
40 | |
41 // Adds a media packet to the internal buffer. When enough media packets | |
42 // have been added, the FEC packets are generated and stored internally. | |
43 // These FEC packets are then obtained by calling GetFecPackets(). | |
44 // Returns 0 on success, and a negative value if the erasure coding failed. | |
danilchap
2016/10/24 15:29:12
can it return different negative values?
may be ch
brandtr
2016/10/25 06:39:54
Nope, can only return from the set {-1,0}. Changin
| |
45 virtual int AddRtpPacketAndGenerateFec(const RtpPacketToSend& packet) = 0; | |
46 | |
47 // Returns true if there are generated FEC packets available. | |
48 virtual bool FecAvailable() const = 0; | |
49 | |
50 // Returns generated FlexFEC packets. | |
51 virtual std::vector<std::unique_ptr<RtpPacketToSend>> GetFecPackets() = 0; | |
danilchap
2016/10/24 15:29:12
actually since RtpPacketToSend is inside unique_pt
brandtr
2016/10/25 06:39:54
Done.
| |
52 | |
53 // Returns the overhead, per packet, for FlexFEC. | |
54 virtual size_t MaxPacketOverhead() const = 0; | |
55 }; | |
56 | |
57 } // namespace webrtc | |
58 | |
59 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ | |
OLD | NEW |