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

Unified Diff: media/base/video_frame_unittest.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Folded sync_point into sync_tokens Created 5 years, 2 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: media/base/video_frame_unittest.cc
diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc
index 879be7dddc3244e1970de5c0c36e593e344f5b9d..de7c0c6ccf285e5ceb034cd7677fc93ed9e6691c 100644
--- a/media/base/video_frame_unittest.cc
+++ b/media/base/video_frame_unittest.cc
@@ -261,9 +261,9 @@ TEST(VideoFrame, CheckFrameExtents) {
ExpectFrameExtents(PIXEL_FORMAT_YV16, "cce408a044b212db42a10dfec304b3ef");
}
-static void TextureCallback(uint32* called_sync_point,
- uint32 release_sync_point) {
- *called_sync_point = release_sync_point;
+static void TextureCallback(gpu::SyncToken* called_sync_token,
+ const gpu::SyncToken& release_sync_token) {
+ *called_sync_token = release_sync_token;
}
// Verify the gpu::MailboxHolder::ReleaseCallback is called when VideoFrame is
@@ -291,12 +291,12 @@ TEST(VideoFrame, TextureNoLongerNeededCallbackIsCalled) {
namespace {
-class SyncPointClientImpl : public VideoFrame::SyncPointClient {
+class SyncTokenClientImpl : public VideoFrame::SyncTokenClient {
public:
- explicit SyncPointClientImpl(uint32 sync_point) : sync_point_(sync_point) {}
- ~SyncPointClientImpl() override {}
+ explicit SyncTokenClientImpl(uint32 sync_point) : sync_point_(sync_point) {}
+ ~SyncTokenClientImpl() override {}
uint32 InsertSyncPoint() override { return sync_point_; }
- void WaitSyncPoint(uint32 sync_point) override {}
+ void WaitSyncToken(const gpu::SyncToken& sync_token) override {}
private:
uint32 sync_point_;
@@ -316,19 +316,21 @@ TEST(VideoFrame,
}
uint32 sync_point = 7;
+ gpu::SyncToken sync_token(sync_point);
uint32 target = 9;
uint32 release_sync_point = 111;
- uint32 called_sync_point = 0;
+ gpu::SyncToken release_sync_token(release_sync_point);
+ gpu::SyncToken called_sync_token;
{
scoped_refptr<VideoFrame> frame = VideoFrame::WrapYUV420NativeTextures(
- gpu::MailboxHolder(mailbox[VideoFrame::kYPlane], target, sync_point),
- gpu::MailboxHolder(mailbox[VideoFrame::kUPlane], target, sync_point),
- gpu::MailboxHolder(mailbox[VideoFrame::kVPlane], target, sync_point),
- base::Bind(&TextureCallback, &called_sync_point),
- gfx::Size(10, 10), // coded_size
- gfx::Rect(10, 10), // visible_rect
- gfx::Size(10, 10), // natural_size
- base::TimeDelta()); // timestamp
+ gpu::MailboxHolder(mailbox[VideoFrame::kYPlane], target, sync_token),
+ gpu::MailboxHolder(mailbox[VideoFrame::kUPlane], target, sync_token),
+ gpu::MailboxHolder(mailbox[VideoFrame::kVPlane], target, sync_token),
+ base::Bind(&TextureCallback, &called_sync_token),
+ gfx::Size(10, 10), // coded_size
+ gfx::Rect(10, 10), // visible_rect
+ gfx::Size(10, 10), // natural_size
+ base::TimeDelta()); // timestamp
EXPECT_EQ(VideoFrame::STORAGE_OPAQUE, frame->storage_type());
EXPECT_EQ(PIXEL_FORMAT_I420, frame->format());
@@ -338,15 +340,15 @@ TEST(VideoFrame,
const gpu::MailboxHolder& mailbox_holder = frame->mailbox_holder(i);
EXPECT_EQ(mailbox[i].name[0], mailbox_holder.mailbox.name[0]);
EXPECT_EQ(target, mailbox_holder.texture_target);
- EXPECT_EQ(sync_point, mailbox_holder.sync_point);
+ EXPECT_EQ(sync_token, mailbox_holder.sync_token);
}
- SyncPointClientImpl client(release_sync_point);
- frame->UpdateReleaseSyncPoint(&client);
- EXPECT_EQ(sync_point,
- frame->mailbox_holder(VideoFrame::kYPlane).sync_point);
+ SyncTokenClientImpl client(release_sync_point);
+ frame->UpdateReleaseSyncToken(&client);
+ EXPECT_EQ(sync_token,
+ frame->mailbox_holder(VideoFrame::kYPlane).sync_token);
}
- EXPECT_EQ(release_sync_point, called_sync_point);
+ EXPECT_EQ(release_sync_token, called_sync_token);
}
TEST(VideoFrame, IsValidConfig_OddCodedSize) {

Powered by Google App Engine
This is Rietveld 408576698