Update tunneled pause reqs and refactor player states

The states inside MediaCodecTunneledPlayer and the order in which
methods are called is horribly confusing. Previously you needed to call
start, which effectively does nothing, followed by prepare which
identifies tracks and configures the codec, followed by calling start
again, which now finally starts the codec. Now, instead, you simply call
prepare and then start, as one would expect.

Also, the pause requirements for tunneled playback have been updated so
that audio pauses within 250ms, and video is allowed to run free for
500ms after audio pauses. The longer video allowance is to accomodate a
deeper pipeline in video processing, which cannot be immediately halted.

Also, improved the logic around asserting that audio and video is in
sync at the point in time at which pause occurs, allowing the video to
slide ahead of audio to allow for this deep video pipeline.

Also, allow audio codecs to be normalized to the first sample time and
capture the first sample time for proper seekToBeginning behavior.

Bug: 200280120
Bug: 199393787
Fixes: 200280120
Fixes: 200280120
Test: atest android.media.decoder.cts.DecoderTest#testTunneledAccurateVideoFlushAvc
on several different SoC devices

Change-Id: Ib4034c7615defbc098086bfd315906fb3b034581
10 files changed