Correct MediaCodec + Surface behavior

Assorted tweaks:
- Allow signalEndOfInputStream() before ACodec is in Executing
  state (added message to two more states).
- Return an error if signalEndOfInputStream() is called a second
  time on the same stream.
- Require AndroidOpaque color format in createInputSurface().
- Disallow dequeueInputBuffer() after an input surface has been
  created (boolean flag in MediaCodec tracks it).
- Discard input surface when encoder is re-configure()ed (drop
  OMXNodeInstance's ref when we go back to Loaded).

Bug 7991062

Change-Id: Iff30f3036e14eb5a2f6536910dcf11aba33031ee
7 files changed