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

Unified Diff: media/cast/video_sender/video_sender.cc

Issue 147993010: Cast: end2end bug fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/video_receiver/video_receiver.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/video_sender/video_sender.cc
diff --git a/media/cast/video_sender/video_sender.cc b/media/cast/video_sender/video_sender.cc
index bb1e2e9b0f096f12cce50e91c27a80fd9d66fade..4662d0acb31ca95a2284e18a96a486acbd5aab93 100644
--- a/media/cast/video_sender/video_sender.cc
+++ b/media/cast/video_sender/video_sender.cc
@@ -55,15 +55,22 @@ class LocalRtpVideoSenderStatistics : public RtpSenderStatistics {
virtual void GetStatistics(const base::TimeTicks& now,
transport::RtcpSenderInfo* sender_info) OVERRIDE {
// Update RTP timestamp and return last stored statistics.
- if (rtp_timestamp_) {
+ uint32 ntp_seconds = 0;
+ uint32 ntp_fraction = 0;
+ uint32 rtp_timestamp = 0;
+ if (rtp_timestamp_ > 0) {
base::TimeDelta time_since_last_send = now - time_sent_;
- sender_info_.rtp_timestamp =
- rtp_timestamp_ +
- time_since_last_send.InMilliseconds() * (kVideoFrequency / 1000);
- } else {
- sender_info_.rtp_timestamp = 0;
+ rtp_timestamp = rtp_timestamp_ + time_since_last_send.InMilliseconds() *
+ (kVideoFrequency / 1000);
+ // Update NTP time to current time.
+ ConvertTimeTicksToNtp(now, &ntp_seconds, &ntp_fraction);
}
- memcpy(sender_info, &sender_info_, sizeof(transport::RtcpSenderInfo));
+ // Populate sender info.
+ sender_info->rtp_timestamp = rtp_timestamp;
+ sender_info->ntp_seconds = ntp_seconds;
+ sender_info->ntp_fraction = ntp_fraction;
+ sender_info->send_packet_count = sender_info_.send_packet_count;
+ sender_info->send_octet_count = sender_info_.send_octet_count;
}
void StoreStatistics(transport::RtcpSenderInfo& sender_info,
« no previous file with comments | « media/cast/video_receiver/video_receiver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698