 Chromium Code Reviews
 Chromium Code Reviews Issue 2441613002:
  Add FlexfecSender.  (Closed)
    
  
    Issue 2441613002:
  Add FlexfecSender.  (Closed) 
  | Index: webrtc/modules/rtp_rtcp/include/flexfec_sender.h | 
| diff --git a/webrtc/modules/rtp_rtcp/include/flexfec_sender.h b/webrtc/modules/rtp_rtcp/include/flexfec_sender.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..4389d436ad334059299c3b892406217238f141a1 | 
| --- /dev/null | 
| +++ b/webrtc/modules/rtp_rtcp/include/flexfec_sender.h | 
| @@ -0,0 +1,59 @@ | 
| +/* | 
| + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 
| + * | 
| + * Use of this source code is governed by a BSD-style license | 
| + * that can be found in the LICENSE file in the root of the source | 
| + * tree. An additional intellectual property rights grant can be found | 
| + * in the file PATENTS. All contributing project authors may | 
| + * be found in the AUTHORS file in the root of the source tree. | 
| + */ | 
| + | 
| +#ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ | 
| +#define WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ | 
| + | 
| +#include <memory> | 
| +#include <vector> | 
| + | 
| +#include "webrtc/config.h" | 
| +#include "webrtc/base/basictypes.h" | 
| +#include "webrtc/modules/include/module_common_types.h" | 
| +#include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" | 
| +#include "webrtc/system_wrappers/include/clock.h" | 
| + | 
| +namespace webrtc { | 
| + | 
| +// TODO(brandtr): Update this interface when FlexfecSender is hooked up | 
| +// to PacedSender. | 
| +class FlexfecSender { | 
| + public: | 
| + static std::unique_ptr<FlexfecSender> Create( | 
| + int flexfec_payload_type, | 
| + uint32_t flexfec_ssrc, | 
| + uint32_t protected_media_ssrc, | 
| + const std::vector<RtpExtension>& rtp_header_extensions, | 
| + Clock* clock); | 
| + virtual ~FlexfecSender() = default; | 
| + | 
| + // Sets the FEC rate, max frames sent before FEC packets are sent, | 
| + // and what type of generator matrices are used. | 
| + virtual void SetFecParameters(const FecProtectionParams& params) = 0; | 
| + | 
| + // Adds a media packet to the internal buffer. When enough media packets | 
| + // have been added, the FEC packets are generated and stored internally. | 
| + // These FEC packets are then obtained by calling GetFecPackets(). | 
| + // 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
 | 
| + virtual int AddRtpPacketAndGenerateFec(const RtpPacketToSend& packet) = 0; | 
| + | 
| + // Returns true if there are generated FEC packets available. | 
| + virtual bool FecAvailable() const = 0; | 
| + | 
| + // Returns generated FlexFEC packets. | 
| + 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.
 | 
| + | 
| + // Returns the overhead, per packet, for FlexFEC. | 
| + virtual size_t MaxPacketOverhead() const = 0; | 
| +}; | 
| + | 
| +} // namespace webrtc | 
| + | 
| +#endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ |