0

I try to run ExoPlayer demo app on my device, but I've had this problem:

outputIndex = codec.dequeueOutputBuffer(outputBufferInfo, 0);

always returns -1.

I viewed all questions and answers on stackoverflow, but nothing could help me. I set sps and pps header in csd-0 and csd-1 buffer in MediaFormat (I tried it with start code and without), set it in one buffer csd-0, called queueInputBuffer with MediaCodec.BUFFER_FLAG_CODEC_CONFIG, changed timeout to 10000 and even to -1. Everything works on other devices, but not where I need. Decoder - OMX.amlogic.avc.decoder.awesome

EDIT If I set timeout to -1, then nothing happens, I wait for dequeueOutputBuffer, but logcat shows:

Warning message AMessage(what = 'omx ', target = 5) = {
int32_t type = 0
void *node = 0x51
int32_t event = 2130706433
int32_t data1 = 0
int32_t data2 = 0
} unhandled in root state.

EDIT 2: I've found, that amlogic decoder's output buffer size is smaller, than input. But on other devices, where video always shows, the situation is reverse: output buffer size is bigger. Is it important?

Maybe someone had the same problem? Is it codec specification? What else I need to try?

Jane
  • 61
  • 7
  • Check the logcat output for anything suspicious. With a timeout of -1 it should stall forever, so if it's returning immediately with -1 when you've given it an infinite timeout then it sounds like something isn't being configured happily. – fadden Jun 24 '15 at 16:43
  • Please, look at my edited answer – Jane Jun 24 '15 at 16:57
  • Could it be possible that the underlying decoder is outputting the frame in `metadata` format? What is the size of the decoder's output buffer? – Ganesh Jun 25 '15 at 07:58
  • @Ganesh the size of output buffer - 4, input - 8. Unlike another test device, where output size 23 and input 4. – Jane Jun 25 '15 at 08:37
  • @Ganesh please help if you have idea. – Jane Jun 25 '15 at 14:07
  • @Jane.. If you are working with `Lollipop` or higher, please try to enable logs in `ACodec`. If earlier, please enable logs in `OMXCodec` part of `stagefright` framework. If you can share your `logcat`, it would be helpful to rootcause your problem. Sometimes, if the stream has `B-frames`, some decoders may buffer up to `dpb-size` and then start releasing the frames. If possible, please try with a bitstream with `dpb-size` set to 1 and check if you get any success with the same. – Ganesh Jun 25 '15 at 15:19
  • @Jane.. Since this is `exoPlayer`, the codec will be `ACodec`. Hence, enabling logs in `ACodec` should be a good start – Ganesh Jun 25 '15 at 15:20
  • @Ganesh Sorry, now I can't view on logcat, but I've noticed, that codec.getOutputBuffers() returns buffer array with zero capacity of each element. What problem may be? – Jane Jun 25 '15 at 16:52
  • @Ganesh I take output buffers from surface view, so it seems like surface is not ready and returns empty output. – Jane Jun 25 '15 at 17:13
  • @Ganesh Can you please help me with this? http://stackoverflow.com/questions/32723393/video-rendering-is-broken-mediacodec-h-264-stream/ – Kaidul Oct 06 '15 at 06:03
  • How do you enable logs in ACodec? – tmm1 Apr 21 '18 at 00:36

0 Answers0