OSDN Git Service

Fix bug 5049371 Metadata for decode to PCM buffer queue
authorJean-Michel Trivi <jmtrivi@google.com>
Wed, 20 Jul 2011 00:05:25 +0000 (17:05 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Wed, 20 Jul 2011 00:56:01 +0000 (17:56 -0700)
commit347285f59e4aa7a062f67c4ae3a854cbdacb6378
treeff58da47353ddd305134f70850a1cc9cd0bc2784
parent33c8006169faa725ef22fd074b8365c63a300d55
Fix bug 5049371 Metadata for decode to PCM buffer queue

When decoding a URI or FD with OpenSL ES to a PCM buffer queue,
 you cannot rely on the information given by the extractor, or
 the OMXCodec before the latter has decoded one buffer.

The fix consists in two parts:
1/ where to retrieve the PCM format from:
  the information first retrieved from the extractor if available,
  but then overwritten by the OMXCodec values as soon as it
  issues INFO_FORMAT_CHANGED
2/ when can the application retrieve the information:
  the information is available when the first buffer of decoded
  data is returned to the application via the buffer queue
  callback. The test app is updated to reflect this, and verify
  that the query can safely happen during the callback.

Change-Id: Ic034c7ff9412c94e9df2aaa3c1d61e9d3bf507d9
wilhelm/src/android/android_AudioSfDecoder.cpp
wilhelm/src/android/android_AudioSfDecoder.h
wilhelm/src/android/android_AudioToCbRenderer.cpp
wilhelm/tests/examples/slesTestDecodeToBuffQueue.cpp