DO NOT MERGE: Emulate AudioTrack.write(...,timestamp) in CTS tests

Emulate the behavior for `AudioTrack.write(ByteBuffer audioData,
                                           int sizeInBytes,
                                           @WriteMode int writeMode,
                                           long timestamp)`
on L MR1 where AudioTrack.write(...,timestamp) is still unavailable.

This is done by prepending a pts header to each data buffer before
the buffer is submitted through AudioTrack.write.

This commit is a port of f5e62d4adfa5a6bd750bdac279b7467ad0208cf9 on M
(c20af2fde6399c1ebbc938c2a85053e2d7037809 on master), plus two additonal
changes to ensure testTunneledVideoPlayback passes on L MR1:

* reposition audio data ByteBuffer to 0
* use input EOS as output EOS indicator

Bug: 23165343
Change-Id: If39a784ed17f4c57846c58841e5d28d62616889a
2 files changed