| 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 #include "media/cast/cast_sender_impl.h" | 4 #include "media/cast/cast_sender_impl.h" |
| 5 | 5 |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 ssrc_of_audio_sender_ = audio_config.incoming_feedback_ssrc; | 106 ssrc_of_audio_sender_ = audio_config.incoming_feedback_ssrc; |
| 107 audio_frame_input_ = | 107 audio_frame_input_ = |
| 108 new LocalAudioFrameInput(cast_environment_, audio_sender_->AsWeakPtr()); | 108 new LocalAudioFrameInput(cast_environment_, audio_sender_->AsWeakPtr()); |
| 109 } | 109 } |
| 110 cast_initialization_cb.Run(status); | 110 cast_initialization_cb.Run(status); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void CastSenderImpl::InitializeVideo( | 113 void CastSenderImpl::InitializeVideo( |
| 114 const VideoSenderConfig& video_config, | 114 const VideoSenderConfig& video_config, |
| 115 const CastInitializationCallback& cast_initialization_cb, | 115 const CastInitializationCallback& cast_initialization_cb, |
| 116 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories) { | 116 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, |
| 117 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb) { |
| 117 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 118 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 118 CHECK(video_config.use_external_encoder || | 119 CHECK(video_config.use_external_encoder || |
| 119 cast_environment_->HasVideoEncoderThread()); | 120 cast_environment_->HasVideoEncoderThread()); |
| 120 | 121 |
| 121 video_sender_.reset(new VideoSender(cast_environment_, | 122 video_sender_.reset(new VideoSender(cast_environment_, |
| 122 video_config, | 123 video_config, |
| 123 gpu_factories, | 124 create_vea_cb, |
| 125 create_video_encode_mem_cb, |
| 124 cast_initialization_cb, | 126 cast_initialization_cb, |
| 125 transport_sender_)); | 127 transport_sender_)); |
| 126 | 128 |
| 127 ssrc_of_video_sender_ = video_config.incoming_feedback_ssrc; | 129 ssrc_of_video_sender_ = video_config.incoming_feedback_ssrc; |
| 128 video_frame_input_ = | 130 video_frame_input_ = |
| 129 new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr()); | 131 new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr()); |
| 130 } | 132 } |
| 131 | 133 |
| 132 CastSenderImpl::~CastSenderImpl() {} | 134 CastSenderImpl::~CastSenderImpl() {} |
| 133 | 135 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return video_frame_input_; | 202 return video_frame_input_; |
| 201 } | 203 } |
| 202 | 204 |
| 203 transport::PacketReceiverCallback CastSenderImpl::packet_receiver() { | 205 transport::PacketReceiverCallback CastSenderImpl::packet_receiver() { |
| 204 return base::Bind(&CastSenderImpl::ReceivedPacket, | 206 return base::Bind(&CastSenderImpl::ReceivedPacket, |
| 205 weak_factory_.GetWeakPtr()); | 207 weak_factory_.GetWeakPtr()); |
| 206 } | 208 } |
| 207 | 209 |
| 208 } // namespace cast | 210 } // namespace cast |
| 209 } // namespace media | 211 } // namespace media |
| OLD | NEW |