OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/base/video_frame.h" | 5 #include "media/base/video_frame.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 } | 803 } |
804 | 804 |
805 void VideoFrame::UpdateReleaseSyncToken(SyncTokenClient* client) { | 805 void VideoFrame::UpdateReleaseSyncToken(SyncTokenClient* client) { |
806 DCHECK(HasTextures()); | 806 DCHECK(HasTextures()); |
807 base::AutoLock locker(release_sync_token_lock_); | 807 base::AutoLock locker(release_sync_token_lock_); |
808 // Must wait on the previous sync point before inserting a new sync point so | 808 // Must wait on the previous sync point before inserting a new sync point so |
809 // that |mailbox_holders_release_cb_| guarantees the previous sync point | 809 // that |mailbox_holders_release_cb_| guarantees the previous sync point |
810 // occurred when it waits on |release_sync_token_|. | 810 // occurred when it waits on |release_sync_token_|. |
811 if (release_sync_token_.HasData()) | 811 if (release_sync_token_.HasData()) |
812 client->WaitSyncToken(release_sync_token_); | 812 client->WaitSyncToken(release_sync_token_); |
813 release_sync_token_ = gpu::SyncToken(client->InsertSyncPoint()); | 813 client->GenerateSyncToken(&release_sync_token_); |
814 } | 814 } |
815 | 815 |
816 // static | 816 // static |
817 scoped_refptr<VideoFrame> VideoFrame::WrapExternalStorage( | 817 scoped_refptr<VideoFrame> VideoFrame::WrapExternalStorage( |
818 VideoPixelFormat format, | 818 VideoPixelFormat format, |
819 StorageType storage_type, | 819 StorageType storage_type, |
820 const gfx::Size& coded_size, | 820 const gfx::Size& coded_size, |
821 const gfx::Rect& visible_rect, | 821 const gfx::Rect& visible_rect, |
822 const gfx::Size& natural_size, | 822 const gfx::Size& natural_size, |
823 uint8* data, | 823 uint8* data, |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 if (zero_initialize_memory) | 1000 if (zero_initialize_memory) |
1001 memset(data, 0, data_size); | 1001 memset(data, 0, data_size); |
1002 | 1002 |
1003 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) | 1003 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) |
1004 data_[plane] = data + offset[plane]; | 1004 data_[plane] = data + offset[plane]; |
1005 | 1005 |
1006 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); | 1006 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); |
1007 } | 1007 } |
1008 | 1008 |
1009 } // namespace media | 1009 } // namespace media |
OLD | NEW |