| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sender/video_sender.h" | 5 #include "media/cast/sender/video_sender.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 cast_environment, video_config, | 83 cast_environment, video_config, |
| 84 base::Bind(&VideoSender::OnEncoderInitialized, | 84 base::Bind(&VideoSender::OnEncoderInitialized, |
| 85 weak_factory_.GetWeakPtr(), initialization_cb))); | 85 weak_factory_.GetWeakPtr(), initialization_cb))); |
| 86 } | 86 } |
| 87 #endif // defined(OS_MACOSX) | 87 #endif // defined(OS_MACOSX) |
| 88 #if !defined(OS_IOS) | 88 #if !defined(OS_IOS) |
| 89 if (video_config.use_external_encoder) { | 89 if (video_config.use_external_encoder) { |
| 90 video_encoder_.reset(new ExternalVideoEncoder( | 90 video_encoder_.reset(new ExternalVideoEncoder( |
| 91 cast_environment, | 91 cast_environment, |
| 92 video_config, | 92 video_config, |
| 93 gfx::Size(video_config.width, video_config.height), |
| 93 base::Bind(&VideoSender::OnEncoderInitialized, | 94 base::Bind(&VideoSender::OnEncoderInitialized, |
| 94 weak_factory_.GetWeakPtr(), initialization_cb), | 95 weak_factory_.GetWeakPtr(), initialization_cb), |
| 95 create_vea_cb, | 96 create_vea_cb, |
| 96 create_video_encode_mem_cb)); | 97 create_video_encode_mem_cb)); |
| 97 } else if (!video_encoder_) { | 98 } else if (!video_encoder_) { |
| 98 // Software encoder is initialized immediately. | 99 // Software encoder is initialized immediately. |
| 99 video_encoder_.reset(new VideoEncoderImpl(cast_environment, video_config)); | 100 video_encoder_.reset(new VideoEncoderImpl(cast_environment, video_config)); |
| 100 cast_initialization_status_ = STATUS_VIDEO_INITIALIZED; | 101 cast_initialization_status_ = STATUS_VIDEO_INITIALIZED; |
| 101 } | 102 } |
| 102 #endif // !defined(OS_IOS) | 103 #endif // !defined(OS_IOS) |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 DCHECK_GE(frames_in_encoder_, 0); | 252 DCHECK_GE(frames_in_encoder_, 0); |
| 252 | 253 |
| 253 duration_in_encoder_ = | 254 duration_in_encoder_ = |
| 254 last_enqueued_frame_reference_time_ - encoded_frame->reference_time; | 255 last_enqueued_frame_reference_time_ - encoded_frame->reference_time; |
| 255 | 256 |
| 256 SendEncodedFrame(encoder_bitrate, encoded_frame.Pass()); | 257 SendEncodedFrame(encoder_bitrate, encoded_frame.Pass()); |
| 257 } | 258 } |
| 258 | 259 |
| 259 } // namespace cast | 260 } // namespace cast |
| 260 } // namespace media | 261 } // namespace media |
| OLD | NEW |