OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // matches the destination or the input image is empty (e.g. | 290 // matches the destination or the input image is empty (e.g. |
291 // a keyframe request for encoders with internal camera | 291 // a keyframe request for encoders with internal camera |
292 // sources) or the source image has a native handle, pass the image on | 292 // sources) or the source image has a native handle, pass the image on |
293 // directly. Otherwise, we'll scale it to match what the encoder expects | 293 // directly. Otherwise, we'll scale it to match what the encoder expects |
294 // (below). | 294 // (below). |
295 // For texture frames, the underlying encoder is expected to be able to | 295 // For texture frames, the underlying encoder is expected to be able to |
296 // correctly sample/scale the source texture. | 296 // correctly sample/scale the source texture. |
297 // TODO(perkj): ensure that works going forward, and figure out how this | 297 // TODO(perkj): ensure that works going forward, and figure out how this |
298 // affects webrtc:5683. | 298 // affects webrtc:5683. |
299 if ((dst_width == src_width && dst_height == src_height) || | 299 if ((dst_width == src_width && dst_height == src_height) || |
| 300 input_image.IsZeroSize() || |
300 input_image.video_frame_buffer()->native_handle()) { | 301 input_image.video_frame_buffer()->native_handle()) { |
301 int ret = streaminfos_[stream_idx].encoder->Encode( | 302 int ret = streaminfos_[stream_idx].encoder->Encode( |
302 input_image, codec_specific_info, &stream_frame_types); | 303 input_image, codec_specific_info, &stream_frame_types); |
303 if (ret != WEBRTC_VIDEO_CODEC_OK) { | 304 if (ret != WEBRTC_VIDEO_CODEC_OK) { |
304 return ret; | 305 return ret; |
305 } | 306 } |
306 } else { | 307 } else { |
307 // Aligning stride values based on width. | 308 // Aligning stride values based on width. |
308 rtc::scoped_refptr<I420Buffer> dst_buffer = | 309 rtc::scoped_refptr<I420Buffer> dst_buffer = |
309 I420Buffer::Create(dst_width, dst_height, dst_width, | 310 I420Buffer::Create(dst_width, dst_height, dst_width, |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 if (NumberOfStreams(codec_) != 1) | 467 if (NumberOfStreams(codec_) != 1) |
467 return VideoEncoder::ScalingSettings(false); | 468 return VideoEncoder::ScalingSettings(false); |
468 return streaminfos_[0].encoder->GetScalingSettings(); | 469 return streaminfos_[0].encoder->GetScalingSettings(); |
469 } | 470 } |
470 | 471 |
471 const char* SimulcastEncoderAdapter::ImplementationName() const { | 472 const char* SimulcastEncoderAdapter::ImplementationName() const { |
472 return implementation_name_.c_str(); | 473 return implementation_name_.c_str(); |
473 } | 474 } |
474 | 475 |
475 } // namespace webrtc | 476 } // namespace webrtc |
OLD | NEW |