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

Side by Side Diff: cc/resources/video_resource_updater.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 5 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 PlaneResource(unsigned resource_id, 104 PlaneResource(unsigned resource_id,
105 const gfx::Size& resource_size, 105 const gfx::Size& resource_size,
106 ResourceFormat resource_format, 106 ResourceFormat resource_format,
107 gpu::Mailbox mailbox); 107 gpu::Mailbox mailbox);
108 }; 108 };
109 109
110 static bool PlaneResourceMatchesUniqueID(const PlaneResource& plane_resource, 110 static bool PlaneResourceMatchesUniqueID(const PlaneResource& plane_resource,
111 const media::VideoFrame* video_frame, 111 const media::VideoFrame* video_frame,
112 size_t plane_index); 112 size_t plane_index);
113 113
114 static void SetPlaneResourceUniqueId(const media::VideoFrame* video_frame, 114 // Side effect: Marks in the userdata of the VideoFrame to prevent reusing the
115 // resource in the case that the original VideoFrame is destroyed and a new
116 // VideoFrame is re-created with the same pointer and the timestamps are not
117 // correctly set by the client.
118 static void SetPlaneResourceUniqueId(media::VideoFrame* video_frame,
115 size_t plane_index, 119 size_t plane_index,
116 PlaneResource* plane_resource); 120 PlaneResource* plane_resource);
117 121
118 // This needs to be a container where iterators can be erased without 122 // This needs to be a container where iterators can be erased without
119 // invalidating other iterators. 123 // invalidating other iterators.
120 typedef std::list<PlaneResource> ResourceList; 124 typedef std::list<PlaneResource> ResourceList;
121 ResourceList::iterator AllocateResource(const gfx::Size& plane_size, 125 ResourceList::iterator AllocateResource(const gfx::Size& plane_size,
122 ResourceFormat format, 126 ResourceFormat format,
123 bool has_mailbox, 127 bool has_mailbox,
124 bool immutable_hint); 128 bool immutable_hint);
(...skipping 26 matching lines...) Expand all
151 // Recycle resources so that we can reduce the number of allocations and 155 // Recycle resources so that we can reduce the number of allocations and
152 // data transfers. 156 // data transfers.
153 ResourceList all_resources_; 157 ResourceList all_resources_;
154 158
155 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); 159 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater);
156 }; 160 };
157 161
158 } // namespace cc 162 } // namespace cc
159 163
160 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 164 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/video_resource_updater.cc » ('j') | cc/resources/video_resource_updater.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698