Skip to content
Snippets Groups Projects
Commit 62a9e438 authored by Chih-Yu Huang's avatar Chih-Yu Huang
Browse files

V4L2Decoder: destroy previous VideoFramePool before getting new one

VideoFramePool is used to wrap C2BlockPool and request buffers for
V4L2Decoder. When resolution changes, V4L2Decoder creates a new
VideoFramePool instance to request buffers with new resolution.
Also, C2VdaBqBlockPool is designed to provide buffers with the same
resolution. So there only one VideoFramePool could exist at the same
time.

This CL destroys the previous VideoFramePool before getting the new
one, and checks the buffer format passed to
C2VdaBqBlockPool::fetchGraphicBlock() is the same as the format
requested by requestNewBufferSet().

Also, this CL simplifies the signature of the callback of getting
VideoFramePool. Originally we put the returned value at output
argument because Chromium callback with WeakPtr doesn't support
returned value. But we actually could avoid WeakPtr here because
V4L2Decoder is always destroyed before V4L2DecodeComponent. It's safe
to use ::base::Unretained(this).

Bug: 174287571
Test: android.media.cts.AdaptivePlaybackTest#test{H264,Vp8,Vp9}_*

Change-Id: Ib06855e7ccc3db5508a4a3f6403bceedb9b5f59d
parent 876c5114
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment