Added new VideoFrameBuffer methods Data[YUV]() etc.
Eliminate most uses of the old methods.
To continue on this path, once we agree the new methods make sense,
the next step is to rename cricket::VideoFrame::GetVideoFrameBuffer
--> video_frame_buffer, to match the name in webrtc::VideoFrame (if we
think that name is ok?). And then start updating all code to access
planes via the VideoFrameBuffer, and delete corresponding methods in
both cricket::VideoFrame and webrtc::VideoFrame.
BUG=webrtc:5682
Review URL: https://codereview.webrtc.org/1878623002
Cr-Commit-Position: refs/heads/master@{#12407}
diff --git a/webrtc/test/fake_texture_frame.h b/webrtc/test/fake_texture_frame.h
index 9575fae..15b70d8 100644
--- a/webrtc/test/fake_texture_frame.h
+++ b/webrtc/test/fake_texture_frame.h
@@ -42,9 +42,9 @@
new rtc::RefCountedObject<I420Buffer>(width_, height_));
int half_height = (height_ + 1) / 2;
int half_width = (width_ + 1) / 2;
- memset(buffer->MutableData(kYPlane), 0, height_ * width_);
- memset(buffer->MutableData(kUPlane), 0, half_height * half_width);
- memset(buffer->MutableData(kVPlane), 0, half_height * half_width);
+ memset(buffer->MutableDataY(), 0, height_ * width_);
+ memset(buffer->MutableDataU(), 0, half_height * half_width);
+ memset(buffer->MutableDataV(), 0, half_height * half_width);
return buffer;
}
};
diff --git a/webrtc/test/frame_utils.cc b/webrtc/test/frame_utils.cc
index 21daa44..0fad3ad 100644
--- a/webrtc/test/frame_utils.cc
+++ b/webrtc/test/frame_utils.cc
@@ -61,14 +61,14 @@
}
const int half_width = (f1->width() + 1) / 2;
const int half_height = (f1->height() + 1) / 2;
- return EqualPlane(f1->data(webrtc::kYPlane), f2->data(webrtc::kYPlane),
- f1->stride(webrtc::kYPlane), f2->stride(webrtc::kYPlane),
+ return EqualPlane(f1->DataY(), f2->DataY(),
+ f1->StrideY(), f2->StrideY(),
f1->width(), f1->height()) &&
- EqualPlane(f1->data(webrtc::kUPlane), f2->data(webrtc::kUPlane),
- f1->stride(webrtc::kUPlane), f2->stride(webrtc::kUPlane),
+ EqualPlane(f1->DataU(), f2->DataU(),
+ f1->StrideU(), f2->StrideU(),
half_width, half_height) &&
- EqualPlane(f1->data(webrtc::kVPlane), f2->data(webrtc::kVPlane),
- f1->stride(webrtc::kVPlane), f2->stride(webrtc::kVPlane),
+ EqualPlane(f1->DataV(), f2->DataV(),
+ f1->StrideV(), f2->StrideV(),
half_width, half_height);
}