OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/cast/sender/frame_sender.h" | 5 #include "media/cast/sender/frame_sender.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // The additional number of frames that can be in-flight when input exceeds the | 25 // The additional number of frames that can be in-flight when input exceeds the |
26 // maximum frame rate. | 26 // maximum frame rate. |
27 const int kMaxFrameBurst = 5; | 27 const int kMaxFrameBurst = 5; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 // Convenience macro used in logging statements throughout this file. | 31 // Convenience macro used in logging statements throughout this file. |
32 #define SENDER_SSRC (is_audio_ ? "AUDIO[" : "VIDEO[") << ssrc_ << "] " | 32 #define SENDER_SSRC (is_audio_ ? "AUDIO[" : "VIDEO[") << ssrc_ << "] " |
33 | 33 |
| 34 FrameSender::RtcpClient::RtcpClient(base::WeakPtr<FrameSender> frame_sender) |
| 35 : frame_sender_(frame_sender) {} |
| 36 |
| 37 FrameSender::RtcpClient::~RtcpClient() {} |
| 38 |
| 39 void FrameSender::RtcpClient::OnReceivedCastMessage( |
| 40 const RtcpCastMessage& cast_message) { |
| 41 if (frame_sender_) |
| 42 frame_sender_->OnReceivedCastFeedback(cast_message); |
| 43 } |
| 44 |
| 45 void FrameSender::RtcpClient::OnReceivedRtt(base::TimeDelta round_trip_time) { |
| 46 if (frame_sender_) |
| 47 frame_sender_->OnMeasuredRoundTripTime(round_trip_time); |
| 48 } |
| 49 |
| 50 void FrameSender::RtcpClient::OnReceivedPli() { |
| 51 if (frame_sender_) |
| 52 frame_sender_->OnReceivedPli(); |
| 53 } |
| 54 |
34 FrameSender::FrameSender(scoped_refptr<CastEnvironment> cast_environment, | 55 FrameSender::FrameSender(scoped_refptr<CastEnvironment> cast_environment, |
35 bool is_audio, | 56 bool is_audio, |
36 CastTransport* const transport_sender, | 57 CastTransport* const transport_sender, |
37 int rtp_timebase, | 58 int rtp_timebase, |
38 uint32_t ssrc, | 59 uint32_t ssrc, |
39 double max_frame_rate, | 60 double max_frame_rate, |
40 base::TimeDelta min_playout_delay, | 61 base::TimeDelta min_playout_delay, |
41 base::TimeDelta max_playout_delay, | 62 base::TimeDelta max_playout_delay, |
42 base::TimeDelta animated_playout_delay, | 63 base::TimeDelta animated_playout_delay, |
43 CongestionControl* congestion_control) | 64 CongestionControl* congestion_control) |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 VLOG(1) << SENDER_SSRC << "Dropping: In-flight duration would be too high."; | 460 VLOG(1) << SENDER_SSRC << "Dropping: In-flight duration would be too high."; |
440 return true; | 461 return true; |
441 } | 462 } |
442 | 463 |
443 // Next frame is accepted. | 464 // Next frame is accepted. |
444 return false; | 465 return false; |
445 } | 466 } |
446 | 467 |
447 } // namespace cast | 468 } // namespace cast |
448 } // namespace media | 469 } // namespace media |
OLD | NEW |