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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 if ((dst_width == src_width && dst_height == src_height) || | 294 if ((dst_width == src_width && dst_height == src_height) || |
295 input_image.IsZeroSize()) { | 295 input_image.IsZeroSize()) { |
296 streaminfos_[stream_idx].encoder->Encode(input_image, codec_specific_info, | 296 streaminfos_[stream_idx].encoder->Encode(input_image, codec_specific_info, |
297 &stream_frame_types); | 297 &stream_frame_types); |
298 } else { | 298 } else { |
299 VideoFrame dst_frame; | 299 VideoFrame dst_frame; |
300 // Making sure that destination frame is of sufficient size. | 300 // Making sure that destination frame is of sufficient size. |
301 // Aligning stride values based on width. | 301 // Aligning stride values based on width. |
302 dst_frame.CreateEmptyFrame(dst_width, dst_height, dst_width, | 302 dst_frame.CreateEmptyFrame(dst_width, dst_height, dst_width, |
303 (dst_width + 1) / 2, (dst_width + 1) / 2); | 303 (dst_width + 1) / 2, (dst_width + 1) / 2); |
304 libyuv::I420Scale( | 304 libyuv::I420Scale(input_image.video_frame_buffer()->DataY(), |
305 input_image.buffer(kYPlane), input_image.stride(kYPlane), | 305 input_image.video_frame_buffer()->StrideY(), |
306 input_image.buffer(kUPlane), input_image.stride(kUPlane), | 306 input_image.video_frame_buffer()->DataU(), |
307 input_image.buffer(kVPlane), input_image.stride(kVPlane), src_width, | 307 input_image.video_frame_buffer()->StrideU(), |
308 src_height, dst_frame.buffer(kYPlane), dst_frame.stride(kYPlane), | 308 input_image.video_frame_buffer()->DataV(), |
309 dst_frame.buffer(kUPlane), dst_frame.stride(kUPlane), | 309 input_image.video_frame_buffer()->StrideV(), |
310 dst_frame.buffer(kVPlane), dst_frame.stride(kVPlane), dst_width, | 310 src_width, src_height, |
311 dst_height, libyuv::kFilterBilinear); | 311 dst_frame.video_frame_buffer()->MutableDataY(), |
| 312 dst_frame.video_frame_buffer()->StrideY(), |
| 313 dst_frame.video_frame_buffer()->MutableDataU(), |
| 314 dst_frame.video_frame_buffer()->StrideU(), |
| 315 dst_frame.video_frame_buffer()->MutableDataV(), |
| 316 dst_frame.video_frame_buffer()->StrideV(), |
| 317 dst_width, dst_height, |
| 318 libyuv::kFilterBilinear); |
312 dst_frame.set_timestamp(input_image.timestamp()); | 319 dst_frame.set_timestamp(input_image.timestamp()); |
313 dst_frame.set_render_time_ms(input_image.render_time_ms()); | 320 dst_frame.set_render_time_ms(input_image.render_time_ms()); |
314 streaminfos_[stream_idx].encoder->Encode(dst_frame, codec_specific_info, | 321 streaminfos_[stream_idx].encoder->Encode(dst_frame, codec_specific_info, |
315 &stream_frame_types); | 322 &stream_frame_types); |
316 } | 323 } |
317 } | 324 } |
318 | 325 |
319 return WEBRTC_VIDEO_CODEC_OK; | 326 return WEBRTC_VIDEO_CODEC_OK; |
320 } | 327 } |
321 | 328 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 if (streaminfos_.size() != 1) | 508 if (streaminfos_.size() != 1) |
502 return false; | 509 return false; |
503 return streaminfos_[0].encoder->SupportsNativeHandle(); | 510 return streaminfos_[0].encoder->SupportsNativeHandle(); |
504 } | 511 } |
505 | 512 |
506 const char* SimulcastEncoderAdapter::ImplementationName() const { | 513 const char* SimulcastEncoderAdapter::ImplementationName() const { |
507 return implementation_name_.c_str(); | 514 return implementation_name_.c_str(); |
508 } | 515 } |
509 | 516 |
510 } // namespace webrtc | 517 } // namespace webrtc |
OLD | NEW |