OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/audio_sender/audio_sender.h" | 5 #include "media/cast/audio_sender/audio_sender.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "media/cast/audio_sender/audio_encoder.h" | 10 #include "media/cast/audio_sender/audio_encoder.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 base::TimeDelta time_since_last_send = now - time_sent_; | 55 base::TimeDelta time_since_last_send = now - time_sent_; |
56 sender_info_.rtp_timestamp = | 56 sender_info_.rtp_timestamp = |
57 rtp_timestamp_ + | 57 rtp_timestamp_ + |
58 time_since_last_send.InMilliseconds() * (frequency_ / 1000); | 58 time_since_last_send.InMilliseconds() * (frequency_ / 1000); |
59 } else { | 59 } else { |
60 sender_info_.rtp_timestamp = 0; | 60 sender_info_.rtp_timestamp = 0; |
61 } | 61 } |
62 memcpy(sender_info, &sender_info_, sizeof(transport::RtcpSenderInfo)); | 62 memcpy(sender_info, &sender_info_, sizeof(transport::RtcpSenderInfo)); |
63 } | 63 } |
64 | 64 |
65 void StoreStatistics(transport::RtcpSenderInfo& sender_info, | 65 void StoreStatistics(const transport::RtcpSenderInfo& sender_info, |
66 base::TimeTicks time_sent, | 66 base::TimeTicks time_sent, |
67 uint32 rtp_timestamp) { | 67 uint32 rtp_timestamp) { |
68 sender_info_ = sender_info; | 68 sender_info_ = sender_info; |
69 time_sent_ = time_sent; | 69 time_sent_ = time_sent; |
70 rtp_timestamp_ = rtp_timestamp; | 70 rtp_timestamp_ = rtp_timestamp; |
71 } | 71 } |
72 | 72 |
73 private: | 73 private: |
74 transport::CastTransportSender* const transport_sender_; | 74 transport::CastTransportSender* const transport_sender_; |
75 int frequency_; | 75 int frequency_; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 202 } |
203 | 203 |
204 void AudioSender::ResendPacketsOnTransportThread( | 204 void AudioSender::ResendPacketsOnTransportThread( |
205 const transport::MissingFramesAndPacketsMap& missing_packets) { | 205 const transport::MissingFramesAndPacketsMap& missing_packets) { |
206 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); | 206 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); |
207 transport_sender_->ResendPackets(true, missing_packets); | 207 transport_sender_->ResendPackets(true, missing_packets); |
208 } | 208 } |
209 | 209 |
210 } // namespace cast | 210 } // namespace cast |
211 } // namespace media | 211 } // namespace media |
OLD | NEW |