blob: 74cbb91896637e791368a0f12e2d15363b3834da [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
andrew@webrtc.org7fe219f2012-02-01 02:40:37 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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.org95cf4792012-01-20 06:59:06 +000014#include <list>
15
niklase@google.com470e71d2011-07-07 08:21:25 +000016#include "rtp_rtcp_defines.h"
marpan@webrtc.org57353a32011-12-16 17:21:09 +000017// This header is included to get the nested declaration of Packet structure.
18#include "forward_error_correction.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000019
20#include "typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000021
22namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000023class RTPReceiverVideo;
24
25class ReceiverFEC
26{
27public:
28 ReceiverFEC(const WebRtc_Word32 id, RTPReceiverVideo* owner);
29 virtual ~ReceiverFEC();
30
31 WebRtc_Word32 AddReceivedFECPacket(const WebRtcRTPHeader* rtpHeader,
marpan@webrtc.org57353a32011-12-16 17:21:09 +000032 const WebRtc_UWord8* incomingRtpPacket,
33 const WebRtc_UWord16 payloadDataLength,
34 bool& FECpacket,
35 bool oldPacket);
niklase@google.com470e71d2011-07-07 08:21:25 +000036
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
45private:
marpan@webrtc.org57353a32011-12-16 17:21:09 +000046 int ParseAndReceivePacket(const ForwardErrorCorrection::Packet* packet);
andrew@webrtc.org7fe219f2012-02-01 02:40:37 +000047
48 int _id;
niklase@google.com470e71d2011-07-07 08:21:25 +000049 RTPReceiverVideo* _owner;
50 ForwardErrorCorrection* _fec;
pwestin@webrtc.org95cf4792012-01-20 06:59:06 +000051 std::list<ForwardErrorCorrection::ReceivedPacket*> _receivedPacketList;
52 std::list<ForwardErrorCorrection::RecoveredPacket*> _recoveredPacketList;
niklase@google.com470e71d2011-07-07 08:21:25 +000053 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_