Chromium Code Reviews| 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() |