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

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

Issue 2495553002: Add overhead per packet observer to the rtp_sender. (Closed)
Patch Set: Created 4 years, 1 month 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
(...skipping 17 matching lines...) Expand all
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 OverheadPerPacketObserver;
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 OverheadPerPacketObserver* const overhead_rate_observer);
minyue-webrtc 2016/11/14 11:18:06 no need "const"
michaelt 2016/11/14 13:01:27 Done.
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
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
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(PacketOptions* options,
263 RtpPacketToSend* packet,
264 int probe_cluster_id);
265
258 Clock* const clock_; 266 Clock* const clock_;
259 const int64_t clock_delta_ms_; 267 const int64_t clock_delta_ms_;
260 Random random_ GUARDED_BY(send_critsect_); 268 Random random_ GUARDED_BY(send_critsect_);
261 269
262 const bool audio_configured_; 270 const bool audio_configured_;
263 const std::unique_ptr<RTPSenderAudio> audio_; 271 const std::unique_ptr<RTPSenderAudio> audio_;
264 const std::unique_ptr<RTPSenderVideo> video_; 272 const std::unique_ptr<RTPSenderVideo> video_;
265 273
266 RtpPacketSender* const paced_sender_; 274 RtpPacketSender* const paced_sender_;
267 TransportSequenceNumberAllocator* const transport_sequence_number_allocator_; 275 TransportSequenceNumberAllocator* const transport_sequence_number_allocator_;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_); 321 uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_);
314 int64_t capture_time_ms_ GUARDED_BY(send_critsect_); 322 int64_t capture_time_ms_ GUARDED_BY(send_critsect_);
315 int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_); 323 int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_);
316 bool media_has_been_sent_ GUARDED_BY(send_critsect_); 324 bool media_has_been_sent_ GUARDED_BY(send_critsect_);
317 bool last_packet_marker_bit_ GUARDED_BY(send_critsect_); 325 bool last_packet_marker_bit_ GUARDED_BY(send_critsect_);
318 std::vector<uint32_t> csrcs_ GUARDED_BY(send_critsect_); 326 std::vector<uint32_t> csrcs_ GUARDED_BY(send_critsect_);
319 int rtx_ GUARDED_BY(send_critsect_); 327 int rtx_ GUARDED_BY(send_critsect_);
320 uint32_t ssrc_rtx_ GUARDED_BY(send_critsect_); 328 uint32_t ssrc_rtx_ GUARDED_BY(send_critsect_);
321 // Mapping rtx_payload_type_map_[associated] = rtx. 329 // Mapping rtx_payload_type_map_[associated] = rtx.
322 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); 330 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_);
331 int transport_overhead_per_packet_ GUARDED_BY(send_critsect_);
minyue-webrtc 2016/11/14 11:18:06 size_t transport_overhead_bytes_per_packet_
michaelt 2016/11/14 13:01:27 Done.
332 size_t rtp_overhead_per_packet_ GUARDED_BY(send_critsect_);
minyue-webrtc 2016/11/14 11:18:06 rtp_overhead_bytes_per_packet_
michaelt 2016/11/14 13:01:27 Done.
323 333
324 RateLimiter* const retransmission_rate_limiter_; 334 RateLimiter* const retransmission_rate_limiter_;
335 OverheadPerPacketObserver* const overhead_per_packet_observer_;
minyue-webrtc 2016/11/14 11:18:06 OverheadSizeObserver* const overhead_size_observer
michaelt 2016/11/14 13:01:27 Done.
325 336
326 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); 337 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender);
327 }; 338 };
328 339
329 } // namespace webrtc 340 } // namespace webrtc
330 341
331 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ 342 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698