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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } else { | 171 } else { |
172 LOG(ERROR) << "Encryption failed. Not sending frame with ID " | 172 LOG(ERROR) << "Encryption failed. Not sending frame with ID " |
173 << frame.frame_id; | 173 << frame.frame_id; |
174 } | 174 } |
175 } else { | 175 } else { |
176 sender->SendFrame(frame); | 176 sender->SendFrame(frame); |
177 } | 177 } |
178 } | 178 } |
179 } // namespace | 179 } // namespace |
180 | 180 |
181 void CastTransportSenderImpl::InsertCodedAudioFrame( | 181 void CastTransportSenderImpl::InsertFrame(uint32 ssrc, |
182 const EncodedFrame& audio_frame) { | 182 const EncodedFrame& frame) { |
183 DCHECK(audio_sender_) << "Audio sender uninitialized"; | 183 if (audio_sender_ && ssrc == audio_sender_->ssrc()) { |
184 EncryptAndSendFrame(audio_frame, &audio_encryptor_, audio_sender_.get()); | 184 EncryptAndSendFrame(frame, &audio_encryptor_, audio_sender_.get()); |
185 } | 185 } else if (video_sender_ && ssrc == video_sender_->ssrc()) { |
186 | 186 EncryptAndSendFrame(frame, &video_encryptor_, video_sender_.get()); |
187 void CastTransportSenderImpl::InsertCodedVideoFrame( | 187 } else { |
188 const EncodedFrame& video_frame) { | 188 NOTREACHED() << "Invalid InsertFrame call."; |
189 DCHECK(video_sender_) << "Video sender uninitialized"; | 189 } |
190 EncryptAndSendFrame(video_frame, &video_encryptor_, video_sender_.get()); | |
191 } | 190 } |
192 | 191 |
193 void CastTransportSenderImpl::SendSenderReport( | 192 void CastTransportSenderImpl::SendSenderReport( |
194 uint32 ssrc, | 193 uint32 ssrc, |
195 base::TimeTicks current_time, | 194 base::TimeTicks current_time, |
196 uint32 current_time_as_rtp_timestamp) { | 195 uint32 current_time_as_rtp_timestamp) { |
197 if (audio_sender_ && ssrc == audio_sender_->ssrc()) { | 196 if (audio_sender_ && ssrc == audio_sender_->ssrc()) { |
198 audio_rtcp_session_->SendRtcpFromRtpSender( | 197 audio_rtcp_session_->SendRtcpFromRtpSender( |
199 current_time, current_time_as_rtp_timestamp, | 198 current_time, current_time_as_rtp_timestamp, |
200 audio_sender_->send_packet_count(), audio_sender_->send_octet_count()); | 199 audio_sender_->send_packet_count(), audio_sender_->send_octet_count()); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // 2. Specifies a deduplication window. For video this would be the most | 355 // 2. Specifies a deduplication window. For video this would be the most |
357 // recent RTT. For audio there is no deduplication. | 356 // recent RTT. For audio there is no deduplication. |
358 ResendPackets(ssrc, | 357 ResendPackets(ssrc, |
359 cast_message.missing_frames_and_packets, | 358 cast_message.missing_frames_and_packets, |
360 true, | 359 true, |
361 dedup_info); | 360 dedup_info); |
362 } | 361 } |
363 | 362 |
364 } // namespace cast | 363 } // namespace cast |
365 } // namespace media | 364 } // namespace media |
OLD | NEW |