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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // Called on update of RTP statistics. | 204 // Called on update of RTP statistics. |
205 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); | 205 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); |
206 StreamDataCountersCallback* GetRtpStatisticsCallback() const; | 206 StreamDataCountersCallback* GetRtpStatisticsCallback() const; |
207 | 207 |
208 uint32_t BitrateSent() const; | 208 uint32_t BitrateSent() const; |
209 | 209 |
210 void SetRtpState(const RtpState& rtp_state); | 210 void SetRtpState(const RtpState& rtp_state); |
211 RtpState GetRtpState() const; | 211 RtpState GetRtpState() const; |
212 void SetRtxRtpState(const RtpState& rtp_state); | 212 void SetRtxRtpState(const RtpState& rtp_state); |
213 RtpState GetRtxRtpState() const; | 213 RtpState GetRtxRtpState() const; |
214 bool ActivateCVORtpHeaderExtension(); | |
215 | 214 |
216 protected: | 215 protected: |
217 int32_t CheckPayloadType(int8_t payload_type, RtpVideoCodecTypes* video_type); | 216 int32_t CheckPayloadType(int8_t payload_type, RtpVideoCodecTypes* video_type); |
218 | 217 |
219 private: | 218 private: |
220 // Maps capture time in milliseconds to send-side delay in milliseconds. | 219 // Maps capture time in milliseconds to send-side delay in milliseconds. |
221 // Send-side delay is the difference between transmission time and capture | 220 // Send-side delay is the difference between transmission time and capture |
222 // time. | 221 // time. |
223 typedef std::map<int64_t, int> SendDelayMap; | 222 typedef std::map<int64_t, int> SendDelayMap; |
224 | 223 |
(...skipping 18 matching lines...) Expand all Loading... |
243 const RtpPacketToSend& packet); | 242 const RtpPacketToSend& packet); |
244 | 243 |
245 bool SendPacketToNetwork(const RtpPacketToSend& packet, | 244 bool SendPacketToNetwork(const RtpPacketToSend& packet, |
246 const PacketOptions& options); | 245 const PacketOptions& options); |
247 | 246 |
248 void UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms); | 247 void UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms); |
249 void UpdateOnSendPacket(int packet_id, | 248 void UpdateOnSendPacket(int packet_id, |
250 int64_t capture_time_ms, | 249 int64_t capture_time_ms, |
251 uint32_t ssrc); | 250 uint32_t ssrc); |
252 | 251 |
253 // Find the byte position of the RTP extension as indicated by |type| in | |
254 // |rtp_packet|. Return false if such extension doesn't exist. | |
255 bool FindHeaderExtensionPosition(RTPExtensionType type, | |
256 const uint8_t* rtp_packet, | |
257 size_t rtp_packet_length, | |
258 const RTPHeader& rtp_header, | |
259 size_t* position) const | |
260 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_); | |
261 | |
262 bool UpdateTransportSequenceNumber(RtpPacketToSend* packet, | 252 bool UpdateTransportSequenceNumber(RtpPacketToSend* packet, |
263 int* packet_id) const; | 253 int* packet_id) const; |
264 | 254 |
265 void UpdatePlayoutDelayLimits(uint8_t* rtp_packet, | |
266 size_t rtp_packet_length, | |
267 const RTPHeader& rtp_header, | |
268 uint16_t min_playout_delay, | |
269 uint16_t max_playout_delay) const; | |
270 | |
271 void UpdateRtpStats(const RtpPacketToSend& packet, | 255 void UpdateRtpStats(const RtpPacketToSend& packet, |
272 bool is_rtx, | 256 bool is_rtx, |
273 bool is_retransmit); | 257 bool is_retransmit); |
274 bool IsFecPacket(const RtpPacketToSend& packet) const; | 258 bool IsFecPacket(const RtpPacketToSend& packet) const; |
275 | 259 |
276 Clock* const clock_; | 260 Clock* const clock_; |
277 const int64_t clock_delta_ms_; | 261 const int64_t clock_delta_ms_; |
278 Random random_ GUARDED_BY(send_critsect_); | 262 Random random_ GUARDED_BY(send_critsect_); |
279 | 263 |
280 const bool audio_configured_; | 264 const bool audio_configured_; |
281 const std::unique_ptr<RTPSenderAudio> audio_; | 265 const std::unique_ptr<RTPSenderAudio> audio_; |
282 const std::unique_ptr<RTPSenderVideo> video_; | 266 const std::unique_ptr<RTPSenderVideo> video_; |
283 | 267 |
284 RtpPacketSender* const paced_sender_; | 268 RtpPacketSender* const paced_sender_; |
285 TransportSequenceNumberAllocator* const transport_sequence_number_allocator_; | 269 TransportSequenceNumberAllocator* const transport_sequence_number_allocator_; |
286 TransportFeedbackObserver* const transport_feedback_observer_; | 270 TransportFeedbackObserver* const transport_feedback_observer_; |
287 int64_t last_capture_time_ms_sent_; | 271 int64_t last_capture_time_ms_sent_; |
288 rtc::CriticalSection send_critsect_; | 272 rtc::CriticalSection send_critsect_; |
289 | 273 |
290 Transport *transport_; | 274 Transport *transport_; |
291 bool sending_media_ GUARDED_BY(send_critsect_); | 275 bool sending_media_ GUARDED_BY(send_critsect_); |
292 | 276 |
293 size_t max_payload_length_; | 277 size_t max_payload_length_; |
294 | 278 |
295 int8_t payload_type_ GUARDED_BY(send_critsect_); | 279 int8_t payload_type_ GUARDED_BY(send_critsect_); |
296 std::map<int8_t, RtpUtility::Payload*> payload_type_map_; | 280 std::map<int8_t, RtpUtility::Payload*> payload_type_map_; |
297 | 281 |
298 RtpHeaderExtensionMap rtp_header_extension_map_ GUARDED_BY(send_critsect_); | 282 RtpHeaderExtensionMap rtp_header_extension_map_ GUARDED_BY(send_critsect_); |
299 bool video_rotation_active_; | |
300 | 283 |
301 // Tracks the current request for playout delay limits from application | 284 // Tracks the current request for playout delay limits from application |
302 // and decides whether the current RTP frame should include the playout | 285 // and decides whether the current RTP frame should include the playout |
303 // delay extension on header. | 286 // delay extension on header. |
304 PlayoutDelayOracle playout_delay_oracle_; | 287 PlayoutDelayOracle playout_delay_oracle_; |
305 bool playout_delay_active_ GUARDED_BY(send_critsect_); | |
306 | 288 |
307 RtpPacketHistory packet_history_; | 289 RtpPacketHistory packet_history_; |
308 | 290 |
309 // Statistics | 291 // Statistics |
310 rtc::CriticalSection statistics_crit_; | 292 rtc::CriticalSection statistics_crit_; |
311 SendDelayMap send_delays_ GUARDED_BY(statistics_crit_); | 293 SendDelayMap send_delays_ GUARDED_BY(statistics_crit_); |
312 FrameCounts frame_counts_ GUARDED_BY(statistics_crit_); | 294 FrameCounts frame_counts_ GUARDED_BY(statistics_crit_); |
313 StreamDataCounters rtp_stats_ GUARDED_BY(statistics_crit_); | 295 StreamDataCounters rtp_stats_ GUARDED_BY(statistics_crit_); |
314 StreamDataCounters rtx_rtp_stats_ GUARDED_BY(statistics_crit_); | 296 StreamDataCounters rtx_rtp_stats_ GUARDED_BY(statistics_crit_); |
315 StreamDataCountersCallback* rtp_stats_callback_ GUARDED_BY(statistics_crit_); | 297 StreamDataCountersCallback* rtp_stats_callback_ GUARDED_BY(statistics_crit_); |
(...skipping 26 matching lines...) Expand all Loading... |
342 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_); |
343 | 325 |
344 RateLimiter* const retransmission_rate_limiter_; | 326 RateLimiter* const retransmission_rate_limiter_; |
345 | 327 |
346 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); | 328 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); |
347 }; | 329 }; |
348 | 330 |
349 } // namespace webrtc | 331 } // namespace webrtc |
350 | 332 |
351 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 333 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
OLD | NEW |