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

Unified Diff: webrtc/test/frame_utils.cc

Issue 1822283002: New method I420Buffer::Copy. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address compare nit. Created 4 years, 9 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/test/frame_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/frame_utils.cc
diff --git a/webrtc/test/frame_utils.cc b/webrtc/test/frame_utils.cc
index 13f358a2a1aa1e5271a319fbd404eb5e85dd34d4..0f411447458173331b48db59de325b7a4cc174c4 100644
--- a/webrtc/test/frame_utils.cc
+++ b/webrtc/test/frame_utils.cc
@@ -47,5 +47,23 @@ bool FramesEqual(const webrtc::VideoFrame& f1, const webrtc::VideoFrame& f2) {
f1.stride(webrtc::kVPlane), half_width, half_height);
}
+bool FrameBufsEqual(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f1,
+ const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f2) {
+ if (f1->width() != f2->width() || f1->height() != f2->height() ||
+ f1->stride(webrtc::kYPlane) != f2->stride(webrtc::kYPlane) ||
+ f1->stride(webrtc::kUPlane) != f2->stride(webrtc::kUPlane) ||
+ f1->stride(webrtc::kVPlane) != f2->stride(webrtc::kVPlane)) {
+ return false;
+ }
+ 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), f1->width(), f1->height()) &&
+ EqualPlane(f1->data(webrtc::kUPlane), f2->data(webrtc::kUPlane),
+ f1->stride(webrtc::kUPlane), half_width, half_height) &&
+ EqualPlane(f1->data(webrtc::kVPlane), f2->data(webrtc::kVPlane),
+ f1->stride(webrtc::kVPlane), half_width, half_height);
+}
+
} // namespace test
} // namespace webrtc
« no previous file with comments | « webrtc/test/frame_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698