DescriptionEnable adaptive playback for spitzer, use conservative size.
Android MediaCodec allocates memory for adaptive playback (dynamic
resolution change) based on hints provided to the codec during
construction about the maximum expected decoded frame dimensions.
That can signficantly increate the memory usage / reduce the number
of concurrent codec instances that chrome can use.
On some devices (Samsung S3), adaptive playback also entirely breaks
decoding. Decoded frames can be tiled / black and white / generally
quite incorrect.
Spitzer had previously turned off dynamic resolution support to fix
both of these.
However, it turns out that enabling adaptive support is necessary:
- returning unused decoded buffers to MediaCodec without rendering
can incorrectly stop MediaCodec from decoding more frames without
adaptive playback enabled.
- some videos on some devices (N7) play very slowly otherwise.
This CL requests adaptive playback when AVDA creates the MediaCodec
instance. It also plumbs the inital coded size to AVDA, and send it
to MediaCodecBridge. MediaCodecBridge now uses this size, rather
than 1920x1080, as the max adaptive size hint to save memory.
For devices like the S3, MediaCodecBridge ignores the request for
adaptive playback, and keeps it off.
Providing the size to MediaCodec will also allow it to choose an
appropriate input buffer size. Previously, it used the requested
size of 320x240 when estimating the size of an encoded frame.
BUG=599908, 596211, 601066
Committed: https://crrev.com/62cf4f1fab4e0cc2560983465d3fd15fde537f00
Cr-Commit-Position: refs/heads/master@{#386091}
Patch Set 1 #Patch Set 2 : removed a stale comment. #
Total comments: 12
Patch Set 3 : cl feedback. #
Total comments: 1
Messages
Total messages: 18 (6 generated)
|