OLD | NEW |
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/video_receiver/video_receiver.h" | 5 #include "media/cast/video_receiver/video_receiver.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 weak_factory_.GetWeakPtr(), callback)); | 416 weak_factory_.GetWeakPtr(), callback)); |
417 } | 417 } |
418 | 418 |
419 // Send a cast feedback message. Actual message created in the framer (cast | 419 // Send a cast feedback message. Actual message created in the framer (cast |
420 // message builder). | 420 // message builder). |
421 void VideoReceiver::CastFeedback(const RtcpCastMessage& cast_message) { | 421 void VideoReceiver::CastFeedback(const RtcpCastMessage& cast_message) { |
422 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 422 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
423 | 423 |
424 RtcpReceiverLogMessage receiver_log; | 424 RtcpReceiverLogMessage receiver_log; |
425 VideoRtcpRawMap video_logs = | 425 VideoRtcpRawMap video_logs = |
426 cast_environment_->Logging()->GetVideoRtcpRawData(); | 426 cast_environment_->Logging()->GetAndResetVideoRtcpRawData(); |
427 | 427 |
428 while (!video_logs.empty()) { | 428 while (!video_logs.empty()) { |
429 // TODO(hclam): Avoid calling begin() within a loop. | 429 // TODO(hclam): Avoid calling begin() within a loop. |
430 VideoRtcpRawMap::iterator it = video_logs.begin(); | 430 VideoRtcpRawMap::iterator it = video_logs.begin(); |
431 uint32 rtp_timestamp = it->first; | 431 uint32 rtp_timestamp = it->first; |
432 std::pair<VideoRtcpRawMap::iterator, VideoRtcpRawMap::iterator> | 432 std::pair<VideoRtcpRawMap::iterator, VideoRtcpRawMap::iterator> |
433 frame_range = video_logs.equal_range(rtp_timestamp); | 433 frame_range = video_logs.equal_range(rtp_timestamp); |
434 | 434 |
435 RtcpReceiverFrameLogMessage frame_log(rtp_timestamp); | 435 RtcpReceiverFrameLogMessage frame_log(rtp_timestamp); |
436 | 436 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 } | 493 } |
494 | 494 |
495 void VideoReceiver::SendNextRtcpReport() { | 495 void VideoReceiver::SendNextRtcpReport() { |
496 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 496 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
497 rtcp_->SendRtcpFromRtpReceiver(NULL, NULL); | 497 rtcp_->SendRtcpFromRtpReceiver(NULL, NULL); |
498 ScheduleNextRtcpReport(); | 498 ScheduleNextRtcpReport(); |
499 } | 499 } |
500 | 500 |
501 } // namespace cast | 501 } // namespace cast |
502 } // namespace media | 502 } // namespace media |
OLD | NEW |