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 14 matching lines...) Expand all Loading... |
25 #include "webrtc/base/rate_statistics.h" | 25 #include "webrtc/base/rate_statistics.h" |
26 #include "webrtc/base/thread_annotations.h" | 26 #include "webrtc/base/thread_annotations.h" |
27 #include "webrtc/common_types.h" | 27 #include "webrtc/common_types.h" |
28 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h" | 28 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h" |
29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
30 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" | 30 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" |
31 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" | 31 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" |
32 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h" | 32 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h" |
33 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" | 33 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" |
34 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 34 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| 35 #include "webrtc/modules/rtp_rtcp/source/ssrc_database.h" |
35 | 36 |
36 namespace webrtc { | 37 namespace webrtc { |
37 | 38 |
38 class OverheadObserver; | 39 class OverheadObserver; |
39 class RateLimiter; | 40 class RateLimiter; |
40 class RtcEventLog; | 41 class RtcEventLog; |
41 class RtpPacketToSend; | 42 class RtpPacketToSend; |
42 class RTPSenderAudio; | 43 class RTPSenderAudio; |
43 class RTPSenderVideo; | 44 class RTPSenderVideo; |
44 | 45 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const uint32_t frequency, | 80 const uint32_t frequency, |
80 const size_t channels, | 81 const size_t channels, |
81 const uint32_t rate); | 82 const uint32_t rate); |
82 | 83 |
83 int32_t DeRegisterSendPayload(const int8_t payload_type); | 84 int32_t DeRegisterSendPayload(const int8_t payload_type); |
84 | 85 |
85 void SetSendPayloadType(int8_t payload_type); | 86 void SetSendPayloadType(int8_t payload_type); |
86 | 87 |
87 int8_t SendPayloadType() const; | 88 int8_t SendPayloadType() const; |
88 | 89 |
| 90 void SetSendingStatus(bool enabled); |
| 91 |
89 void SetSendingMediaStatus(bool enabled); | 92 void SetSendingMediaStatus(bool enabled); |
90 bool SendingMedia() const; | 93 bool SendingMedia() const; |
91 | 94 |
92 void GetDataCounters(StreamDataCounters* rtp_stats, | 95 void GetDataCounters(StreamDataCounters* rtp_stats, |
93 StreamDataCounters* rtx_stats) const; | 96 StreamDataCounters* rtx_stats) const; |
94 | 97 |
95 uint32_t TimestampOffset() const; | 98 uint32_t TimestampOffset() const; |
96 void SetTimestampOffset(uint32_t timestamp); | 99 void SetTimestampOffset(uint32_t timestamp); |
97 | 100 |
| 101 uint32_t GenerateNewSSRC(); |
98 void SetSSRC(uint32_t ssrc); | 102 void SetSSRC(uint32_t ssrc); |
99 | 103 |
100 uint16_t SequenceNumber() const; | 104 uint16_t SequenceNumber() const; |
101 void SetSequenceNumber(uint16_t seq); | 105 void SetSequenceNumber(uint16_t seq); |
102 | 106 |
103 void SetCsrcs(const std::vector<uint32_t>& csrcs); | 107 void SetCsrcs(const std::vector<uint32_t>& csrcs); |
104 | 108 |
105 void SetMaxRtpPacketSize(size_t max_packet_size); | 109 void SetMaxRtpPacketSize(size_t max_packet_size); |
106 | 110 |
107 bool SendOutgoingData(FrameType frame_type, | 111 bool SendOutgoingData(FrameType frame_type, |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 RateStatistics total_bitrate_sent_ GUARDED_BY(statistics_crit_); | 298 RateStatistics total_bitrate_sent_ GUARDED_BY(statistics_crit_); |
295 RateStatistics nack_bitrate_sent_ GUARDED_BY(statistics_crit_); | 299 RateStatistics nack_bitrate_sent_ GUARDED_BY(statistics_crit_); |
296 FrameCountObserver* const frame_count_observer_; | 300 FrameCountObserver* const frame_count_observer_; |
297 SendSideDelayObserver* const send_side_delay_observer_; | 301 SendSideDelayObserver* const send_side_delay_observer_; |
298 RtcEventLog* const event_log_; | 302 RtcEventLog* const event_log_; |
299 SendPacketObserver* const send_packet_observer_; | 303 SendPacketObserver* const send_packet_observer_; |
300 BitrateStatisticsObserver* const bitrate_callback_; | 304 BitrateStatisticsObserver* const bitrate_callback_; |
301 | 305 |
302 // RTP variables | 306 // RTP variables |
303 uint32_t timestamp_offset_ GUARDED_BY(send_critsect_); | 307 uint32_t timestamp_offset_ GUARDED_BY(send_critsect_); |
| 308 SSRCDatabase* const ssrc_db_; |
304 uint32_t remote_ssrc_ GUARDED_BY(send_critsect_); | 309 uint32_t remote_ssrc_ GUARDED_BY(send_critsect_); |
305 bool sequence_number_forced_ GUARDED_BY(send_critsect_); | 310 bool sequence_number_forced_ GUARDED_BY(send_critsect_); |
306 uint16_t sequence_number_ GUARDED_BY(send_critsect_); | 311 uint16_t sequence_number_ GUARDED_BY(send_critsect_); |
307 uint16_t sequence_number_rtx_ GUARDED_BY(send_critsect_); | 312 uint16_t sequence_number_rtx_ GUARDED_BY(send_critsect_); |
308 // Must be explicitly set by the application, use of rtc::Optional | 313 bool ssrc_forced_ GUARDED_BY(send_critsect_); |
309 // only to keep track of correct use. | 314 uint32_t ssrc_ GUARDED_BY(send_critsect_); |
310 rtc::Optional<uint32_t> ssrc_ GUARDED_BY(send_critsect_); | |
311 uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_); | 315 uint32_t last_rtp_timestamp_ GUARDED_BY(send_critsect_); |
312 int64_t capture_time_ms_ GUARDED_BY(send_critsect_); | 316 int64_t capture_time_ms_ GUARDED_BY(send_critsect_); |
313 int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_); | 317 int64_t last_timestamp_time_ms_ GUARDED_BY(send_critsect_); |
314 bool media_has_been_sent_ GUARDED_BY(send_critsect_); | 318 bool media_has_been_sent_ GUARDED_BY(send_critsect_); |
315 bool last_packet_marker_bit_ GUARDED_BY(send_critsect_); | 319 bool last_packet_marker_bit_ GUARDED_BY(send_critsect_); |
316 std::vector<uint32_t> csrcs_ GUARDED_BY(send_critsect_); | 320 std::vector<uint32_t> csrcs_ GUARDED_BY(send_critsect_); |
317 int rtx_ GUARDED_BY(send_critsect_); | 321 int rtx_ GUARDED_BY(send_critsect_); |
318 rtc::Optional<uint32_t> ssrc_rtx_ GUARDED_BY(send_critsect_); | 322 uint32_t ssrc_rtx_ GUARDED_BY(send_critsect_); |
319 // Mapping rtx_payload_type_map_[associated] = rtx. | 323 // Mapping rtx_payload_type_map_[associated] = rtx. |
320 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); | 324 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); |
321 size_t rtp_overhead_bytes_per_packet_ GUARDED_BY(send_critsect_); | 325 size_t rtp_overhead_bytes_per_packet_ GUARDED_BY(send_critsect_); |
322 | 326 |
323 RateLimiter* const retransmission_rate_limiter_; | 327 RateLimiter* const retransmission_rate_limiter_; |
324 OverheadObserver* overhead_observer_; | 328 OverheadObserver* overhead_observer_; |
325 | 329 |
326 const bool send_side_bwe_with_overhead_; | 330 const bool send_side_bwe_with_overhead_; |
327 | 331 |
328 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); | 332 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); |
329 }; | 333 }; |
330 | 334 |
331 } // namespace webrtc | 335 } // namespace webrtc |
332 | 336 |
333 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 337 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
OLD | NEW |