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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 void AudioSender::ResendPacketsOnTransportThread( | 197 void AudioSender::ResendPacketsOnTransportThread( |
198 const transport::MissingFramesAndPacketsMap& missing_packets) { | 198 const transport::MissingFramesAndPacketsMap& missing_packets) { |
199 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); | 199 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); |
200 transport_sender_->ResendPackets(true, missing_packets); | 200 transport_sender_->ResendPackets(true, missing_packets); |
201 } | 201 } |
202 | 202 |
203 } // namespace cast | 203 } // namespace cast |
204 } // namespace media | 204 } // namespace media |
OLD | NEW |