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

Unified Diff: webrtc/common_video/i420_buffer_pool_unittest.cc

Issue 1878623002: Added new VideoFrameBuffer methods Data[YUV]() etc. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add NOLINT for the unusual combination virtual final. Created 4 years, 8 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/i420_buffer_pool_unittest.cc
diff --git a/webrtc/common_video/i420_buffer_pool_unittest.cc b/webrtc/common_video/i420_buffer_pool_unittest.cc
index b030ee774aa8135cdc63c6f299292ca45f343e8f..2bce1fdb8b2b937ea00f4aa6f1b196359ec4885f 100644
--- a/webrtc/common_video/i420_buffer_pool_unittest.cc
+++ b/webrtc/common_video/i420_buffer_pool_unittest.cc
@@ -21,16 +21,16 @@ TEST(TestI420BufferPool, SimpleFrameReuse) {
EXPECT_EQ(16, buffer->width());
EXPECT_EQ(16, buffer->height());
// Extract non-refcounted pointers for testing.
- const uint8_t* y_ptr = buffer->data(kYPlane);
- const uint8_t* u_ptr = buffer->data(kUPlane);
- const uint8_t* v_ptr = buffer->data(kVPlane);
+ const uint8_t* y_ptr = buffer->DataY();
+ const uint8_t* u_ptr = buffer->DataU();
+ const uint8_t* v_ptr = buffer->DataV();
// Release buffer so that it is returned to the pool.
buffer = nullptr;
// Check that the memory is resued.
buffer = pool.CreateBuffer(16, 16);
- EXPECT_EQ(y_ptr, buffer->data(kYPlane));
- EXPECT_EQ(u_ptr, buffer->data(kUPlane));
- EXPECT_EQ(v_ptr, buffer->data(kVPlane));
+ EXPECT_EQ(y_ptr, buffer->DataY());
+ EXPECT_EQ(u_ptr, buffer->DataU());
+ EXPECT_EQ(v_ptr, buffer->DataV());
EXPECT_EQ(16, buffer->width());
EXPECT_EQ(16, buffer->height());
}
@@ -39,16 +39,16 @@ TEST(TestI420BufferPool, FailToReuse) {
I420BufferPool pool;
rtc::scoped_refptr<VideoFrameBuffer> buffer = pool.CreateBuffer(16, 16);
// Extract non-refcounted pointers for testing.
- const uint8_t* u_ptr = buffer->data(kUPlane);
- const uint8_t* v_ptr = buffer->data(kVPlane);
+ const uint8_t* u_ptr = buffer->DataU();
+ const uint8_t* v_ptr = buffer->DataV();
// Release buffer so that it is returned to the pool.
buffer = nullptr;
// Check that the pool doesn't try to reuse buffers of incorrect size.
buffer = pool.CreateBuffer(32, 16);
EXPECT_EQ(32, buffer->width());
EXPECT_EQ(16, buffer->height());
- EXPECT_NE(u_ptr, buffer->data(kUPlane));
- EXPECT_NE(v_ptr, buffer->data(kVPlane));
+ EXPECT_NE(u_ptr, buffer->DataU());
+ EXPECT_NE(v_ptr, buffer->DataV());
}
TEST(TestI420BufferPool, ExclusiveOwner) {
@@ -68,7 +68,7 @@ TEST(TestI420BufferPool, FrameValidAfterPoolDestruction) {
EXPECT_EQ(16, buffer->width());
EXPECT_EQ(16, buffer->height());
// Try to trigger use-after-free errors by writing to y-plane.
- memset(buffer->MutableData(kYPlane), 0xA5, 16 * buffer->stride(kYPlane));
+ memset(buffer->MutableDataY(), 0xA5, 16 * buffer->StrideY());
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698