0

I have written an android app that streams h.264 frames from a mobile-dvr/nvr and the solution works on all of the devices that I have tested on except for the Nexus 10. It successfully streams video on galaxy devices, the Nexus 7, and multiple Motorola devices without any problems. No exceptions are thrown and the log shows nothing strange, but when debugging

MediaCodec.dequeueInputBuffer(10000);

always returns -1, thus never supplying a valid input buffer index to send a frame to. I assume that I am configuring the MediaCodec properly considering it works on all other devices that have been tested. Has anyone else had an issue similar to this and if so is there a known fix or reason for this problem with the Nexus 10?

public void ConfigureDecoder(Surface s, int w, int h)
{
    try
    {
        Decoder = MediaCodec.createDecoderByType("video/avc");
        MediaFormat mFormat = MediaFormat.createVideoFormat("video/avc", w, h);
        Decoder.configure(mFormat, s, null, 0);
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}
Kiel Wood
  • 1
  • 2
  • Are you doing encoding or decoding on Nexus 10? – Daniel Jan 24 '14 at 18:40
  • Also: what version of Android? Can you show the code that configures the device? Is there anything odd in logcat? – fadden Jan 25 '14 at 05:42
  • Version of Android is 4.3 but it was also tested on a Nexus 10 that was running 4.2 and another that was running 4.4. Nothing odd showing in the logcat either. – Kiel Wood Jan 27 '14 at 13:56
  • Code seems reasonable (very similar to code in CTS EncodeDecodeTest). If you're never given an opportunity to provide input, it can't be a problem with the input stream, so I'm focusing on the configuration. Normally `configure()` will complain if it doesn't like something. What values are typical for 'w' and 'h'? How long are you looping on `dequeueInputBuffer()`? Some device's codecs may take longer to start than others. Any problems with the Grafika demos (https://github.com/google/grafika) on your device? – fadden Jan 28 '14 at 00:16

0 Answers0