Codec2Client: Do not overlap setOutputSurface

setOutputSurface() can race between a normal surface change and a release
surface change. stopUseOutputSurface() may race with setOutputSurface().
Guarantee they run mutually exclusively.

Bug: 202903117
Test: atest android.media.cts.MediaCodecTest#testAsyncRelease
Test: atest android.media.decoder.cts.AdaptivePlaybackTest

Change-Id: Ia1262fccd0c96530f7b8f0056ea2c3acb448a1a2
2 files changed