Index: media/cast/sender/frame_sender.cc |
diff --git a/media/cast/sender/frame_sender.cc b/media/cast/sender/frame_sender.cc |
index a7d9a27cb60906d68bbfe93f18a98d7047bbc31a..c56c560e879ca50b39db99210f4ef7971ee2d830 100644 |
--- a/media/cast/sender/frame_sender.cc |
+++ b/media/cast/sender/frame_sender.cc |
@@ -260,6 +260,12 @@ void FrameSender::SendEncodedFrame( |
encoded_frame->new_playout_delay_ms = |
target_playout_delay_.InMilliseconds(); |
} |
+ |
+ TRACE_EVENT_ASYNC_BEGIN2("cast.stream", |
+ is_audio_ ? "Audio Transport" : "Video Transport", |
+ frame_id, |
+ "timestamp", encoded_frame->reference_time.ToInternalValue(), |
+ "rtp_timestamp", encoded_frame->rtp_timestamp); |
transport_sender_->InsertFrame(ssrc_, *encoded_frame); |
} |
@@ -299,6 +305,10 @@ void FrameSender::OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) { |
if (duplicate_ack_counter_ >= 2 && duplicate_ack_counter_ % 3 == 2) { |
VLOG(1) << SENDER_SSRC << "Received duplicate ACK for frame " |
<< latest_acked_frame_id_; |
+ TRACE_EVENT_INSTANT2( |
+ "cast.stream", "Duplicate ACK", TRACE_EVENT_SCOPE_THREAD, |
+ "ack_frame_id", cast_feedback.ack_frame_id, |
+ "last_sent_frame_id", last_sent_frame_id_); |
ResendForKickstart(); |
} |
} else { |
@@ -316,6 +326,18 @@ void FrameSender::OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) { |
is_audio_ ? AUDIO_EVENT : VIDEO_EVENT, |
GetRecordedRtpTimestamp(cast_feedback.ack_frame_id), |
cast_feedback.ack_frame_id); |
+ if (!duplicate_ack_counter_) { |
+ if (have_valid_rtt) { |
+ TRACE_EVENT_ASYNC_END1("cast.stream", |
+ is_audio_ ? "Audio Transport" : "Video Transport", |
+ cast_feedback.ack_frame_id, |
+ "RTT", current_round_trip_time_.ToInternalValue()); |
+ } else { |
+ TRACE_EVENT_ASYNC_END0("cast.stream", |
+ is_audio_ ? "Audio Transport" : "Video Transport", |
+ cast_feedback.ack_frame_id); |
+ } |
+ } |
const bool is_acked_out_of_order = |
static_cast<int32>(cast_feedback.ack_frame_id - |
@@ -332,6 +354,11 @@ void FrameSender::OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) { |
} |
transport_sender_->CancelSendingFrames(ssrc_, cancel_sending_frames); |
latest_acked_frame_id_ = cast_feedback.ack_frame_id; |
+ } else { |
+ TRACE_EVENT_INSTANT2( |
+ "cast.stream", "ACK out of order", TRACE_EVENT_SCOPE_THREAD, |
+ "ack_frame_id", cast_feedback.ack_frame_id, |
+ "latest_acked_frame_id", latest_acked_frame_id_); |
} |
} |