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

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

Issue 2740163002: Don't allocate any RTPSender object for a receive only RtpRtcp module (Closed)
Patch Set: Rebased. 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
OLDNEW
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 <memory>
14 #include <set> 15 #include <set>
15 #include <utility> 16 #include <utility>
16 #include <vector> 17 #include <vector>
17 18
18 #include "webrtc/base/criticalsection.h" 19 #include "webrtc/base/criticalsection.h"
19 #include "webrtc/base/gtest_prod_util.h" 20 #include "webrtc/base/gtest_prod_util.h"
20 #include "webrtc/base/optional.h" 21 #include "webrtc/base/optional.h"
21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" 22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 23 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
23 #include "webrtc/modules/rtp_rtcp/source/packet_loss_stats.h" 24 #include "webrtc/modules/rtp_rtcp/source/packet_loss_stats.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 const std::vector<uint16_t>& nack_sequence_numbers) override; 301 const std::vector<uint16_t>& nack_sequence_numbers) override;
301 void OnReceivedRtcpReportBlocks( 302 void OnReceivedRtcpReportBlocks(
302 const ReportBlockList& report_blocks) override; 303 const ReportBlockList& report_blocks) override;
303 void OnRequestSendReport() override; 304 void OnRequestSendReport() override;
304 305
305 void SetVideoBitrateAllocation(const BitrateAllocation& bitrate) override; 306 void SetVideoBitrateAllocation(const BitrateAllocation& bitrate) override;
306 307
307 protected: 308 protected:
308 bool UpdateRTCPReceiveInformationTimers(); 309 bool UpdateRTCPReceiveInformationTimers();
309 310
310 RTPSender* rtp_sender() { return &rtp_sender_; } 311 RTPSender* rtp_sender() { return rtp_sender_.get(); }
311 const RTPSender* rtp_sender() const { return &rtp_sender_; } 312 const RTPSender* rtp_sender() const { return rtp_sender_.get(); }
312 313
313 RTCPSender* rtcp_sender() { return &rtcp_sender_; } 314 RTCPSender* rtcp_sender() { return &rtcp_sender_; }
314 const RTCPSender* rtcp_sender() const { return &rtcp_sender_; } 315 const RTCPSender* rtcp_sender() const { return &rtcp_sender_; }
315 316
316 RTCPReceiver* rtcp_receiver() { return &rtcp_receiver_; } 317 RTCPReceiver* rtcp_receiver() { return &rtcp_receiver_; }
317 const RTCPReceiver* rtcp_receiver() const { return &rtcp_receiver_; } 318 const RTCPReceiver* rtcp_receiver() const { return &rtcp_receiver_; }
318 319
319 const Clock* clock() const { return clock_; } 320 const Clock* clock() const { return clock_; }
320 321
321 private: 322 private:
322 FRIEND_TEST_ALL_PREFIXES(RtpRtcpImplTest, Rtt); 323 FRIEND_TEST_ALL_PREFIXES(RtpRtcpImplTest, Rtt);
323 FRIEND_TEST_ALL_PREFIXES(RtpRtcpImplTest, RttForReceiverOnly); 324 FRIEND_TEST_ALL_PREFIXES(RtpRtcpImplTest, RttForReceiverOnly);
324 int64_t RtcpReportInterval(); 325 int64_t RtcpReportInterval();
325 void SetRtcpReceiverSsrcs(uint32_t main_ssrc); 326 void SetRtcpReceiverSsrcs(uint32_t main_ssrc);
326 327
327 void set_rtt_ms(int64_t rtt_ms); 328 void set_rtt_ms(int64_t rtt_ms);
328 int64_t rtt_ms() const; 329 int64_t rtt_ms() const;
329 330
330 bool TimeToSendFullNackList(int64_t now) const; 331 bool TimeToSendFullNackList(int64_t now) const;
331 332
332 RTPSender rtp_sender_; 333 std::unique_ptr<RTPSender> rtp_sender_;
333 RTCPSender rtcp_sender_; 334 RTCPSender rtcp_sender_;
334 RTCPReceiver rtcp_receiver_; 335 RTCPReceiver rtcp_receiver_;
335 336
336 const Clock* const clock_; 337 const Clock* const clock_;
337 338
338 const bool audio_; 339 const bool audio_;
339 int64_t last_process_time_; 340 int64_t last_process_time_;
340 int64_t last_bitrate_process_time_; 341 int64_t last_bitrate_process_time_;
341 int64_t last_rtt_process_time_; 342 int64_t last_rtt_process_time_;
342 uint16_t packet_overhead_; 343 uint16_t packet_overhead_;
(...skipping 13 matching lines...) Expand all
356 PacketLossStats receive_loss_stats_; 357 PacketLossStats receive_loss_stats_;
357 358
358 // The processed RTT from RtcpRttStats. 359 // The processed RTT from RtcpRttStats.
359 rtc::CriticalSection critical_section_rtt_; 360 rtc::CriticalSection critical_section_rtt_;
360 int64_t rtt_ms_; 361 int64_t rtt_ms_;
361 }; 362 };
362 363
363 } // namespace webrtc 364 } // namespace webrtc
364 365
365 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_IMPL_H_ 366 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_IMPL_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698