[mediacodec] Impl BufferPool.

This moves the logic to keep track of buffers ffmpeg depends
on and the process of assigning them to AVFrames into BufferPool
so that encode can use it as well.

TEST: use_video_decoder
Change-Id: I85c273283cfe949cef5f116dac3ad2c0cf18dda0
6 files changed