Chromium Code Reviews| Index: webrtc/modules/video_processing/spatial_resampler.cc |
| diff --git a/webrtc/modules/video_processing/spatial_resampler.cc b/webrtc/modules/video_processing/spatial_resampler.cc |
| index cdbe0efac14cf285daeb20b1aa8edb2cfb3b7192..869a146658da4589710dfd355b1eb15c5ddafd8d 100644 |
| --- a/webrtc/modules/video_processing/spatial_resampler.cc |
| +++ b/webrtc/modules/video_processing/spatial_resampler.cc |
| @@ -13,10 +13,7 @@ |
| namespace webrtc { |
| VPMSimpleSpatialResampler::VPMSimpleSpatialResampler() |
| - : resampling_mode_(kFastRescaling), |
| - target_width_(0), |
| - target_height_(0), |
| - scaler_() {} |
| + : resampling_mode_(kFastRescaling), target_width_(0), target_height_(0) {} |
| VPMSimpleSpatialResampler::~VPMSimpleSpatialResampler() {} |
| @@ -56,26 +53,17 @@ int32_t VPMSimpleSpatialResampler::ResampleFrame(const VideoFrame& inFrame, |
| return VPM_OK; |
| } |
| - // Setting scaler |
| - // TODO(mikhal/marpan): Should we allow for setting the filter mode in |
| - // _scale.Set() with |resampling_mode_|? |
| - int ret_val = 0; |
| - ret_val = scaler_.Set(inFrame.width(), inFrame.height(), target_width_, |
| - target_height_, kI420, kI420, kScaleBox); |
| - if (ret_val < 0) |
| - return ret_val; |
| + rtc::scoped_refptr<I420Buffer> scaled(buffer_pool_.CreateBuffer |
|
pbos-webrtc
2016/06/03 14:53:23
scaled_buffer
nisse-webrtc
2016/06/09 08:10:05
Done.
|
| + (target_width_, target_height_)); |
| - ret_val = scaler_.Scale(inFrame, outFrame); |
| + scaled->CropAndScale(inFrame.video_frame_buffer()); |
| + outFrame->set_video_frame_buffer(scaled); |
| // Setting time parameters to the output frame. |
| - // Timestamp will be reset in Scale call above, so we should set it after. |
| outFrame->set_timestamp(inFrame.timestamp()); |
| outFrame->set_render_time_ms(inFrame.render_time_ms()); |
| - if (ret_val == 0) |
| - return VPM_OK; |
| - else |
| - return VPM_SCALE_ERROR; |
| + return VPM_OK; |
| } |
| int32_t VPMSimpleSpatialResampler::TargetHeight() { |