summaryrefslogtreecommitdiffstats
path: root/media/base/video_frame_unittest.cc
diff options
context:
space:
mode:
authordyen <dyen@chromium.org>2015-11-06 09:40:56 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-06 17:41:38 +0000
commitac45ecf7a20d34d0f120f78eeca004c12c7f7fd6 (patch)
tree266ef634722bb24bbbaa655244855ce2a2c93934 /media/base/video_frame_unittest.cc
parentb6a52da3a216a32f4092aaf8b5c591832d9cdd22 (diff)
downloadchromium_src-ac45ecf7a20d34d0f120f78eeca004c12c7f7fd6.zip
chromium_src-ac45ecf7a20d34d0f120f78eeca004c12c7f7fd6.tar.gz
chromium_src-ac45ecf7a20d34d0f120f78eeca004c12c7f7fd6.tar.bz2
Re-land: Converted video frame and image callbacks to use new sync tokens.
This reverts commit a1ab22a90140fe9e6c669998f3efc52795e569e2. Original issue's description: > Converted video frame and image callbacks to use new sync tokens. > > As an incremental step towards utilizing the new sync tokens, this > CL converts existing video frame and image sync points to use > sync tokens instead. > > In order to accomplish this, the GpuCommandBufferMsg_CreateImage > IPC message has been modified to accept a fence_release parameter > so that it can act as a sync token IPC. > > A new SyncPointClientWaiter concept has also added which can wait > on other sync point clients without an associated order number. > This only works because the SyncPointClientWaiter cannot be waited > on so no deadlocks can occur. > > BUG=514815 > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/c7aff68a0c11820cc2b8d488851c682c0d32cd2b > Cr-Commit-Position: refs/heads/master@{#357997} BUG=514815 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1427893003 Cr-Commit-Position: refs/heads/master@{#358346}
Diffstat (limited to 'media/base/video_frame_unittest.cc')
-rw-r--r--media/base/video_frame_unittest.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc
index c9f05ec..ee2a454 100644
--- a/media/base/video_frame_unittest.cc
+++ b/media/base/video_frame_unittest.cc
@@ -269,7 +269,7 @@ static void TextureCallback(gpu::SyncToken* called_sync_token,
// Verify the gpu::MailboxHolder::ReleaseCallback is called when VideoFrame is
// destroyed with the default release sync point.
TEST(VideoFrame, TextureNoLongerNeededCallbackIsCalled) {
- gpu::SyncToken called_sync_token(1);
+ gpu::SyncToken called_sync_token(gpu::CommandBufferNamespace::GPU_IO, 1, 1);
{
scoped_refptr<VideoFrame> frame = VideoFrame::WrapNativeTexture(
@@ -296,8 +296,8 @@ class SyncTokenClientImpl : public VideoFrame::SyncTokenClient {
explicit SyncTokenClientImpl(const gpu::SyncToken& sync_token)
: sync_token_(sync_token) {}
~SyncTokenClientImpl() override {}
- uint32 InsertSyncPoint() override {
- return static_cast<uint32>(sync_token_.release_count());
+ void GenerateSyncToken(gpu::SyncToken* sync_token) override {
+ *sync_token = sync_token_;
}
void WaitSyncToken(const gpu::SyncToken& sync_token) override {}
@@ -313,14 +313,20 @@ class SyncTokenClientImpl : public VideoFrame::SyncTokenClient {
TEST(VideoFrame,
TexturesNoLongerNeededCallbackAfterTakingAndReleasingMailboxes) {
const int kPlanesNum = 3;
+ const gpu::CommandBufferNamespace kNamespace =
+ gpu::CommandBufferNamespace::GPU_IO;
+ const uint64_t kCommandBufferId = 0x123;
gpu::Mailbox mailbox[kPlanesNum];
for (int i = 0; i < kPlanesNum; ++i) {
mailbox[i].name[0] = 50 + 1;
}
- gpu::SyncToken sync_token(7);
+ gpu::SyncToken sync_token(kNamespace, kCommandBufferId, 7);
+ sync_token.SetVerifyFlush();
uint32 target = 9;
- gpu::SyncToken release_sync_token(111);
+ gpu::SyncToken release_sync_token(kNamespace, kCommandBufferId, 111);
+ release_sync_token.SetVerifyFlush();
+
gpu::SyncToken called_sync_token;
{
scoped_refptr<VideoFrame> frame = VideoFrame::WrapYUV420NativeTextures(