OLD | NEW |
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 24 matching lines...) Expand all Loading... |
35 PlayoutDelayOracle(); | 35 PlayoutDelayOracle(); |
36 ~PlayoutDelayOracle(); | 36 ~PlayoutDelayOracle(); |
37 | 37 |
38 // Returns true if the current frame should include the playout delay | 38 // Returns true if the current frame should include the playout delay |
39 // extension | 39 // extension |
40 bool send_playout_delay() const { | 40 bool send_playout_delay() const { |
41 rtc::CritScope lock(&crit_sect_); | 41 rtc::CritScope lock(&crit_sect_); |
42 return send_playout_delay_; | 42 return send_playout_delay_; |
43 } | 43 } |
44 | 44 |
45 // Returns current minimum playout delay in milliseconds. | 45 // Returns current playout delay. |
46 int min_playout_delay_ms() const { | 46 PlayoutDelay playout_delay() const { |
47 rtc::CritScope lock(&crit_sect_); | 47 rtc::CritScope lock(&crit_sect_); |
48 return min_playout_delay_ms_; | 48 return playout_delay_; |
49 } | |
50 | |
51 // Returns current maximum playout delay in milliseconds. | |
52 int max_playout_delay_ms() const { | |
53 rtc::CritScope lock(&crit_sect_); | |
54 return max_playout_delay_ms_; | |
55 } | 49 } |
56 | 50 |
57 // Updates the application requested playout delay, current ssrc | 51 // Updates the application requested playout delay, current ssrc |
58 // and the current sequence number. | 52 // and the current sequence number. |
59 void UpdateRequest(uint32_t ssrc, | 53 void UpdateRequest(uint32_t ssrc, |
60 PlayoutDelay playout_delay, | 54 PlayoutDelay playout_delay, |
61 uint16_t seq_num); | 55 uint16_t seq_num); |
62 | 56 |
63 void OnReceivedRtcpReportBlocks(const ReportBlockList& report_blocks); | 57 void OnReceivedRtcpReportBlocks(const ReportBlockList& report_blocks); |
64 | 58 |
65 private: | 59 private: |
66 // The playout delay information is updated from the encoder thread(s). | 60 // The playout delay information is updated from the encoder thread(s). |
67 // The sequence number feedback is updated from the worker thread. | 61 // The sequence number feedback is updated from the worker thread. |
68 // Guards access to data across multiple threads. | 62 // Guards access to data across multiple threads. |
69 rtc::CriticalSection crit_sect_; | 63 rtc::CriticalSection crit_sect_; |
70 // The current highest sequence number on which playout delay has been sent. | 64 // The current highest sequence number on which playout delay has been sent. |
71 int64_t high_sequence_number_ GUARDED_BY(crit_sect_); | 65 int64_t high_sequence_number_ GUARDED_BY(crit_sect_); |
72 // Indicates whether the playout delay should go on the next frame. | 66 // Indicates whether the playout delay should go on the next frame. |
73 bool send_playout_delay_ GUARDED_BY(crit_sect_); | 67 bool send_playout_delay_ GUARDED_BY(crit_sect_); |
74 // Sender ssrc. | 68 // Sender ssrc. |
75 uint32_t ssrc_ GUARDED_BY(crit_sect_); | 69 uint32_t ssrc_ GUARDED_BY(crit_sect_); |
76 // Sequence number unwrapper. | 70 // Sequence number unwrapper. |
77 SequenceNumberUnwrapper unwrapper_ GUARDED_BY(crit_sect_); | 71 SequenceNumberUnwrapper unwrapper_ GUARDED_BY(crit_sect_); |
78 // Min playout delay value on the next frame if |send_playout_delay_| is set. | 72 // Playout delay values on the next frame if |send_playout_delay_| is set. |
79 int min_playout_delay_ms_ GUARDED_BY(crit_sect_); | 73 PlayoutDelay playout_delay_ GUARDED_BY(crit_sect_); |
80 // Max playout delay value on the next frame if |send_playout_delay_| is set. | |
81 int max_playout_delay_ms_ GUARDED_BY(crit_sect_); | |
82 | 74 |
83 RTC_DISALLOW_COPY_AND_ASSIGN(PlayoutDelayOracle); | 75 RTC_DISALLOW_COPY_AND_ASSIGN(PlayoutDelayOracle); |
84 }; | 76 }; |
85 | 77 |
86 } // namespace webrtc | 78 } // namespace webrtc |
87 | 79 |
88 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_PLAYOUT_DELAY_ORACLE_H_ | 80 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_PLAYOUT_DELAY_ORACLE_H_ |
OLD | NEW |