Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/flexfec_sender_impl.h

Issue 2441613002: Add FlexfecSender. (Closed)
Patch Set: DCHECK on unprotected media SSRC added instead. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_FLEXFEC_SENDER_IMPL_H_
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_FLEXFEC_SENDER_IMPL_H_
13
14 #include <memory>
15 #include <vector>
16
17 #include "webrtc/base/basictypes.h"
18 #include "webrtc/base/random.h"
19 #include "webrtc/base/sequenced_task_checker.h"
20 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h"
21 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h"
22 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
23 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h"
24 #include "webrtc/system_wrappers/include/clock.h"
25
26 namespace webrtc {
27
28 class FlexfecSenderImpl : public FlexfecSender {
29 public:
30 FlexfecSenderImpl(int flexfec_payload_type,
31 uint32_t flexfec_ssrc,
32 uint32_t protected_media_ssrc,
33 const std::vector<RtpExtension>& rtp_header_extensions,
34 Clock* clock);
35 ~FlexfecSenderImpl();
36
37 // Implements FlexfecSender.
38 void SetFecParameters(const FecProtectionParams& params) override;
39 bool AddRtpPacketAndGenerateFec(const RtpPacketToSend& packet) override;
40 bool FecAvailable() const override;
41 std::vector<std::unique_ptr<RtpPacketToSend>> GetFecPackets() override;
42 size_t MaxPacketOverhead() const override;
43
44 private:
45 // Utility.
46 Clock* const clock_ GUARDED_BY(sequence_checker_);
danilchap 2016/10/26 12:08:41 no need to guard const member.
brandtr 2016/10/26 12:20:53 Fixed!
47 Random random_ GUARDED_BY(sequence_checker_);
48 int64_t last_generated_packet_ms_ GUARDED_BY(sequence_checker_);
49 rtc::SequencedTaskChecker sequence_checker_;
50
51 // Config.
52 const int flexfec_payload_type_;
53 const uint32_t timestamp_offset_;
54 const uint32_t flexfec_ssrc_;
55 const uint32_t protected_media_ssrc_;
56 // Sequence number of next packet to generate.
57 uint16_t seq_num_ GUARDED_BY(sequence_checker_);
58
59 // Implementation.
60 ProducerFec ulpfec_generator_ GUARDED_BY(sequence_checker_);
61 RtpHeaderExtensionMap rtp_header_extension_map_ GUARDED_BY(sequence_checker_);
62 };
63
64 } // namespace webrtc
65
66 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FLEXFEC_SENDER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698