OSDN Git Service

MediaCodec: revalidate cached queued input buffers if queue fails
authorLajos Molnar <lajos@google.com>
Wed, 24 Sep 2014 21:07:35 +0000 (14:07 -0700)
committerLajos Molnar <lajos@google.com>
Wed, 24 Sep 2014 21:12:08 +0000 (14:12 -0700)
commit00bbc7d9faa0830ea15e4846083508b38ceff6e5
treec9acaf05d7c89efe5e8640dd9b76caa06efc0f80
parentfae2aabc30b0c3143fe3096140f8f4a9b00d87a7
MediaCodec: revalidate cached queued input buffers if queue fails

For legacy behavior (using getInputBuffers) input buffer needs to
be made valid if queue fails.  Otherwise, it becomes unusable,
and the buffer still belongs to the user.

In the new model, buffers obtained by getIn/OutputBuffer will
become invalid even if queue/release fails.

We do not do the same logic for output buffers, as these should
not be accessed even if releaseBuffer fails (which really should not
happen anyway unless codec is in bad state).

Bug: 17630446
Change-Id: Ica72a168d8aea97a0ee3f3ef49c60d0ca5a9fa06
media/java/android/media/MediaCodec.java