niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
andrew@webrtc.org | 7fe219f | 2012-02-01 02:40:37 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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_SOURCE_RECEIVER_FEC_H_ |
| 12 | #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RECEIVER_FEC_H_ |
| 13 | |
pwestin@webrtc.org | 95cf479 | 2012-01-20 06:59:06 +0000 | [diff] [blame] | 14 | #include <list> |
| 15 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | #include "rtp_rtcp_defines.h" |
marpan@webrtc.org | 57353a3 | 2011-12-16 17:21:09 +0000 | [diff] [blame] | 17 | // This header is included to get the nested declaration of Packet structure. |
| 18 | #include "forward_error_correction.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 19 | |
| 20 | #include "typedefs.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 23 | class RTPReceiverVideo; |
| 24 | |
| 25 | class ReceiverFEC |
| 26 | { |
| 27 | public: |
| 28 | ReceiverFEC(const WebRtc_Word32 id, RTPReceiverVideo* owner); |
| 29 | virtual ~ReceiverFEC(); |
| 30 | |
| 31 | WebRtc_Word32 AddReceivedFECPacket(const WebRtcRTPHeader* rtpHeader, |
marpan@webrtc.org | 57353a3 | 2011-12-16 17:21:09 +0000 | [diff] [blame] | 32 | const WebRtc_UWord8* incomingRtpPacket, |
| 33 | const WebRtc_UWord16 payloadDataLength, |
| 34 | bool& FECpacket, |
| 35 | bool oldPacket); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 36 | |
| 37 | void AddReceivedFECInfo(const WebRtcRTPHeader* rtpHeader, |
| 38 | const WebRtc_UWord8* incomingRtpPacket, |
| 39 | bool& FECpacket); |
| 40 | |
| 41 | WebRtc_Word32 ProcessReceivedFEC(const bool forceFrameDecode); |
| 42 | |
| 43 | void SetPayloadTypeFEC(const WebRtc_Word8 payloadType); |
| 44 | |
| 45 | private: |
marpan@webrtc.org | 57353a3 | 2011-12-16 17:21:09 +0000 | [diff] [blame] | 46 | int ParseAndReceivePacket(const ForwardErrorCorrection::Packet* packet); |
andrew@webrtc.org | 7fe219f | 2012-02-01 02:40:37 +0000 | [diff] [blame^] | 47 | |
| 48 | int _id; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 49 | RTPReceiverVideo* _owner; |
| 50 | ForwardErrorCorrection* _fec; |
pwestin@webrtc.org | 95cf479 | 2012-01-20 06:59:06 +0000 | [diff] [blame] | 51 | std::list<ForwardErrorCorrection::ReceivedPacket*> _receivedPacketList; |
| 52 | std::list<ForwardErrorCorrection::RecoveredPacket*> _recoveredPacketList; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 53 | WebRtc_Word8 _payloadTypeFEC; |
| 54 | WebRtc_UWord16 _lastFECSeqNum; |
| 55 | bool _frameComplete; |
| 56 | }; |
| 57 | } // namespace webrtc |
| 58 | |
| 59 | #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RECEIVER_FEC_H_ |