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/receiver/frame_receiver.h" | 5 #include "media/cast/receiver/frame_receiver.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/big_endian.h" | 10 #include "base/big_endian.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 : cast_environment_(cast_environment), | 41 : cast_environment_(cast_environment), |
42 transport_(transport), | 42 transport_(transport), |
43 packet_parser_(config.sender_ssrc, | 43 packet_parser_(config.sender_ssrc, |
44 static_cast<uint8_t>(config.rtp_payload_type)), | 44 static_cast<uint8_t>(config.rtp_payload_type)), |
45 stats_(cast_environment->Clock()), | 45 stats_(cast_environment->Clock()), |
46 event_media_type_(event_media_type), | 46 event_media_type_(event_media_type), |
47 event_subscriber_(kReceiverRtcpEventHistorySize, event_media_type), | 47 event_subscriber_(kReceiverRtcpEventHistorySize, event_media_type), |
48 rtp_timebase_(config.rtp_timebase), | 48 rtp_timebase_(config.rtp_timebase), |
49 target_playout_delay_( | 49 target_playout_delay_( |
50 base::TimeDelta::FromMilliseconds(config.rtp_max_delay_ms)), | 50 base::TimeDelta::FromMilliseconds(config.rtp_max_delay_ms)), |
51 expected_frame_duration_(base::TimeDelta::FromSeconds(1) / | 51 expected_frame_duration_( |
52 config.target_frame_rate), | 52 base::TimeDelta::FromSecondsD(1.0 / config.target_frame_rate)), |
53 reports_are_scheduled_(false), | 53 reports_are_scheduled_(false), |
54 framer_(cast_environment->Clock(), | 54 framer_(cast_environment->Clock(), |
55 this, | 55 this, |
56 config.sender_ssrc, | 56 config.sender_ssrc, |
57 true, | 57 true, |
58 config.rtp_max_delay_ms * config.target_frame_rate / 1000), | 58 static_cast<int>( |
| 59 config.rtp_max_delay_ms * config.target_frame_rate / 1000)), |
59 rtcp_(cast_environment_->Clock(), | 60 rtcp_(cast_environment_->Clock(), |
60 config.receiver_ssrc, | 61 config.receiver_ssrc, |
61 config.sender_ssrc), | 62 config.sender_ssrc), |
62 is_waiting_for_consecutive_frame_(false), | 63 is_waiting_for_consecutive_frame_(false), |
63 lip_sync_drift_(ClockDriftSmoother::GetDefaultTimeConstant()), | 64 lip_sync_drift_(ClockDriftSmoother::GetDefaultTimeConstant()), |
64 weak_factory_(this) { | 65 weak_factory_(this) { |
65 transport_->AddValidRtpReceiver(config.sender_ssrc, config.receiver_ssrc); | 66 transport_->AddValidRtpReceiver(config.sender_ssrc, config.receiver_ssrc); |
66 DCHECK_GT(config.rtp_max_delay_ms, 0); | 67 DCHECK_GT(config.rtp_max_delay_ms, 0); |
67 DCHECK_GT(config.target_frame_rate, 0); | 68 DCHECK_GT(config.target_frame_rate, 0); |
68 decryptor_.Initialize(config.aes_key, config.aes_iv_mask); | 69 decryptor_.Initialize(config.aes_key, config.aes_iv_mask); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 transport_->AddCastFeedback(*cast_message, target_delay); | 395 transport_->AddCastFeedback(*cast_message, target_delay); |
395 if (pli_message) | 396 if (pli_message) |
396 transport_->AddPli(*pli_message); | 397 transport_->AddPli(*pli_message); |
397 if (rtcp_events) | 398 if (rtcp_events) |
398 transport_->AddRtcpEvents(*rtcp_events); | 399 transport_->AddRtcpEvents(*rtcp_events); |
399 transport_->SendRtcpFromRtpReceiver(); | 400 transport_->SendRtcpFromRtpReceiver(); |
400 } | 401 } |
401 | 402 |
402 } // namespace cast | 403 } // namespace cast |
403 } // namespace media | 404 } // namespace media |
OLD | NEW |