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_SOURCE_ULPFEC_HEADER_READER_WRITER_H_ | |
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_ULPFEC_HEADER_READER_WRITER_H_ | |
13 | |
14 #include "webrtc/base/basictypes.h" | |
15 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" | |
16 | |
17 namespace webrtc { | |
18 | |
19 // FEC Level 0 Header, 10 bytes. | |
20 // 0 1 2 3 | |
21 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |
22 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
23 // |E|L|P|X| CC |M| PT recovery | SN base | | |
24 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
25 // | TS recovery | | |
26 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
27 // | length recovery | | |
28 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
29 // | |
30 // FEC Level 1 Header, 4 bytes (L = 0) or 8 bytes (L = 1). | |
31 // 0 1 2 3 | |
32 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |
33 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
34 // | Protection Length | mask | | |
35 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
36 // | mask cont. (present only when L = 1) | | |
37 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
38 class UlpfecHeaderReader : public FecHeaderReader { | |
39 public: | |
40 UlpfecHeaderReader(); | |
41 ~UlpfecHeaderReader(); | |
danilchap
2016/08/24 10:42:40
add override since base destructor is virtual
brandtr
2016/08/24 11:34:24
Done.
| |
42 | |
43 bool ReadFecHeader( | |
44 ForwardErrorCorrection::ReceivedFecPacket* fec_packet) const override; | |
45 }; | |
46 | |
47 class UlpfecHeaderWriter : public FecHeaderWriter { | |
48 public: | |
49 UlpfecHeaderWriter(); | |
50 ~UlpfecHeaderWriter(); | |
51 | |
52 size_t MinPacketMaskSize(const uint8_t* packet_mask, | |
53 size_t packet_mask_size) const override; | |
54 | |
55 size_t FecHeaderSize(size_t packet_mask_row_size) const override; | |
56 | |
57 void FinalizeFecHeader( | |
58 const ForwardErrorCorrection::PacketList& media_packets, | |
59 const uint8_t* packet_mask, | |
60 size_t packet_mask_size, | |
61 ForwardErrorCorrection::Packet* fec_packet) const override; | |
62 }; | |
63 | |
64 } // namespace webrtc | |
65 | |
66 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_ULPFEC_HEADER_READER_WRITER_H_ | |
OLD | NEW |