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

Unified Diff: media/cast/sender/frame_sender.cc

Issue 1515433002: Replace uses of raw uint32's with a type-checked RtpTimeTicks data type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Speculative workaround fix for win8_chromium_ng compile error. Created 5 years 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/sender/frame_sender.h ('k') | media/cast/sender/h264_vt_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/frame_sender.cc
diff --git a/media/cast/sender/frame_sender.cc b/media/cast/sender/frame_sender.cc
index fe8b1e05e1686da9bfe31ca724355dd2ed579234..535f2eb79a81187ae399e48454085685b2dc0017 100644
--- a/media/cast/sender/frame_sender.cc
+++ b/media/cast/sender/frame_sender.cc
@@ -72,7 +72,6 @@ FrameSender::FrameSender(scoped_refptr<CastEnvironment> cast_environment,
<< animated_playout_delay.InMilliseconds();
SetTargetPlayoutDelay(animated_playout_delay_);
send_target_playout_delay_ = false;
- memset(frame_rtp_timestamps_, 0, sizeof(frame_rtp_timestamps_));
}
FrameSender::~FrameSender() {
@@ -103,10 +102,10 @@ void FrameSender::SendRtcpReport(bool schedule_future_reports) {
const base::TimeTicks now = cast_environment_->Clock()->NowTicks();
const base::TimeDelta time_delta =
now - GetRecordedReferenceTime(last_sent_frame_id_);
- const int64_t rtp_delta = TimeDeltaToRtpDelta(time_delta, rtp_timebase_);
- const uint32_t now_as_rtp_timestamp =
- GetRecordedRtpTimestamp(last_sent_frame_id_) +
- static_cast<uint32_t>(rtp_delta);
+ const RtpTimeDelta rtp_delta =
+ RtpTimeDelta::FromTimeDelta(time_delta, rtp_timebase_);
+ const RtpTimeTicks now_as_rtp_timestamp =
+ GetRecordedRtpTimestamp(last_sent_frame_id_) + rtp_delta;
transport_sender_->SendSenderReport(ssrc_, now, now_as_rtp_timestamp);
if (schedule_future_reports)
@@ -179,7 +178,7 @@ void FrameSender::ResendForKickstart() {
void FrameSender::RecordLatestFrameTimestamps(uint32_t frame_id,
base::TimeTicks reference_time,
- RtpTimestamp rtp_timestamp) {
+ RtpTimeTicks rtp_timestamp) {
DCHECK(!reference_time.is_null());
frame_reference_times_[frame_id % arraysize(frame_reference_times_)] =
reference_time;
@@ -191,7 +190,7 @@ base::TimeTicks FrameSender::GetRecordedReferenceTime(uint32_t frame_id) const {
return frame_reference_times_[frame_id % arraysize(frame_reference_times_)];
}
-RtpTimestamp FrameSender::GetRecordedRtpTimestamp(uint32_t frame_id) const {
+RtpTimeTicks FrameSender::GetRecordedRtpTimestamp(uint32_t frame_id) const {
return frame_rtp_timestamps_[frame_id % arraysize(frame_rtp_timestamps_)];
}
@@ -257,7 +256,7 @@ void FrameSender::SendEncodedFrame(
TRACE_EVENT_INSTANT1(
"cast_perf_test", "VideoFrameEncoded",
TRACE_EVENT_SCOPE_THREAD,
- "rtp_timestamp", encoded_frame->rtp_timestamp);
+ "rtp_timestamp", encoded_frame->rtp_timestamp.lower_32_bits());
}
// At the start of the session, it's important to send reports before each
@@ -287,7 +286,7 @@ void FrameSender::SendEncodedFrame(
TRACE_EVENT_ASYNC_BEGIN1("cast.stream",
is_audio_ ? "Audio Transport" : "Video Transport",
frame_id,
- "rtp_timestamp", encoded_frame->rtp_timestamp);
+ "rtp_timestamp", encoded_frame->rtp_timestamp.lower_32_bits());
transport_sender_->InsertFrame(ssrc_, *encoded_frame);
}
« no previous file with comments | « media/cast/sender/frame_sender.h ('k') | media/cast/sender/h264_vt_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698