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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 1688033005: Monitor VideoResourceUpdater reusing destructed resource in Debug mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add new VideoFrameMetada field. Created 4 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: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index e6827ee3315c57c4dc789be81d3220948e547c74..1354e9e59153ba6e9e63b51e851a2769be9b7552 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -132,18 +132,29 @@ bool VideoResourceUpdater::PlaneResourceMatchesUniqueID(
const PlaneResource& plane_resource,
const media::VideoFrame* video_frame,
size_t plane_index) {
- return plane_resource.frame_ptr == video_frame &&
- plane_resource.plane_index == plane_index &&
- plane_resource.timestamp == video_frame->timestamp();
+ if (plane_resource.frame_ptr == video_frame &&
+ plane_resource.plane_index == plane_index &&
+ plane_resource.timestamp == video_frame->timestamp()) {
+ bool video_frame_in_resource;
miu 2016/02/22 21:17:37 There's a helper method in VideoFrameMetadata to a
xjz 2016/02/23 03:36:03 Done.
+ if (video_frame->metadata()->GetBoolean(
+ media::VideoFrameMetadata::RESOURCE_UPDATER_FLAG,
+ &video_frame_in_resource))
+ return video_frame_in_resource;
+ else
+ return false;
+ }
+ return false;
}
void VideoResourceUpdater::SetPlaneResourceUniqueId(
- const media::VideoFrame* video_frame,
+ media::VideoFrame* video_frame,
size_t plane_index,
PlaneResource* plane_resource) {
plane_resource->frame_ptr = video_frame;
plane_resource->plane_index = plane_index;
plane_resource->timestamp = video_frame->timestamp();
+ video_frame->metadata()->SetBoolean(
+ media::VideoFrameMetadata::RESOURCE_UPDATER_FLAG, true);
}
VideoFrameExternalResources::VideoFrameExternalResources()

Powered by Google App Engine
This is Rietveld 408576698