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/video_sender/video_sender.h" | 5 #include "media/cast/video_sender/video_sender.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 base::TimeDelta time_since_last_send = now - time_sent_; | 59 base::TimeDelta time_since_last_send = now - time_sent_; |
60 sender_info_.rtp_timestamp = | 60 sender_info_.rtp_timestamp = |
61 rtp_timestamp_ + | 61 rtp_timestamp_ + |
62 time_since_last_send.InMilliseconds() * (kVideoFrequency / 1000); | 62 time_since_last_send.InMilliseconds() * (kVideoFrequency / 1000); |
63 } else { | 63 } else { |
64 sender_info_.rtp_timestamp = 0; | 64 sender_info_.rtp_timestamp = 0; |
65 } | 65 } |
66 memcpy(sender_info, &sender_info_, sizeof(transport::RtcpSenderInfo)); | 66 memcpy(sender_info, &sender_info_, sizeof(transport::RtcpSenderInfo)); |
67 } | 67 } |
68 | 68 |
69 void StoreStatistics(transport::RtcpSenderInfo& sender_info, | 69 void StoreStatistics(const transport::RtcpSenderInfo& sender_info, |
70 base::TimeTicks time_sent, | 70 base::TimeTicks time_sent, |
71 uint32 rtp_timestamp) { | 71 uint32 rtp_timestamp) { |
72 sender_info_ = sender_info; | 72 sender_info_ = sender_info; |
73 time_sent_ = time_sent; | 73 time_sent_ = time_sent; |
74 rtp_timestamp_ = rtp_timestamp; | 74 rtp_timestamp_ = rtp_timestamp; |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
78 transport::CastTransportSender* const transport_sender_; | 78 transport::CastTransportSender* const transport_sender_; |
79 transport::RtcpSenderInfo sender_info_; | 79 transport::RtcpSenderInfo sender_info_; |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 473 |
474 void VideoSender::ResendPacketsOnTransportThread( | 474 void VideoSender::ResendPacketsOnTransportThread( |
475 const transport::MissingFramesAndPacketsMap& missing_packets) { | 475 const transport::MissingFramesAndPacketsMap& missing_packets) { |
476 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); | 476 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); |
477 last_send_time_ = cast_environment_->Clock()->NowTicks(); | 477 last_send_time_ = cast_environment_->Clock()->NowTicks(); |
478 transport_sender_->ResendPackets(false, missing_packets); | 478 transport_sender_->ResendPackets(false, missing_packets); |
479 } | 479 } |
480 | 480 |
481 } // namespace cast | 481 } // namespace cast |
482 } // namespace media | 482 } // namespace media |
OLD | NEW |