commit | 12448981c5e0efd9d4b6c77a2f96edd50ec230da | [log] [tgz] |
---|---|---|
author | Alexandre Courbot <acourbot@chromium.org> | Fri Feb 22 10:38:49 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Feb 22 10:38:49 2019 |
tree | d2f68ba265dc98292c1cef363979e28ab3211ba5 | |
parent | 6dea0e015acbe0e684ec699dad9145343884036d [diff] |
media/gpu/v4l2: use WeakPtr to reference V4L2Queue from buffer references We have made V4L2ReadableBufferRef's destruction thread-safe, but they still hold a scoped_refptr to their V4L2Queue. This means that the V4L2Queue can be destroyed from V4L2ReadableBufferRef's destructor, i.e. in the incorrect thread. Fix this by changing the scoped_refptr to a WeakPtr. This design also fixes another issue: it lets us invalidate the WeakPtrs if buffers get reallocated, making it impossible to access the wrong buffer after such an event. Methods of V4L2ReadableBufferRef that make use of the queue accordingly check that the WeakPtr is valid and return an error value if it is not. Bug: 792790 Bug: b:119794200 Test: VDA unittest passed in regular and import mode on Hana. Change-Id: I82722033d9b902fd44f5c090be47ffb4469222a3 Reviewed-on: https://chromium-review.googlesource.com/c/1481186 Commit-Queue: Alexandre Courbot <acourbot@chromium.org> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Cr-Commit-Position: refs/heads/master@{#634606}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .