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

Unified Diff: webrtc/api/video/i420_buffer.cc

Issue 2906053002: Update I420Buffer to new VideoFrameBuffer interface (Closed)
Patch Set: Make const versions of Get functions Created 3 years, 7 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
« no previous file with comments | « webrtc/api/video/i420_buffer.h ('k') | webrtc/api/video/video_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/video/i420_buffer.cc
diff --git a/webrtc/api/video/i420_buffer.cc b/webrtc/api/video/i420_buffer.cc
index ae770c6039a52572be08fbfd4b8ba3ba93b77287..495009cc3138c4bae2d78ab885abec27a65f6e0f 100644
--- a/webrtc/api/video/i420_buffer.cc
+++ b/webrtc/api/video/i420_buffer.cc
@@ -77,7 +77,7 @@ rtc::scoped_refptr<I420Buffer> I420Buffer::Create(int width,
// static
rtc::scoped_refptr<I420Buffer> I420Buffer::Copy(
- const VideoFrameBuffer& source) {
+ const I420BufferInterface& source) {
return Copy(source.width(), source.height(),
source.DataY(), source.StrideY(),
source.DataU(), source.StrideU(),
@@ -104,7 +104,8 @@ rtc::scoped_refptr<I420Buffer> I420Buffer::Copy(
// static
rtc::scoped_refptr<I420Buffer> I420Buffer::Rotate(
- const VideoFrameBuffer& src, VideoRotation rotation) {
+ const I420BufferInterface& src,
+ VideoRotation rotation) {
RTC_CHECK(src.DataY());
RTC_CHECK(src.DataU());
RTC_CHECK(src.DataV());
@@ -183,12 +184,11 @@ void I420Buffer::SetBlack(I420Buffer* buffer) {
0, 128, 128) == 0);
}
-void I420Buffer::CropAndScaleFrom(
- const VideoFrameBuffer& src,
- int offset_x,
- int offset_y,
- int crop_width,
- int crop_height) {
+void I420Buffer::CropAndScaleFrom(const I420BufferInterface& src,
+ int offset_x,
+ int offset_y,
+ int crop_width,
+ int crop_height) {
RTC_CHECK_LE(crop_width, src.width());
RTC_CHECK_LE(crop_height, src.height());
RTC_CHECK_LE(crop_width + offset_x, src.width());
@@ -220,8 +220,7 @@ void I420Buffer::CropAndScaleFrom(
RTC_DCHECK_EQ(res, 0);
}
-void I420Buffer::CropAndScaleFrom(
- const VideoFrameBuffer& src) {
+void I420Buffer::CropAndScaleFrom(const I420BufferInterface& src) {
const int crop_width =
std::min(src.width(), width() * src.height() / height());
const int crop_height =
@@ -233,7 +232,7 @@ void I420Buffer::CropAndScaleFrom(
crop_width, crop_height);
}
-void I420Buffer::ScaleFrom(const VideoFrameBuffer& src) {
+void I420Buffer::ScaleFrom(const I420BufferInterface& src) {
CropAndScaleFrom(src, 0, 0, src.width(), src.height());
}
« no previous file with comments | « webrtc/api/video/i420_buffer.h ('k') | webrtc/api/video/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698