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

Unified Diff: media/base/video_frame.cc

Issue 175223003: HW Video: Make media::VideoFrame handle the sync point of the compositor as well as webgl (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: build fix cast_unittests Created 6 years, 10 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.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 7e654319c52c9964250023eb8ea2ea83bff85802..687c68bbcc34078492b7beb304f4234cc603dd9a 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -409,6 +409,7 @@ VideoFrame::VideoFrame(VideoFrame::Format format,
natural_size_(natural_size),
shared_memory_handle_(base::SharedMemory::NULLHandle()),
timestamp_(timestamp),
+ release_sync_point_(0),
end_of_stream_(end_of_stream) {
memset(&strides_, 0, sizeof(strides_));
memset(&data_, 0, sizeof(data_));
@@ -416,6 +417,11 @@ VideoFrame::VideoFrame(VideoFrame::Format format,
VideoFrame::~VideoFrame() {
if (!mailbox_holder_release_cb_.is_null()) {
+ {
+ base::AutoLock locker(release_sync_point_lock_);
+ if (release_sync_point_)
+ mailbox_holder_->sync_point = release_sync_point_;
+ }
base::ResetAndReturn(&mailbox_holder_release_cb_)
.Run(mailbox_holder_.Pass());
}
@@ -498,6 +504,12 @@ base::SharedMemoryHandle VideoFrame::shared_memory_handle() const {
return shared_memory_handle_;
}
+void VideoFrame::SetReleaseSyncPoint(uint32 sync_point) {
+ DCHECK_EQ(format_, NATIVE_TEXTURE);
+ base::AutoLock locker(release_sync_point_lock_);
+ release_sync_point_ = sync_point;
+}
+
void VideoFrame::HashFrameForTesting(base::MD5Context* context) {
for (int plane = 0; plane < kMaxPlanes; ++plane) {
if (!IsValidPlane(plane))

Powered by Google App Engine
This is Rietveld 408576698