| 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/net/cast_transport_sender_impl.h" | 5 #include "media/cast/net/cast_transport_sender_impl.h" |
| 6 | 6 |
| 7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
| 8 #include "media/cast/net/cast_transport_config.h" | 8 #include "media/cast/net/cast_transport_config.h" |
| 9 #include "media/cast/net/cast_transport_defines.h" | 9 #include "media/cast/net/cast_transport_defines.h" |
| 10 #include "media/cast/net/udp_transport.h" | 10 #include "media/cast/net/udp_transport.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 audio_rtcp_session_.reset( | 113 audio_rtcp_session_.reset( |
| 114 new Rtcp(cast_message_cb, | 114 new Rtcp(cast_message_cb, |
| 115 rtt_cb, | 115 rtt_cb, |
| 116 base::Bind(&CastTransportSenderImpl::OnReceivedLogMessage, | 116 base::Bind(&CastTransportSenderImpl::OnReceivedLogMessage, |
| 117 weak_factory_.GetWeakPtr(), AUDIO_EVENT), | 117 weak_factory_.GetWeakPtr(), AUDIO_EVENT), |
| 118 clock_, | 118 clock_, |
| 119 &pacer_, | 119 &pacer_, |
| 120 config.ssrc, | 120 config.ssrc, |
| 121 config.feedback_ssrc, | 121 config.feedback_ssrc)); |
| 122 config.c_name)); | |
| 123 pacer_.RegisterAudioSsrc(config.ssrc); | 122 pacer_.RegisterAudioSsrc(config.ssrc); |
| 124 status_callback_.Run(TRANSPORT_AUDIO_INITIALIZED); | 123 status_callback_.Run(TRANSPORT_AUDIO_INITIALIZED); |
| 125 } | 124 } |
| 126 | 125 |
| 127 void CastTransportSenderImpl::InitializeVideo( | 126 void CastTransportSenderImpl::InitializeVideo( |
| 128 const CastTransportRtpConfig& config, | 127 const CastTransportRtpConfig& config, |
| 129 const RtcpCastMessageCallback& cast_message_cb, | 128 const RtcpCastMessageCallback& cast_message_cb, |
| 130 const RtcpRttCallback& rtt_cb) { | 129 const RtcpRttCallback& rtt_cb) { |
| 131 LOG_IF(WARNING, config.aes_key.empty() || config.aes_iv_mask.empty()) | 130 LOG_IF(WARNING, config.aes_key.empty() || config.aes_iv_mask.empty()) |
| 132 << "Unsafe to send video with encryption DISABLED."; | 131 << "Unsafe to send video with encryption DISABLED."; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 143 } | 142 } |
| 144 | 143 |
| 145 video_rtcp_session_.reset( | 144 video_rtcp_session_.reset( |
| 146 new Rtcp(cast_message_cb, | 145 new Rtcp(cast_message_cb, |
| 147 rtt_cb, | 146 rtt_cb, |
| 148 base::Bind(&CastTransportSenderImpl::OnReceivedLogMessage, | 147 base::Bind(&CastTransportSenderImpl::OnReceivedLogMessage, |
| 149 weak_factory_.GetWeakPtr(), VIDEO_EVENT), | 148 weak_factory_.GetWeakPtr(), VIDEO_EVENT), |
| 150 clock_, | 149 clock_, |
| 151 &pacer_, | 150 &pacer_, |
| 152 config.ssrc, | 151 config.ssrc, |
| 153 config.feedback_ssrc, | 152 config.feedback_ssrc)); |
| 154 config.c_name)); | |
| 155 pacer_.RegisterVideoSsrc(config.ssrc); | 153 pacer_.RegisterVideoSsrc(config.ssrc); |
| 156 status_callback_.Run(TRANSPORT_VIDEO_INITIALIZED); | 154 status_callback_.Run(TRANSPORT_VIDEO_INITIALIZED); |
| 157 } | 155 } |
| 158 | 156 |
| 159 namespace { | 157 namespace { |
| 160 void EncryptAndSendFrame(const EncodedFrame& frame, | 158 void EncryptAndSendFrame(const EncodedFrame& frame, |
| 161 TransportEncryptionHandler* encryptor, | 159 TransportEncryptionHandler* encryptor, |
| 162 RtpSender* sender) { | 160 RtpSender* sender) { |
| 163 if (encryptor->is_activated()) { | 161 if (encryptor->is_activated()) { |
| 164 EncodedFrame encrypted_frame; | 162 EncodedFrame encrypted_frame; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 VLOG(2) << "Received log message via RTCP that we did not expect: " | 288 VLOG(2) << "Received log message via RTCP that we did not expect: " |
| 291 << static_cast<int>(event_it->type); | 289 << static_cast<int>(event_it->type); |
| 292 break; | 290 break; |
| 293 } | 291 } |
| 294 } | 292 } |
| 295 } | 293 } |
| 296 } | 294 } |
| 297 | 295 |
| 298 } // namespace cast | 296 } // namespace cast |
| 299 } // namespace media | 297 } // namespace media |
| OLD | NEW |