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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 base::Bind(&VideoReceiver::GetEncodedVideoFrame, | 464 base::Bind(&VideoReceiver::GetEncodedVideoFrame, |
465 weak_factory_.GetWeakPtr(), | 465 weak_factory_.GetWeakPtr(), |
466 callback)); | 466 callback)); |
467 } | 467 } |
468 | 468 |
469 // Send a cast feedback message. Actual message created in the framer (cast | 469 // Send a cast feedback message. Actual message created in the framer (cast |
470 // message builder). | 470 // message builder). |
471 void VideoReceiver::CastFeedback(const RtcpCastMessage& cast_message) { | 471 void VideoReceiver::CastFeedback(const RtcpCastMessage& cast_message) { |
472 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 472 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
473 | 473 |
474 RtcpReceiverLogMessage receiver_log; | |
475 event_subscriber_.GetReceiverLogMessageAndReset(&receiver_log); | |
476 | |
477 base::TimeTicks now = cast_environment_->Clock()->NowTicks(); | 474 base::TimeTicks now = cast_environment_->Clock()->NowTicks(); |
478 cast_environment_->Logging()->InsertGenericEvent( | 475 cast_environment_->Logging()->InsertGenericEvent( |
479 now, kVideoAckSent, cast_message.ack_frame_id_); | 476 now, kVideoAckSent, cast_message.ack_frame_id_); |
480 | 477 |
481 rtcp_->SendRtcpFromRtpReceiver(&cast_message, &receiver_log); | 478 rtcp_->SendRtcpFromRtpReceiver(&cast_message, &event_subscriber_); |
482 } | 479 } |
483 | 480 |
484 // Cast messages should be sent within a maximum interval. Schedule a call | 481 // Cast messages should be sent within a maximum interval. Schedule a call |
485 // if not triggered elsewhere, e.g. by the cast message_builder. | 482 // if not triggered elsewhere, e.g. by the cast message_builder. |
486 void VideoReceiver::ScheduleNextCastMessage() { | 483 void VideoReceiver::ScheduleNextCastMessage() { |
487 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 484 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
488 base::TimeTicks send_time; | 485 base::TimeTicks send_time; |
489 framer_->TimeToSendNextCastMessage(&send_time); | 486 framer_->TimeToSendNextCastMessage(&send_time); |
490 | 487 |
491 base::TimeDelta time_to_send = | 488 base::TimeDelta time_to_send = |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } | 521 } |
525 | 522 |
526 void VideoReceiver::SendNextRtcpReport() { | 523 void VideoReceiver::SendNextRtcpReport() { |
527 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 524 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
528 rtcp_->SendRtcpFromRtpReceiver(NULL, NULL); | 525 rtcp_->SendRtcpFromRtpReceiver(NULL, NULL); |
529 ScheduleNextRtcpReport(); | 526 ScheduleNextRtcpReport(); |
530 } | 527 } |
531 | 528 |
532 } // namespace cast | 529 } // namespace cast |
533 } // namespace media | 530 } // namespace media |
OLD | NEW |