Chromium Code Reviews| 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 | 
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" | 28 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" | 
| 29 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" | 
| 30 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h" | 
| 31 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" | 31 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" | 
| 32 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 32 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 
| 33 #include "webrtc/modules/rtp_rtcp/source/ssrc_database.h" | 33 #include "webrtc/modules/rtp_rtcp/source/ssrc_database.h" | 
| 34 #include "webrtc/transport.h" | 34 #include "webrtc/transport.h" | 
| 35 | 35 | 
| 36 namespace webrtc { | 36 namespace webrtc { | 
| 37 | 37 | 
| 38 class OverheadSizeObserver; | |
| 38 class RateLimiter; | 39 class RateLimiter; | 
| 39 class RtcEventLog; | 40 class RtcEventLog; | 
| 40 class RtpPacketToSend; | 41 class RtpPacketToSend; | 
| 41 class RTPSenderAudio; | 42 class RTPSenderAudio; | 
| 42 class RTPSenderVideo; | 43 class RTPSenderVideo; | 
| 43 | 44 | 
| 44 class RTPSender { | 45 class RTPSender { | 
| 45 public: | 46 public: | 
| 46 RTPSender(bool audio, | 47 RTPSender(bool audio, | 
| 47 Clock* clock, | 48 Clock* clock, | 
| 48 Transport* transport, | 49 Transport* transport, | 
| 49 RtpPacketSender* paced_sender, | 50 RtpPacketSender* paced_sender, | 
| 50 // TODO(brandtr): Remove |flexfec_sender| when that is hooked up | 51 // TODO(brandtr): Remove |flexfec_sender| when that is hooked up | 
| 51 // to PacedSender instead. | 52 // to PacedSender instead. | 
| 52 FlexfecSender* flexfec_sender, | 53 FlexfecSender* flexfec_sender, | 
| 53 TransportSequenceNumberAllocator* sequence_number_allocator, | 54 TransportSequenceNumberAllocator* sequence_number_allocator, | 
| 54 TransportFeedbackObserver* transport_feedback_callback, | 55 TransportFeedbackObserver* transport_feedback_callback, | 
| 55 BitrateStatisticsObserver* bitrate_callback, | 56 BitrateStatisticsObserver* bitrate_callback, | 
| 56 FrameCountObserver* frame_count_observer, | 57 FrameCountObserver* frame_count_observer, | 
| 57 SendSideDelayObserver* send_side_delay_observer, | 58 SendSideDelayObserver* send_side_delay_observer, | 
| 58 RtcEventLog* event_log, | 59 RtcEventLog* event_log, | 
| 59 SendPacketObserver* send_packet_observer, | 60 SendPacketObserver* send_packet_observer, | 
| 60 RateLimiter* nack_rate_limiter); | 61 RateLimiter* nack_rate_limiter, | 
| 62 OverheadSizeObserver* overhead_size_observer); | |
| 61 | 63 | 
| 62 ~RTPSender(); | 64 ~RTPSender(); | 
| 63 | 65 | 
| 64 void ProcessBitrate(); | 66 void ProcessBitrate(); | 
| 65 | 67 | 
| 66 uint16_t ActualSendBitrateKbit() const; | 68 uint16_t ActualSendBitrateKbit() const; | 
| 67 | 69 | 
| 68 uint32_t VideoBitrateSent() const; | 70 uint32_t VideoBitrateSent() const; | 
| 69 uint32_t FecOverheadRate() const; | 71 uint32_t FecOverheadRate() const; | 
| 70 uint32_t NackOverheadRate() const; | 72 uint32_t NackOverheadRate() const; | 
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); | 205 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); | 
| 204 StreamDataCountersCallback* GetRtpStatisticsCallback() const; | 206 StreamDataCountersCallback* GetRtpStatisticsCallback() const; | 
| 205 | 207 | 
| 206 uint32_t BitrateSent() const; | 208 uint32_t BitrateSent() const; | 
| 207 | 209 | 
| 208 void SetRtpState(const RtpState& rtp_state); | 210 void SetRtpState(const RtpState& rtp_state); | 
| 209 RtpState GetRtpState() const; | 211 RtpState GetRtpState() const; | 
| 210 void SetRtxRtpState(const RtpState& rtp_state); | 212 void SetRtxRtpState(const RtpState& rtp_state); | 
| 211 RtpState GetRtxRtpState() const; | 213 RtpState GetRtxRtpState() const; | 
| 212 | 214 | 
| 215 void SetTransportOverhead(int transport_overhead); | |
| 216 | |
| 213 protected: | 217 protected: | 
| 214 int32_t CheckPayloadType(int8_t payload_type, RtpVideoCodecTypes* video_type); | 218 int32_t CheckPayloadType(int8_t payload_type, RtpVideoCodecTypes* video_type); | 
| 215 | 219 | 
| 216 private: | 220 private: | 
| 217 // Maps capture time in milliseconds to send-side delay in milliseconds. | 221 // Maps capture time in milliseconds to send-side delay in milliseconds. | 
| 218 // Send-side delay is the difference between transmission time and capture | 222 // Send-side delay is the difference between transmission time and capture | 
| 219 // time. | 223 // time. | 
| 220 typedef std::map<int64_t, int> SendDelayMap; | 224 typedef std::map<int64_t, int> SendDelayMap; | 
| 221 | 225 | 
| 222 size_t SendPadData(size_t bytes, int probe_cluster_id); | 226 size_t SendPadData(size_t bytes, int probe_cluster_id); | 
| (...skipping 25 matching lines...) Expand all Loading... | |
| 248 uint32_t ssrc); | 252 uint32_t ssrc); | 
| 249 | 253 | 
| 250 bool UpdateTransportSequenceNumber(RtpPacketToSend* packet, | 254 bool UpdateTransportSequenceNumber(RtpPacketToSend* packet, | 
| 251 int* packet_id) const; | 255 int* packet_id) const; | 
| 252 | 256 | 
| 253 void UpdateRtpStats(const RtpPacketToSend& packet, | 257 void UpdateRtpStats(const RtpPacketToSend& packet, | 
| 254 bool is_rtx, | 258 bool is_rtx, | 
| 255 bool is_retransmit); | 259 bool is_retransmit); | 
| 256 bool IsFecPacket(const RtpPacketToSend& packet) const; | 260 bool IsFecPacket(const RtpPacketToSend& packet) const; | 
| 257 | 261 | 
| 262 void AddPacketToTransportFeedback(uint16_t packet_id, | |
| 263 const RtpPacketToSend& packet, | |
| 264 int probe_cluster_id); | |
| 265 | |
| 266 void RtpOverheadSizeChanged(const RtpPacketToSend& packet); | |
| 
 
stefan-webrtc
2016/11/15 11:50:14
OnRtpOverheadSizeChanged, or perhaps UpdateRtpOver
 
stefan-webrtc
2016/11/15 16:05:49
I'd prefer if we rename this.
 
michaelt
2016/11/15 16:18:54
Done.
 
 | |
| 267 | |
| 258 Clock* const clock_; | 268 Clock* const clock_; | 
| 259 const int64_t clock_delta_ms_; | 269 const int64_t clock_delta_ms_; | 
| 260 Random random_ GUARDED_BY(send_critsect_); | 270 Random random_ GUARDED_BY(send_critsect_); | 
| 261 | 271 | 
| 262 const bool audio_configured_; | 272 const bool audio_configured_; | 
| 263 const std::unique_ptr<RTPSenderAudio> audio_; | 273 const std::unique_ptr<RTPSenderAudio> audio_; | 
| 264 const std::unique_ptr<RTPSenderVideo> video_; | 274 const std::unique_ptr<RTPSenderVideo> video_; | 
| 265 | 275 | 
| 266 RtpPacketSender* const paced_sender_; | 276 RtpPacketSender* const paced_sender_; | 
| 267 TransportSequenceNumberAllocator* const transport_sequence_number_allocator_; | 277 TransportSequenceNumberAllocator* const transport_sequence_number_allocator_; | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_); | 323 uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_); | 
| 314 int64_t capture_time_ms_ GUARDED_BY(send_critsect_); | 324 int64_t capture_time_ms_ GUARDED_BY(send_critsect_); | 
| 315 int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_); | 325 int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_); | 
| 316 bool media_has_been_sent_ GUARDED_BY(send_critsect_); | 326 bool media_has_been_sent_ GUARDED_BY(send_critsect_); | 
| 317 bool last_packet_marker_bit_ GUARDED_BY(send_critsect_); | 327 bool last_packet_marker_bit_ GUARDED_BY(send_critsect_); | 
| 318 std::vector<uint32_t> csrcs_ GUARDED_BY(send_critsect_); | 328 std::vector<uint32_t> csrcs_ GUARDED_BY(send_critsect_); | 
| 319 int rtx_ GUARDED_BY(send_critsect_); | 329 int rtx_ GUARDED_BY(send_critsect_); | 
| 320 uint32_t ssrc_rtx_ GUARDED_BY(send_critsect_); | 330 uint32_t ssrc_rtx_ GUARDED_BY(send_critsect_); | 
| 321 // Mapping rtx_payload_type_map_[associated] = rtx. | 331 // Mapping rtx_payload_type_map_[associated] = rtx. | 
| 322 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); | 332 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); | 
| 333 size_t transport_overhead_bytes_per_packet_ GUARDED_BY(send_critsect_); | |
| 334 size_t rtp_overhead_bytes_per_packet_ GUARDED_BY(send_critsect_); | |
| 323 | 335 | 
| 324 RateLimiter* const retransmission_rate_limiter_; | 336 RateLimiter* const retransmission_rate_limiter_; | 
| 337 OverheadSizeObserver* overhead_size_observer_; | |
| 325 | 338 | 
| 326 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); | 339 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); | 
| 327 }; | 340 }; | 
| 328 | 341 | 
| 329 } // namespace webrtc | 342 } // namespace webrtc | 
| 330 | 343 | 
| 331 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 344 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 
| OLD | NEW |