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

Unified Diff: webrtc/common_video/video_frame_buffer.cc

Issue 2084893002: Implement scoped_const_refptr template. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/common_video/video_frame_buffer.cc
diff --git a/webrtc/common_video/video_frame_buffer.cc b/webrtc/common_video/video_frame_buffer.cc
index 2875c661c8b3835f4c70ec706c12f9e66992038b..9107cc8a1bc10249ed5ff9f93be4e8de701d4673 100644
--- a/webrtc/common_video/video_frame_buffer.cc
+++ b/webrtc/common_video/video_frame_buffer.cc
@@ -200,7 +200,7 @@ rtc::scoped_refptr<VideoFrameBuffer> I420Buffer::NativeToI420Buffer() {
}
rtc::scoped_refptr<I420Buffer> I420Buffer::Copy(
- const rtc::scoped_refptr<VideoFrameBuffer>& source) {
+ const rtc::scoped_const_refptr<VideoFrameBuffer>& source) {
int width = source->width();
int height = source->height();
rtc::scoped_refptr<I420Buffer> target = I420Buffer::Create(width, height);
@@ -224,7 +224,7 @@ void I420Buffer::SetToBlack() {
}
void I420Buffer::CropAndScaleFrom(
- const rtc::scoped_refptr<VideoFrameBuffer>& src,
+ const rtc::scoped_const_refptr<VideoFrameBuffer>& src,
int offset_x,
int offset_y,
int crop_width,
@@ -261,7 +261,7 @@ void I420Buffer::CropAndScaleFrom(
}
void I420Buffer::CropAndScaleFrom(
- const rtc::scoped_refptr<VideoFrameBuffer>& src) {
+ const rtc::scoped_const_refptr<VideoFrameBuffer>& src) {
const int crop_width =
std::min(src->width(), width() * src->height() / height());
const int crop_height =
@@ -273,12 +273,13 @@ void I420Buffer::CropAndScaleFrom(
crop_width, crop_height);
}
-void I420Buffer::ScaleFrom(const rtc::scoped_refptr<VideoFrameBuffer>& src) {
+void I420Buffer::ScaleFrom(
+ const rtc::scoped_const_refptr<VideoFrameBuffer>& src) {
CropAndScaleFrom(src, 0, 0, src->width(), src->height());
}
rtc::scoped_refptr<I420Buffer> I420Buffer::CopyKeepStride(
- const rtc::scoped_refptr<VideoFrameBuffer>& source) {
+ const rtc::scoped_const_refptr<VideoFrameBuffer>& source) {
int width = source->width();
int height = source->height();
int stride_y = source->StrideY();
« no previous file with comments | « webrtc/common_video/include/video_frame_buffer.h ('k') | webrtc/modules/desktop_capture/x11/shared_x_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698