Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 } else if ((inFrame.width() == target_width_) && | 51 } else if ((inFrame.width() == target_width_) && |
| 52 (inFrame.height() == target_height_)) { | 52 (inFrame.height() == target_height_)) { |
| 53 return VPM_OK; | 53 return VPM_OK; |
| 54 } | 54 } |
| 55 | 55 |
| 56 rtc::scoped_refptr<I420Buffer> scaled_buffer( | 56 rtc::scoped_refptr<I420Buffer> scaled_buffer( |
| 57 buffer_pool_.CreateBuffer(target_width_, target_height_)); | 57 buffer_pool_.CreateBuffer(target_width_, target_height_)); |
| 58 | 58 |
| 59 scaled_buffer->CropAndScaleFrom(inFrame.video_frame_buffer()); | 59 scaled_buffer->CropAndScaleFrom(inFrame.video_frame_buffer()); |
| 60 | 60 |
| 61 outFrame->set_video_frame_buffer(scaled_buffer); | 61 *outFrame = VideoFrame(scaled_buffer, |
| 62 // Setting time parameters to the output frame. | 62 inFrame.timestamp(), |
| 63 outFrame->set_timestamp(inFrame.timestamp()); | 63 inFrame.render_time_ms(), |
| 64 outFrame->set_render_time_ms(inFrame.render_time_ms()); | 64 inFrame.rotation()); |
|
nisse-webrtc
2016/06/15 07:49:20
On the other hand, at this place the old version d
| |
| 65 | 65 |
| 66 return VPM_OK; | 66 return VPM_OK; |
| 67 } | 67 } |
| 68 | 68 |
| 69 int32_t VPMSimpleSpatialResampler::TargetHeight() { | 69 int32_t VPMSimpleSpatialResampler::TargetHeight() { |
| 70 return target_height_; | 70 return target_height_; |
| 71 } | 71 } |
| 72 | 72 |
| 73 int32_t VPMSimpleSpatialResampler::TargetWidth() { | 73 int32_t VPMSimpleSpatialResampler::TargetWidth() { |
| 74 return target_width_; | 74 return target_width_; |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool VPMSimpleSpatialResampler::ApplyResample(int32_t width, int32_t height) { | 77 bool VPMSimpleSpatialResampler::ApplyResample(int32_t width, int32_t height) { |
| 78 if ((width == target_width_ && height == target_height_) || | 78 if ((width == target_width_ && height == target_height_) || |
| 79 resampling_mode_ == kNoRescaling) | 79 resampling_mode_ == kNoRescaling) |
| 80 return false; | 80 return false; |
| 81 else | 81 else |
| 82 return true; | 82 return true; |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace webrtc | 85 } // namespace webrtc |
| OLD | NEW |