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 | |
marpan@webrtc.org | 57353a3 | 2011-12-16 17:21:09 +0000 | [diff] [blame] | 14 | // This header is included to get the nested declaration of Packet structure. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 15 | |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 16 | #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" |
| 17 | #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" |
| 18 | #include "webrtc/typedefs.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 21 | class RTPReceiverVideo; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 22 | |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 23 | class ReceiverFEC { |
| 24 | public: |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 25 | ReceiverFEC(const int32_t id, RTPReceiverVideo* owner); |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 26 | virtual ~ReceiverFEC(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 28 | int32_t AddReceivedFECPacket(const WebRtcRTPHeader* rtp_header, |
| 29 | const uint8_t* incoming_rtp_packet, |
| 30 | const uint16_t payload_data_length, |
| 31 | bool& FECpacket); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 32 | |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 33 | int32_t ProcessReceivedFEC(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 35 | void SetPayloadTypeFEC(const int8_t payload_type); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 36 | |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 37 | private: |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 38 | int ParseAndReceivePacket(const ForwardErrorCorrection::Packet* packet); |
| 39 | |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 40 | int id_; |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 41 | RTPReceiverVideo* owner_; |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 42 | ForwardErrorCorrection* fec_; |
| 43 | // TODO(holmer): In the current version received_packet_list_ is never more |
| 44 | // than one packet, since we process FEC every time a new packet |
| 45 | // arrives. We should remove the list. |
| 46 | ForwardErrorCorrection::ReceivedPacketList received_packet_list_; |
| 47 | ForwardErrorCorrection::RecoveredPacketList recovered_packet_list_; |
| 48 | int8_t payload_type_fec_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 49 | }; |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 50 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | |
phoglund@webrtc.org | 9919ad5 | 2013-05-16 15:06:28 +0000 | [diff] [blame] | 52 | #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RECEIVER_FEC_H_ |