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

Side by Side Diff: webrtc/modules/video_coding/nack_module.h

Issue 2720603002: Remove |running_| state from NackModule to avoid running a tight loop. (Closed)
Patch Set: earlier check in FrameContinuous Created 3 years, 9 months 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/video_coding/nack_module.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
(...skipping 18 matching lines...) Expand all
29 class NackModule : public Module { 29 class NackModule : public Module {
30 public: 30 public:
31 NackModule(Clock* clock, 31 NackModule(Clock* clock,
32 NackSender* nack_sender, 32 NackSender* nack_sender,
33 KeyFrameRequestSender* keyframe_request_sender); 33 KeyFrameRequestSender* keyframe_request_sender);
34 34
35 int OnReceivedPacket(const VCMPacket& packet); 35 int OnReceivedPacket(const VCMPacket& packet);
36 void ClearUpTo(uint16_t seq_num); 36 void ClearUpTo(uint16_t seq_num);
37 void UpdateRtt(int64_t rtt_ms); 37 void UpdateRtt(int64_t rtt_ms);
38 void Clear(); 38 void Clear();
39 void Stop();
40 39
41 // Module implementation 40 // Module implementation
42 int64_t TimeUntilNextProcess() override; 41 int64_t TimeUntilNextProcess() override;
43 void Process() override; 42 void Process() override;
44 43
45 private: 44 private:
46 // Which fields to consider when deciding which packet to nack in 45 // Which fields to consider when deciding which packet to nack in
47 // GetNackBatch. 46 // GetNackBatch.
48 enum NackFilterOptions { kSeqNumOnly, kTimeOnly, kSeqNumAndTime }; 47 enum NackFilterOptions { kSeqNumOnly, kTimeOnly, kSeqNumAndTime };
49 48
(...skipping 25 matching lines...) Expand all
75 // Returns how many packets we have to wait in order to receive the packet 74 // Returns how many packets we have to wait in order to receive the packet
76 // with probability |probabilty| or higher. 75 // with probability |probabilty| or higher.
77 int WaitNumberOfPackets(float probability) const 76 int WaitNumberOfPackets(float probability) const
78 EXCLUSIVE_LOCKS_REQUIRED(crit_); 77 EXCLUSIVE_LOCKS_REQUIRED(crit_);
79 78
80 rtc::CriticalSection crit_; 79 rtc::CriticalSection crit_;
81 Clock* const clock_; 80 Clock* const clock_;
82 NackSender* const nack_sender_; 81 NackSender* const nack_sender_;
83 KeyFrameRequestSender* const keyframe_request_sender_; 82 KeyFrameRequestSender* const keyframe_request_sender_;
84 83
84 // TODO(philipel): Some of the variables below are consistently used on a
85 // known thread (e.g. see |initialized_|). Those probably do not need
86 // synchronized access.
85 std::map<uint16_t, NackInfo, DescendingSeqNumComp<uint16_t>> nack_list_ 87 std::map<uint16_t, NackInfo, DescendingSeqNumComp<uint16_t>> nack_list_
86 GUARDED_BY(crit_); 88 GUARDED_BY(crit_);
87 std::set<uint16_t, DescendingSeqNumComp<uint16_t>> keyframe_list_ 89 std::set<uint16_t, DescendingSeqNumComp<uint16_t>> keyframe_list_
88 GUARDED_BY(crit_); 90 GUARDED_BY(crit_);
89 video_coding::Histogram reordering_histogram_ GUARDED_BY(crit_); 91 video_coding::Histogram reordering_histogram_ GUARDED_BY(crit_);
90 bool running_ GUARDED_BY(crit_);
91 bool initialized_ GUARDED_BY(crit_); 92 bool initialized_ GUARDED_BY(crit_);
92 int64_t rtt_ms_ GUARDED_BY(crit_); 93 int64_t rtt_ms_ GUARDED_BY(crit_);
93 uint16_t newest_seq_num_ GUARDED_BY(crit_); 94 uint16_t newest_seq_num_ GUARDED_BY(crit_);
94 int64_t next_process_time_ms_ GUARDED_BY(crit_); 95
96 // Only touched on the process thread.
97 int64_t next_process_time_ms_;
95 }; 98 };
96 99
97 } // namespace webrtc 100 } // namespace webrtc
98 101
99 #endif // WEBRTC_MODULES_VIDEO_CODING_NACK_MODULE_H_ 102 #endif // WEBRTC_MODULES_VIDEO_CODING_NACK_MODULE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/nack_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698