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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // The additional number of frames that can be in-flight when input exceeds the | 26 // The additional number of frames that can be in-flight when input exceeds the |
27 // maximum frame rate. | 27 // maximum frame rate. |
28 const int kMaxFrameBurst = 5; | 28 const int kMaxFrameBurst = 5; |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 // Convenience macro used in logging statements throughout this file. | 32 // Convenience macro used in logging statements throughout this file. |
33 #define SENDER_SSRC (is_audio_ ? "AUDIO[" : "VIDEO[") << ssrc_ << "] " | 33 #define SENDER_SSRC (is_audio_ ? "AUDIO[" : "VIDEO[") << ssrc_ << "] " |
34 | 34 |
| 35 FrameSender::RtcpObserver::RtcpObserver(base::WeakPtr<FrameSender> frame_sender) |
| 36 : frame_sender_(frame_sender) {} |
| 37 |
| 38 FrameSender::RtcpObserver::~RtcpObserver() {} |
| 39 |
| 40 void FrameSender::RtcpObserver::OnCastMessageReceived( |
| 41 const RtcpCastMessage& cast_message) { |
| 42 if (frame_sender_) |
| 43 frame_sender_->OnReceivedCastFeedback(cast_message); |
| 44 } |
| 45 |
| 46 void FrameSender::RtcpObserver::OnRttReceived(base::TimeDelta round_trip_time) { |
| 47 if (frame_sender_) |
| 48 frame_sender_->OnMeasuredRoundTripTime(round_trip_time); |
| 49 } |
| 50 |
| 51 void FrameSender::RtcpObserver::OnPliReceived() { |
| 52 if (frame_sender_) |
| 53 frame_sender_->OnReceivedPli(); |
| 54 } |
| 55 |
35 FrameSender::FrameSender(scoped_refptr<CastEnvironment> cast_environment, | 56 FrameSender::FrameSender(scoped_refptr<CastEnvironment> cast_environment, |
36 bool is_audio, | 57 bool is_audio, |
37 CastTransport* const transport_sender, | 58 CastTransport* const transport_sender, |
38 int rtp_timebase, | 59 int rtp_timebase, |
39 uint32_t ssrc, | 60 uint32_t ssrc, |
40 double max_frame_rate, | 61 double max_frame_rate, |
41 base::TimeDelta min_playout_delay, | 62 base::TimeDelta min_playout_delay, |
42 base::TimeDelta max_playout_delay, | 63 base::TimeDelta max_playout_delay, |
43 base::TimeDelta animated_playout_delay, | 64 base::TimeDelta animated_playout_delay, |
44 CongestionControl* congestion_control) | 65 CongestionControl* congestion_control) |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 VLOG(1) << SENDER_SSRC << "Dropping: In-flight duration would be too high."; | 465 VLOG(1) << SENDER_SSRC << "Dropping: In-flight duration would be too high."; |
445 return true; | 466 return true; |
446 } | 467 } |
447 | 468 |
448 // Next frame is accepted. | 469 // Next frame is accepted. |
449 return false; | 470 return false; |
450 } | 471 } |
451 | 472 |
452 } // namespace cast | 473 } // namespace cast |
453 } // namespace media | 474 } // namespace media |
OLD | NEW |