Chromium Code Reviews| 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_RECEIVER_H_ | |
| 12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_RECEIVER_H_ | |
| 13 | |
| 14 #include <memory> | |
| 15 | |
| 16 #include "webrtc/base/basictypes.h" | |
| 17 #include "webrtc/modules/rtp_rtcp/include/fec_receiver.h" | |
| 18 | |
| 19 namespace webrtc { | |
| 20 | |
| 21 // Callback interface for packets recovered by FlexFEC. | |
|
brandtr
2016/10/05 13:15:54
This interface is a subset of the RtpData interfac
stefan-webrtc
2016/10/05 14:45:59
Fine with me to have a new interface.
brandtr
2016/10/06 08:38:57
Acknowledged.
| |
| 22 class RecoveredPacketReceiver { | |
| 23 public: | |
| 24 virtual ~RecoveredPacketReceiver(); | |
|
danilchap
2016/10/05 14:32:04
if you do no plan to delete RecoveredPacketReceive
brandtr
2016/10/06 08:38:57
Good idea, done!
| |
| 25 | |
| 26 virtual bool OnRecoveredPacket(const uint8_t* packet, size_t length) = 0; | |
| 27 }; | |
| 28 | |
| 29 class FlexfecReceiver { | |
| 30 public: | |
| 31 static std::unique_ptr<FlexfecReceiver> Create( | |
| 32 uint32_t flexfec_ssrc, | |
| 33 uint32_t protected_media_ssrc, | |
| 34 RecoveredPacketReceiver* callback); | |
| 35 virtual ~FlexfecReceiver(); | |
| 36 | |
| 37 // Inserts a received packet (can be either media or FlexFEC) into the | |
| 38 // internal buffer. | |
| 39 virtual bool AddReceivedPacket(const uint8_t* packet, | |
| 40 size_t packet_length) = 0; | |
| 41 | |
| 42 // Sends the received packets to the erasure code and returns all | |
| 43 // recovered media packets through the callback. | |
| 44 virtual bool ProcessReceivedPackets() = 0; | |
|
stefan-webrtc
2016/10/05 14:45:59
Is it worth having this method, or should we simpl
brandtr
2016/10/06 08:38:57
Currently, we always process whenever we receive a
| |
| 45 | |
| 46 // Returns a counter describing the added and recovered packets. | |
| 47 virtual FecPacketCounter GetPacketCounter() const = 0; | |
| 48 }; | |
| 49 | |
| 50 } // namespace webrtc | |
| 51 | |
| 52 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_RECEIVER_H_ | |
| OLD | NEW |