Various improvements to tunneled underrun test

Allow for longer durations between checking video timestamps when
detecting video pause. This is because there are sometimes delays in
Framework forwarding OMX_EventFrameRendered via onFrameRendered.

Allow for video to run for 300ms after audio underrun occurs, because it
takes some time for AudioFlinger to detect audio underrun and pause the
audio track and some audio HALs can't do underrun detection because they
have no internal buffers. This could be reduced by improvements in
AudioFlinger underrun detection.

Fix post-resume timestamp capture. We were previously capturing the
system time before the resume occurred.

Refactor AV sync logic to use extrapolate the system time of the audio
frame associated with the first resumed video frame.

Allow 80ms of AV sync tolerance because the golden display used in NTS
and the UDC used for Dolby certification are imperfect devices and it
requires hardcoded offsets in audio timestamps in order to achieve
correct AV sync during those certifications.

Bug: 234327211
Test: atest android.media.decoder.cts.DecoderTest#testTunneledAudioUnderrunAvc
Change-Id: I2e5d44caa50daa46940ba703bef3fcb446f6f6a1
1 file changed