Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: webrtc/modules/video_processing/spatial_resampler.cc

Issue 2477233004: Update VideoFrameBuffer-related methods to not use references to scoped_refptr. (Closed)
Patch Set: Fix memory leak. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return VPM_OK; 49 return VPM_OK;
50 // Check if re-sampling is needed 50 // Check if re-sampling is needed
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 = VideoFrame(scaled_buffer, 61 *outFrame = VideoFrame(scaled_buffer,
62 inFrame.timestamp(), 62 inFrame.timestamp(),
63 inFrame.render_time_ms(), 63 inFrame.render_time_ms(),
64 inFrame.rotation()); 64 inFrame.rotation());
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698