OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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_SOURCE_RTP_RTCP_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_IMPL_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_IMPL_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_IMPL_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <set> | 15 #include <set> |
16 #include <utility> | 16 #include <utility> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
20 #include "webrtc/base/gtest_prod_util.h" | 20 #include "webrtc/base/gtest_prod_util.h" |
21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
23 #include "webrtc/modules/rtp_rtcp/source/packet_loss_stats.h" | 23 #include "webrtc/modules/rtp_rtcp/source/packet_loss_stats.h" |
24 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" | 24 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" |
25 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" |
26 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" |
27 | 27 |
28 namespace webrtc { | 28 namespace webrtc { |
29 | 29 |
30 class ModuleRtpRtcpImpl : public RtpRtcp { | 30 class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::SenderCallbacks { |
31 public: | 31 public: |
32 explicit ModuleRtpRtcpImpl(const RtpRtcp::Configuration& configuration); | 32 explicit ModuleRtpRtcpImpl(const RtpRtcp::Configuration& configuration); |
33 | 33 |
34 // Returns the number of milliseconds until the module want a worker thread to | 34 // Returns the number of milliseconds until the module want a worker thread to |
35 // call Process. | 35 // call Process. |
36 int64_t TimeUntilNextProcess() override; | 36 int64_t TimeUntilNextProcess() override; |
37 | 37 |
38 // Process any pending tasks such as timeouts. | 38 // Process any pending tasks such as timeouts. |
39 void Process() override; | 39 void Process() override; |
40 | 40 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 void SetREMBStatus(bool enable) override; | 198 void SetREMBStatus(bool enable) override; |
199 | 199 |
200 void SetREMBData(uint32_t bitrate, | 200 void SetREMBData(uint32_t bitrate, |
201 const std::vector<uint32_t>& ssrcs) override; | 201 const std::vector<uint32_t>& ssrcs) override; |
202 | 202 |
203 // (TMMBR) Temporary Max Media Bit Rate. | 203 // (TMMBR) Temporary Max Media Bit Rate. |
204 bool TMMBR() const override; | 204 bool TMMBR() const override; |
205 | 205 |
206 void SetTMMBRStatus(bool enable) override; | 206 void SetTMMBRStatus(bool enable) override; |
207 | 207 |
208 void SetTmmbn(std::vector<rtcp::TmmbItem> bounding_set); | 208 void SetTmmbn(std::vector<rtcp::TmmbItem> bounding_set) override; |
209 | 209 |
210 uint16_t MaxPayloadLength() const override; | 210 uint16_t MaxPayloadLength() const override; |
211 | 211 |
212 uint16_t MaxDataPayloadLength() const override; | 212 uint16_t MaxDataPayloadLength() const override; |
213 | 213 |
214 int32_t SetMaxTransferUnit(uint16_t size) override; | 214 int32_t SetMaxTransferUnit(uint16_t size) override; |
215 | 215 |
216 int32_t SetTransportOverhead(bool tcp, | 216 int32_t SetTransportOverhead(bool tcp, |
217 bool ipv6, | 217 bool ipv6, |
218 uint8_t authentication_overhead = 0) override; | 218 uint8_t authentication_overhead = 0) override; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 uint32_t* nackRate) const override; | 305 uint32_t* nackRate) const override; |
306 | 306 |
307 // Good state of RTP receiver inform sender. | 307 // Good state of RTP receiver inform sender. |
308 int32_t SendRTCPReferencePictureSelection(uint64_t picture_id) override; | 308 int32_t SendRTCPReferencePictureSelection(uint64_t picture_id) override; |
309 | 309 |
310 void RegisterSendChannelRtpStatisticsCallback( | 310 void RegisterSendChannelRtpStatisticsCallback( |
311 StreamDataCountersCallback* callback) override; | 311 StreamDataCountersCallback* callback) override; |
312 StreamDataCountersCallback* GetSendChannelRtpStatisticsCallback() | 312 StreamDataCountersCallback* GetSendChannelRtpStatisticsCallback() |
313 const override; | 313 const override; |
314 | 314 |
315 void OnReceivedNACK(const std::list<uint16_t>& nack_sequence_numbers); | 315 void OnReceivedNACK( |
316 void OnReceivedRtcpReportBlocks(const ReportBlockList& report_blocks); | 316 const std::list<uint16_t>& nack_sequence_numbers) override; |
317 | 317 void OnReceivedRtcpReportBlocks( |
318 void OnRequestSendReport(); | 318 const ReportBlockList& report_blocks) override; |
| 319 void OnRequestSendReport() override; |
319 | 320 |
320 protected: | 321 protected: |
321 bool UpdateRTCPReceiveInformationTimers(); | 322 bool UpdateRTCPReceiveInformationTimers(); |
322 | 323 |
323 RTPSender rtp_sender_; | 324 RTPSender rtp_sender_; |
324 | 325 |
325 RTCPSender rtcp_sender_; | 326 RTCPSender rtcp_sender_; |
326 RTCPReceiver rtcp_receiver_; | 327 RTCPReceiver rtcp_receiver_; |
327 | 328 |
328 Clock* clock_; | 329 Clock* clock_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 PacketLossStats receive_loss_stats_; | 361 PacketLossStats receive_loss_stats_; |
361 | 362 |
362 // The processed RTT from RtcpRttStats. | 363 // The processed RTT from RtcpRttStats. |
363 rtc::CriticalSection critical_section_rtt_; | 364 rtc::CriticalSection critical_section_rtt_; |
364 int64_t rtt_ms_; | 365 int64_t rtt_ms_; |
365 }; | 366 }; |
366 | 367 |
367 } // namespace webrtc | 368 } // namespace webrtc |
368 | 369 |
369 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_IMPL_H_ | 370 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_IMPL_H_ |
OLD | NEW |