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

Side by Side Diff: webrtc/modules/rtp_rtcp/include/flexfec_sender.h

Issue 2565693002: [OLD] Change sequence checker to lock in FlexfecSender. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/flexfec_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ 11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_
12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ 12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_
13 13
14 #include <memory> 14 #include <memory>
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/base/basictypes.h" 17 #include "webrtc/base/basictypes.h"
18 #include "webrtc/base/criticalsection.h"
18 #include "webrtc/base/random.h" 19 #include "webrtc/base/random.h"
19 #include "webrtc/base/sequenced_task_checker.h"
20 #include "webrtc/config.h" 20 #include "webrtc/config.h"
21 #include "webrtc/modules/include/module_common_types.h" 21 #include "webrtc/modules/include/module_common_types.h"
22 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h" 22 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h"
23 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" 23 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
24 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" 24 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h"
25 #include "webrtc/modules/rtp_rtcp/source/ulpfec_generator.h" 25 #include "webrtc/modules/rtp_rtcp/source/ulpfec_generator.h"
26 #include "webrtc/system_wrappers/include/clock.h" 26 #include "webrtc/system_wrappers/include/clock.h"
27 27
28 namespace webrtc { 28 namespace webrtc {
29 29
(...skipping 25 matching lines...) Expand all
55 55
56 // Returns generated FlexFEC packets. 56 // Returns generated FlexFEC packets.
57 std::vector<std::unique_ptr<RtpPacketToSend>> GetFecPackets(); 57 std::vector<std::unique_ptr<RtpPacketToSend>> GetFecPackets();
58 58
59 // Returns the overhead, per packet, for FlexFEC. 59 // Returns the overhead, per packet, for FlexFEC.
60 size_t MaxPacketOverhead() const; 60 size_t MaxPacketOverhead() const;
61 61
62 private: 62 private:
63 // Utility. 63 // Utility.
64 Clock* const clock_; 64 Clock* const clock_;
65 Random random_ GUARDED_BY(sequence_checker_); 65 Random random_ GUARDED_BY(crit_sect_);
66 int64_t last_generated_packet_ms_ GUARDED_BY(sequence_checker_); 66 int64_t last_generated_packet_ms_ GUARDED_BY(crit_sect_);
67 rtc::SequencedTaskChecker sequence_checker_; 67 rtc::CriticalSection crit_sect_;
68 68
69 // Config. 69 // Config.
70 const int payload_type_; 70 const int payload_type_;
71 const uint32_t timestamp_offset_; 71 const uint32_t timestamp_offset_;
72 const uint32_t ssrc_; 72 const uint32_t ssrc_;
73 const uint32_t protected_media_ssrc_; 73 const uint32_t protected_media_ssrc_;
74 // Sequence number of next packet to generate. 74 // Sequence number of next packet to generate.
75 uint16_t seq_num_ GUARDED_BY(sequence_checker_); 75 uint16_t seq_num_ GUARDED_BY(crit_sect_);
76 76
77 // Implementation. 77 // Implementation.
78 UlpfecGenerator ulpfec_generator_ GUARDED_BY(sequence_checker_); 78 UlpfecGenerator ulpfec_generator_ GUARDED_BY(crit_sect_);
79 const RtpHeaderExtensionMap rtp_header_extension_map_; 79 const RtpHeaderExtensionMap rtp_header_extension_map_;
80 }; 80 };
81 81
82 } // namespace webrtc 82 } // namespace webrtc
83 83
84 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_ 84 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_FLEXFEC_SENDER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/flexfec_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698