2

I am using omxcodec of stage-fright framework to perform h.264 hardware decoding and the AwesomeNativeRenderer to render it to the surface.
Currently I am using karbonn A9+ device with android 4.0.4. For resolutions upto 480p it instantiates OMX.qcom.video.decoder.avc and for 720p it instantiates OMX.ittiam.video.decoder.avc and when I try to display the video like AwesomeNativeRenderer of Awesomeplayer works fine for resolutions till 480p but for 720p it returns with error

07-25 17:26:16.549: E/OMXCodec(1454): [OMX.ittiam.video.decoder.avc] dequeued unrecognized buffer: 0xe8078c

If I do not use native window to pass buffers it comes fine (with out passing the native window to the omxcodec).
I have tried it in Motorola xoom device with android 4.0.4 where it works fine.

  1. Is that a problem with the hardware or else is there a way to get through it ??..
  2. Or is there any other way to use the AwesomeNaiveRenderer other than by passing the native window to the omx codec ??

Any help will be appreciated......

Kevin K
  • 589
  • 2
  • 7
  • 28
  • 1
    Can you please check if the `Surface` or `NativeWindow` passed is accurate? The decoder configures the native window here: http://androidxref.com/4.0.4/xref/frameworks/base/media/libstagefright/OMXCodec.cpp#1845 . If this is successful, then please print out the native window handles at http://androidxref.com/4.0.4/xref/frameworks/base/media/libstagefright/OMXCodec.cpp#1939 . The issue could be that the handle dequeued from `SurfaceTexture` is not matching the one returned by decoder. Please check if there is a potential overwrite of handle values. – Ganesh Jul 28 '14 at 05:29
  • @Ganesh Thanks for your reply. But I don't have the source code specific to this device(karbonn A9+). When I explored I found that they do not publish their source code. Then how can I modify The omxCodec.cpp. (Once tried to replace the libstagefright.so with the one of AOSP but the device did not reboot again then I had to load a new system.img). And the same code works fine for 480p in the same device but with qualcomm decoder. – Kevin K Jul 28 '14 at 06:10
  • 1
    Did you try the same stream with the command line executable, `stagefright`? This exercises the decoder in the same fashion as normal playback except that the frames are not rendered. If this is successful, you could then debug further to localize the issue to be related to the `Surface` passed by you. – Ganesh Jul 28 '14 at 06:50
  • @Ganesh How can I run the commandline executable stagefright – Kevin K Jul 28 '14 at 08:50
  • Please check this link: http://stackoverflow.com/questions/16128960/access-stagefright-so-directly-to-decode-h-264-stream-from-jnilayer-in-android . The same is applicable for `ICS 4.0.4` also. Please check `frameworks/base/cmds/..` for more information – Ganesh Jul 28 '14 at 09:07
  • @Ganesh Can I use two native windows one for the decoder and one for the native_renderer by getting it from two surface objects. I was going through your comment to this [question](http://stackoverflow.com/questions/17960268/native-window-queuebuffer-function-not-rendering-output-from-stagefright-decoder/18261499#18261499). Is it a right approach. I just ttried it but getting **08-04 18:22:13.869: E/SurfaceTextureClient(4846): getSlotFromBufferLocked: unknown buffer: 0x7d8408** this error. – Kevin K Aug 04 '14 at 12:53
  • 1
    I didn't get your idea. Isn't the decoder output supposed to go to the renderer? Hence, they should be employing the same native window.. `SurfaceFlinger` can handle multiple windows, but for a decoder only one native window would be required.I think you should try and use the same native window and share any logs for me to help – Ganesh Aug 07 '14 at 08:19
  • @Ganesh is there something else that I can try with surface to get it run in my device at 720p. I passed the java surface(got from the surfaceView) as parameter and in jni I called ANativeWindow_fromSurface(env, jsurface); to obtain the native window. And this native window is passed to the omxcodec and the nativerenderer. – Kevin K Aug 12 '14 at 09:11

0 Answers0