8

使用 MediaCodec,很多时候错误消息来自 OMX 层。如何使用它们来帮助调试不那么微不足道的问题?例如,我有一个应用程序有时无法创建用于解码 h264 流的编解码器。它似乎只发生在三星 S4 (I9505) 等某些设备上,而不会发生在 S3、Nexus 4(旧)上。在大多数情况下,相同的视频在 S4 上都能很好地解码。在创建编解码器之前,有一些密集的计算,包括 OpeGL 的东西。它失败的行是:

MediaCodec.createByCodecName(codecInfo[0].getName());

在logcatcodecInfo[0].getName()中具有值OMX.qcom.video.decoder.avc和以下输出:

06-23 19:12:18.197: I/OMXClient(23749): Using client-side OMX mux.
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): In OMX vdec Constructor
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): vidc.dec.debug.ts value is 0
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): vidc.dec.debug.concealedmb value is 0
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): vidc.dec.debug.extradata value is 0
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): Successfully opened vdec ion devicefd = 35
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): Successfully created vdec ionlock
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): Vdec instances = 1, ion device fd = 35
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): omx_vdec::component_init(): Start of New Playback : role  = OMX.qcom.video.decoder.avc : DEVICE = /dev/msm_vidc_dec
06-23 19:12:18.197: D/STATUSBAR-NetworkController(1111): updateDataNetType()
06-23 19:12:18.197: D/STATUSBAR-NetworkController(1111): Nothing, mRoamingIconId = 0
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): omx_vdec::component_init(): Open returned fd 36, errno 24
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): component_init: current performance level = 0 
06-23 19:12:18.227: E/OMX-VDEC-1080P(282):  pipe creation failed.
06-23 19:12:18.227: E/OMX-VDEC-1080P(282):  Component Init Failed
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): Calling VDEC_IOCTL_STOP_NEXT_MSG
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): In OMX Vdec Destructor(), Vdec instances = 1
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): Calling close() on Video Driver
06-23 19:12:18.247: E/OMX-VDEC-1080P(282): Calling close() on vdec ion devicefd = 35
06-23 19:12:18.247: E/OMX-VDEC-1080P(282): Successfully destroyed vdec ionlock
06-23 19:12:18.247: E/OMX-VDEC-1080P(282): Exit OMX vdec Destructor
06-23 19:12:18.247: E/(282):  Destroy C2D instance
06-23 19:12:18.247: E/(282):  Destroy C2D instance
06-23 19:12:18.247: E/ACodec(23749): Unable to instantiate decoder 'OMX.qcom.video.decoder.avc'.
06-23 19:12:18.247: E/MediaCodec(23749): Codec reported an error. (omx error 0x80001003, internalError -2147483648)

此外,如果它是与设备相关的错误,开发人员可以做些什么来帮助解决问题?

4

0 回答 0