Chromium Code Reviews
DescriptionClose bitstream buffer shared memory handles on Android.
AndroidVideoDecodeAccelerator would clear references to pending
bitstream buffers in ::Reset and, implicitly, in the destructor.
However, each of those may have a file descriptor for shared memory
that isn't closed. During a seek, for example, this can cause leaks.
This CL wraps the queue of pending bitstream buffers with a new
BitstreamRecord type, which has a unique_ptr to the (unmapped)
shared memory region, if any. This will automatically close the
underlying handle when the unique_ptr is released. Note that no
expensive operation is performed in creating the shared memory
region. Unless it is later mapped, it just keeps the handle
and ::close()s it on destruction.
BUG=614489
TEST=observed /proc/fd/[gpu process] while seeking in a video
Committed: https://crrev.com/6e41c76f8bb74142e5a484f3ee6f6a87119b12fb
Cr-Commit-Position: refs/heads/master@{#395985}
Patch Set 1 #
Total comments: 2
Patch Set 2 : RAII #Patch Set 3 : moved BitstreamRecord code higher in avda.cc #
Messages
Total messages: 15 (5 generated)
|
||||||||||||||||||||||||||||