Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: media/cast/transport/rtp_sender/rtp_sender.cc

Issue 138753004: Cast: IPC glue between cast library transport and encoders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor cleanup Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/cast/transport/rtp_sender/rtp_sender.h ('k') | media/cast/video_sender/video_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/transport/rtp_sender/rtp_sender.h" 5 #include "media/cast/transport/rtp_sender/rtp_sender.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "media/cast/transport/cast_transport_defines.h" 9 #include "media/cast/transport/cast_transport_defines.h"
10 #include "media/cast/transport/pacing/paced_sender.h" 10 #include "media/cast/transport/pacing/paced_sender.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 void RtpSender::SubscribeRtpStatsCallback( 128 void RtpSender::SubscribeRtpStatsCallback(
129 const CastTransportRtpStatistics& callback) { 129 const CastTransportRtpStatistics& callback) {
130 stats_callback_ = callback; 130 stats_callback_ = callback;
131 ScheduleNextStatsReport(); 131 ScheduleNextStatsReport();
132 } 132 }
133 133
134 void RtpSender::ScheduleNextStatsReport() { 134 void RtpSender::ScheduleNextStatsReport() {
135 transport_task_runner_->PostDelayedTask( 135 transport_task_runner_->PostDelayedTask(
136 FROM_HERE, 136 FROM_HERE,
137 base::Bind(&RtpSender::RtpStatistics, base::Unretained(this)), 137 base::Bind(&RtpSender::RtpStatistics, base::AsWeakPtr(this)),
138 base::TimeDelta::FromMilliseconds(kStatsCallbackIntervalMs)); 138 base::TimeDelta::FromMilliseconds(kStatsCallbackIntervalMs));
139 } 139 }
140 140
141 void RtpSender::RtpStatistics() { 141 void RtpSender::RtpStatistics() {
142 RtcpSenderInfo sender_info; 142 RtcpSenderInfo sender_info;
143 base::TimeTicks time_sent; 143 base::TimeTicks time_sent;
144 uint32 rtp_timestamp = 0; 144 uint32 rtp_timestamp = 0;
145 packetizer_->LastSentTimestamp(&time_sent, &rtp_timestamp); 145 packetizer_->LastSentTimestamp(&time_sent, &rtp_timestamp);
146 sender_info.send_packet_count = packetizer_->send_packets_count(); 146 sender_info.send_packet_count = packetizer_->send_packets_count();
147 sender_info.send_octet_count = packetizer_->send_octet_count(); 147 sender_info.send_octet_count = packetizer_->send_octet_count();
148 stats_callback_.Run(sender_info, time_sent, rtp_timestamp); 148 stats_callback_.Run(sender_info, time_sent, rtp_timestamp);
149 ScheduleNextStatsReport(); 149 ScheduleNextStatsReport();
150 } 150 }
151 151
152 } // namespace transport 152 } // namespace transport
153 } // namespace cast 153 } // namespace cast
154 } // namespace media 154 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/transport/rtp_sender/rtp_sender.h ('k') | media/cast/video_sender/video_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698