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

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: 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
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | media/base/video_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2a1a0c0261a9af863f5f3653b3ab262b8e278ad5 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -29,6 +29,10 @@ namespace {
const ResourceFormat kRGBResourceFormat = RGBA_8888;
+// This key is used to mark the userdata in VideoFrame to indicate that its
+// content has been cached in VideoResourceUpdater.
+const char kResourceUploadedKey[] = "ResourceUploadedFlag";
+
VideoFrameExternalResources::ResourceType ResourceTypeForVideoFrame(
media::VideoFrame* video_frame) {
switch (video_frame->format()) {
@@ -134,16 +138,19 @@ bool VideoResourceUpdater::PlaneResourceMatchesUniqueID(
size_t plane_index) {
return plane_resource.frame_ptr == video_frame &&
plane_resource.plane_index == plane_index &&
- plane_resource.timestamp == video_frame->timestamp();
+ plane_resource.timestamp == video_frame->timestamp() &&
danakj 2016/02/23 23:55:09 Can you instead just return false if the timestamp
xjz 2016/02/24 00:01:28 The actual timestamp could be 0. It is difficult t
danakj 2016/02/24 00:07:08 Oh :/ I don't really like cc setting things on a V
xjz 2016/02/24 21:57:58 This sounds equivalent to asking decoders correctl
+ video_frame->GetUserData(kResourceUploadedKey);
}
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->SetUserData(kResourceUploadedKey,
+ new base::SupportsUserData::Data());
}
VideoFrameExternalResources::VideoFrameExternalResources()
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698