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

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

Issue 136903003: cast: Wire upp logging to be sent over RTCP between receiver and sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge TOT Created 6 years, 11 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
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 e5fb7456d2a99b2d59b8eca9db874dee3c113aa1..87183d0520321f3e569a35ced1ff15c47d338ebe 100644
--- a/media/cast/video_sender/video_sender.cc
+++ b/media/cast/video_sender/video_sender.cc
@@ -226,20 +226,18 @@ void VideoSender::SendRtcpReport() {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
transport::RtcpSenderLogMessage sender_log_message;
- const FrameRawMap& frame_raw_map =
- cast_environment_->Logging()->GetFrameRawData();
+ VideoRtcpRawMap video_logs =
+ cast_environment_->Logging()->GetVideoRtcpRawData();
+
+ while (!video_logs.empty()) {
+ VideoRtcpRawMap::iterator it = video_logs.begin();
+ uint32 rtp_timestamp = it->first;
- FrameRawMap::const_iterator it = frame_raw_map.begin();
- while (it != frame_raw_map.end()) {
transport::RtcpSenderFrameLogMessage frame_message;
- frame_message.rtp_timestamp = it->first;
+ frame_message.rtp_timestamp = rtp_timestamp;
frame_message.frame_status = transport::kRtcpSenderFrameStatusUnknown;
- if (it->second.type.empty()) {
- ++it;
- continue;
- }
- CastLoggingEvent last_event = it->second.type.back();
- switch (last_event) {
+
+ switch (it->second.type) {
case kVideoFrameCaptured:
frame_message.frame_status =
transport::kRtcpSenderFrameStatusDroppedByFlowControl;
@@ -253,28 +251,16 @@ void VideoSender::SendRtcpReport() {
transport::kRtcpSenderFrameStatusSentToNetwork;
break;
default:
- ++it;
- continue;
- }
- ++it;
- if (it == frame_raw_map.end()) {
- // Last message on our map; only send if it is kVideoFrameEncoded.
- if (last_event != kVideoFrameEncoded) {
- // For other events we will wait for it to finish and report the result
- // in the next report.
+ NOTREACHED();
break;
- }
}
+ video_logs.erase(rtp_timestamp);
sender_log_message.push_back(frame_message);
}
rtcp_->SendRtcpFromRtpSender(&sender_log_message);
if (!sender_log_message.empty()) {
VLOG(1) << "Failed to send all log messages";
}
-
- // TODO(pwestin): When we start pulling out the logging by other means we need
- // to synchronize this.
- cast_environment_->Logging()->ResetRaw();
ScheduleNextRtcpReport();
}
@@ -415,7 +401,7 @@ void VideoSender::ReceivedAck(uint32 acked_frame_id) {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
last_acked_frame_id_ = static_cast<int>(acked_frame_id);
base::TimeTicks now = cast_environment_->Clock()->NowTicks();
- cast_environment_->Logging()->InsertGenericEvent(now, kAckReceived,
+ cast_environment_->Logging()->InsertGenericEvent(now, kVideoAckReceived,
acked_frame_id);
VLOG(1) << "ReceivedAck:" << static_cast<int>(acked_frame_id);
last_acked_frame_id_ = acked_frame_id;
« no previous file with comments | « media/cast/video_sender/video_encoder_impl_unittest.cc ('k') | media/cast/video_sender/video_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698