| 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_sender/video_sender.h" | 5 #include "media/cast/video_sender/video_sender.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 base::TimeTicks time_sent_; | 87 base::TimeTicks time_sent_; |
| 88 uint32 rtp_timestamp_; | 88 uint32 rtp_timestamp_; |
| 89 | 89 |
| 90 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalRtpVideoSenderStatistics); | 90 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalRtpVideoSenderStatistics); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 VideoSender::VideoSender( | 93 VideoSender::VideoSender( |
| 94 scoped_refptr<CastEnvironment> cast_environment, | 94 scoped_refptr<CastEnvironment> cast_environment, |
| 95 const VideoSenderConfig& video_config, | 95 const VideoSenderConfig& video_config, |
| 96 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, | 96 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, |
| 97 const CastInitializationCallback& initialization_status, | 97 const CastInitializationCallback& cast_initialization_cb, |
| 98 transport::CastTransportSender* const transport_sender) | 98 transport::CastTransportSender* const transport_sender) |
| 99 : rtp_max_delay_(base::TimeDelta::FromMilliseconds( | 99 : rtp_max_delay_(base::TimeDelta::FromMilliseconds( |
| 100 video_config.rtp_config.max_delay_ms)), | 100 video_config.rtp_config.max_delay_ms)), |
| 101 max_frame_rate_(video_config.max_frame_rate), | 101 max_frame_rate_(video_config.max_frame_rate), |
| 102 cast_environment_(cast_environment), | 102 cast_environment_(cast_environment), |
| 103 transport_sender_(transport_sender), | 103 transport_sender_(transport_sender), |
| 104 event_subscriber_(kMaxEventSubscriberEntries), | 104 event_subscriber_(kMaxEventSubscriberEntries), |
| 105 rtcp_feedback_(new LocalRtcpVideoSenderFeedback(this)), | 105 rtcp_feedback_(new LocalRtcpVideoSenderFeedback(this)), |
| 106 last_acked_frame_id_(-1), | 106 last_acked_frame_id_(-1), |
| 107 last_sent_frame_id_(-1), | 107 last_sent_frame_id_(-1), |
| (...skipping 30 matching lines...) Expand all Loading... |
| 138 transport_sender_, | 138 transport_sender_, |
| 139 NULL, // paced sender. | 139 NULL, // paced sender. |
| 140 rtp_video_sender_statistics_.get(), | 140 rtp_video_sender_statistics_.get(), |
| 141 NULL, | 141 NULL, |
| 142 video_config.rtcp_mode, | 142 video_config.rtcp_mode, |
| 143 base::TimeDelta::FromMilliseconds(video_config.rtcp_interval), | 143 base::TimeDelta::FromMilliseconds(video_config.rtcp_interval), |
| 144 video_config.sender_ssrc, | 144 video_config.sender_ssrc, |
| 145 video_config.incoming_feedback_ssrc, | 145 video_config.incoming_feedback_ssrc, |
| 146 video_config.rtcp_c_name)); | 146 video_config.rtcp_c_name)); |
| 147 | 147 |
| 148 // TODO(pwestin): pass cast_initialization to |video_encoder_| | 148 // TODO(pwestin): pass cast_initialization_cb to |video_encoder_| |
| 149 // and remove this call. | 149 // and remove this call. |
| 150 cast_environment_->PostTask( | 150 cast_environment_->PostTask( |
| 151 CastEnvironment::MAIN, FROM_HERE, | 151 CastEnvironment::MAIN, FROM_HERE, |
| 152 base::Bind(initialization_status, STATUS_INITIALIZED)); | 152 base::Bind(cast_initialization_cb, STATUS_VIDEO_INITIALIZED)); |
| 153 cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_); | 153 cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_); |
| 154 } | 154 } |
| 155 | 155 |
| 156 VideoSender::~VideoSender() { | 156 VideoSender::~VideoSender() { |
| 157 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber_); | 157 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber_); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void VideoSender::InitializeTimers() { | 160 void VideoSender::InitializeTimers() { |
| 161 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 161 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 162 if (!initialized_) { | 162 if (!initialized_) { |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 480 |
| 481 void VideoSender::ResendPacketsOnTransportThread( | 481 void VideoSender::ResendPacketsOnTransportThread( |
| 482 const transport::MissingFramesAndPacketsMap& missing_packets) { | 482 const transport::MissingFramesAndPacketsMap& missing_packets) { |
| 483 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); | 483 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); |
| 484 last_send_time_ = cast_environment_->Clock()->NowTicks(); | 484 last_send_time_ = cast_environment_->Clock()->NowTicks(); |
| 485 transport_sender_->ResendPackets(false, missing_packets); | 485 transport_sender_->ResendPackets(false, missing_packets); |
| 486 } | 486 } |
| 487 | 487 |
| 488 } // namespace cast | 488 } // namespace cast |
| 489 } // namespace media | 489 } // namespace media |
| OLD | NEW |