title: Android Kitkat 4.4.2: Adaptive Playback impact on SurfaceFlinger
body: <p>I came across this <a href="https://stackoverflow.com/questions/20172520/adaptive-playback-in-android-4-4">generic question on <em>Adaptive Playback</em></a> in <code>Android</code> <code>Kitkat</code> in SO. However, I have some specific queries as below:</p>
  <p>I am able to understand the implications on the <code>codec</code> and the related framework. However, there is one specific point which I am unable to understand completely.</p>
  <p>In case of adaptive playback, the codec employs a <code>metadata</code> on it's output port which basically abstracts and packages an underlying buffer handle (in all probability a <code>gralloc</code> handle). If a resolution changes, I presume the <code>codec</code> updates the <code>gralloc</code> handle attributes directly and sends the buffer back to the <code>OMX</code> Client without a port settings change.</p>
  <p>My first question is: Is my understanding and assumption correct?</p>
  <p>If so, how does the <code>Surfaceflinger</code>/<code>SurfaceTexture</code> know that the incoming payload is in <code>metadata</code> format and how does it retrieve the <code>width</code> and <code>height</code> from the underlying <code>gralloc</code> implementation?</p>
  <p>Can you please point me to the relevant sources which will help me to understand this issue better?</p>
  <p>Many thanks in advance.</p>