| 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 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Local implementation of RtpData (defined in rtp_rtcp_defines.h). | 23 // Local implementation of RtpData (defined in rtp_rtcp_defines.h). |
| 24 // Used to pass payload data into the video receiver. | 24 // Used to pass payload data into the video receiver. |
| 25 class LocalRtpVideoData : public RtpData { | 25 class LocalRtpVideoData : public RtpData { |
| 26 public: | 26 public: |
| 27 explicit LocalRtpVideoData(VideoReceiver* video_receiver) | 27 explicit LocalRtpVideoData(VideoReceiver* video_receiver) |
| 28 : video_receiver_(video_receiver), | 28 : video_receiver_(video_receiver), |
| 29 time_updated_(false), | 29 time_updated_(false), |
| 30 incoming_rtp_timestamp_(0) { | 30 incoming_rtp_timestamp_(0) { |
| 31 } | 31 } |
| 32 ~LocalRtpVideoData() {} | 32 virtual ~LocalRtpVideoData() {} |
| 33 | 33 |
| 34 virtual void OnReceivedPayloadData(const uint8* payload_data, | 34 virtual void OnReceivedPayloadData(const uint8* payload_data, |
| 35 int payload_size, | 35 int payload_size, |
| 36 const RtpCastHeader* rtp_header) OVERRIDE { | 36 const RtpCastHeader* rtp_header) OVERRIDE { |
| 37 { | 37 { |
| 38 if (!time_updated_) { | 38 if (!time_updated_) { |
| 39 incoming_rtp_timestamp_ = rtp_header->webrtc.header.timestamp; | 39 incoming_rtp_timestamp_ = rtp_header->webrtc.header.timestamp; |
| 40 time_incoming_packet_ = video_receiver_->clock_->NowTicks(); | 40 time_incoming_packet_ = video_receiver_->clock_->NowTicks(); |
| 41 time_updated_ = true; | 41 time_updated_ = true; |
| 42 } else if (video_receiver_->clock_->NowTicks() > time_incoming_packet_ + | 42 } else if (video_receiver_->clock_->NowTicks() > time_incoming_packet_ + |
| (...skipping 27 matching lines...) Expand all Loading... |
| 70 // Callback triggered by the Framer (cast message builder). | 70 // Callback triggered by the Framer (cast message builder). |
| 71 class LocalRtpVideoFeedback : public RtpPayloadFeedback { | 71 class LocalRtpVideoFeedback : public RtpPayloadFeedback { |
| 72 public: | 72 public: |
| 73 explicit LocalRtpVideoFeedback(VideoReceiver* video_receiver) | 73 explicit LocalRtpVideoFeedback(VideoReceiver* video_receiver) |
| 74 : video_receiver_(video_receiver) { | 74 : video_receiver_(video_receiver) { |
| 75 } | 75 } |
| 76 virtual void CastFeedback(const RtcpCastMessage& cast_message) OVERRIDE { | 76 virtual void CastFeedback(const RtcpCastMessage& cast_message) OVERRIDE { |
| 77 video_receiver_->CastFeedback(cast_message); | 77 video_receiver_->CastFeedback(cast_message); |
| 78 } | 78 } |
| 79 | 79 |
| 80 virtual void RequestKeyFrame() OVERRIDE { | |
| 81 video_receiver_->RequestKeyFrame(); | |
| 82 } | |
| 83 | |
| 84 private: | 80 private: |
| 85 VideoReceiver* video_receiver_; | 81 VideoReceiver* video_receiver_; |
| 86 }; | 82 }; |
| 87 | 83 |
| 88 // Local implementation of RtpReceiverStatistics (defined by rtcp.h). | 84 // Local implementation of RtpReceiverStatistics (defined by rtcp.h). |
| 89 // Used to pass statistics data from the RTP module to the RTCP module. | 85 // Used to pass statistics data from the RTP module to the RTCP module. |
| 90 class LocalRtpReceiverStatistics : public RtpReceiverStatistics { | 86 class LocalRtpReceiverStatistics : public RtpReceiverStatistics { |
| 91 public: | 87 public: |
| 92 explicit LocalRtpReceiverStatistics(RtpReceiver* rtp_receiver) | 88 explicit LocalRtpReceiverStatistics(RtpReceiver* rtp_receiver) |
| 93 : rtp_receiver_(rtp_receiver) { | 89 : rtp_receiver_(rtp_receiver) { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 weak_factory_.GetWeakPtr()), time_to_next); | 325 weak_factory_.GetWeakPtr()), time_to_next); |
| 330 } | 326 } |
| 331 | 327 |
| 332 void VideoReceiver::SendNextRtcpReport() { | 328 void VideoReceiver::SendNextRtcpReport() { |
| 333 rtcp_->SendRtcpReport(incoming_ssrc_); | 329 rtcp_->SendRtcpReport(incoming_ssrc_); |
| 334 ScheduleNextRtcpReport(); | 330 ScheduleNextRtcpReport(); |
| 335 } | 331 } |
| 336 | 332 |
| 337 } // namespace cast | 333 } // namespace cast |
| 338 } // namespace media | 334 } // namespace media |
| OLD | NEW |