Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 } | 231 } |
| 232 adapted_width = adapted_format.width; | 232 adapted_width = adapted_format.width; |
| 233 adapted_height = adapted_format.height; | 233 adapted_height = adapted_format.height; |
| 234 } | 234 } |
| 235 | 235 |
| 236 if (!frame_factory_) { | 236 if (!frame_factory_) { |
| 237 LOG(LS_ERROR) << "No video frame factory."; | 237 LOG(LS_ERROR) << "No video frame factory."; |
| 238 return; | 238 return; |
| 239 } | 239 } |
| 240 | 240 |
| 241 // TODO(nisse): Reorganize frame factory methods, deleting crop | 241 // TODO(nisse): Reorganize frame factory methods, deleting crop |
|
perkj_webrtc
2016/05/11 10:05:17
remove this todo?
nisse-webrtc
2016/05/12 12:23:06
Done.
| |
| 242 // support there too. | 242 // support there too. |
| 243 std::unique_ptr<VideoFrame> adapted_frame(frame_factory_->CreateAliasedFrame( | 243 std::unique_ptr<VideoFrame> adapted_frame = frame_factory_->CreateScaledFrame( |
| 244 captured_frame, captured_frame->width, captured_frame->height, | 244 captured_frame, adapted_width, adapted_height); |
| 245 adapted_width, adapted_height)); | |
| 246 | 245 |
| 247 if (!adapted_frame) { | 246 if (!adapted_frame) { |
| 248 // TODO(fbarchard): LOG more information about captured frame attributes. | 247 // TODO(fbarchard): LOG more information about captured frame attributes. |
| 249 LOG(LS_ERROR) << "Couldn't convert to I420! " | 248 LOG(LS_ERROR) << "Couldn't convert to I420! " |
| 250 << "From " << ToString(captured_frame) << " To " | 249 << "From " << ToString(captured_frame) << " To " |
| 251 << adapted_width << " x " << adapted_height; | 250 << adapted_width << " x " << adapted_height; |
| 252 return; | 251 return; |
| 253 } | 252 } |
| 254 | 253 |
| 255 OnFrame(this, adapted_frame.get()); | 254 OnFrame(this, adapted_frame.get()); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 void VideoCapturer::UpdateInputSize(const CapturedFrame* captured_frame) { | 400 void VideoCapturer::UpdateInputSize(const CapturedFrame* captured_frame) { |
| 402 // Update stats protected from fetches from different thread. | 401 // Update stats protected from fetches from different thread. |
| 403 rtc::CritScope cs(&frame_stats_crit_); | 402 rtc::CritScope cs(&frame_stats_crit_); |
| 404 | 403 |
| 405 input_size_valid_ = true; | 404 input_size_valid_ = true; |
| 406 input_width_ = captured_frame->width; | 405 input_width_ = captured_frame->width; |
| 407 input_height_ = captured_frame->height; | 406 input_height_ = captured_frame->height; |
| 408 } | 407 } |
| 409 | 408 |
| 410 } // namespace cricket | 409 } // namespace cricket |
| OLD | NEW |