I couldn't find any information on this topic. Maybe someone of you may help. I'm using the Android MediaCodec to decode H264-frames. The MediaCodec is used in synchronous mode. I want to measure the time from queueing one single frame to the decoder to the point where it is actually viewable on the screen.
So at some point in my code I call
codec.getInputBuffer(inIndex);
And afterwards:
int outIndex = codec.dequeueOutputBuffer(bufferInfo, BUFFER_TIMEOUT);
if(outIndex >= 0)
codec.releaseOutputBuffer(outIndex, true);
if(PMVR.calculateLatency && validIteration) {
PMVR.calculateLatency = false;
PMVR.pingEnded = System.nanoTime();
}
So question one: Can I assume that the frame that was previously queued to the input buffers is the one that i get decoded when doing the call to dequeuOutputBuffers()
(Note: synchronous mode)? I couldn't find an option to actually set a picture ID...
And question two: I call releaseOutputBuffer()
with render=true
. How long does it actually take to display the decoded frame?
Thanks for your help,
Christoph