OMX Decoder Insufficient resources Issue

最近在gstreamer播放h264编码的多媒体文件时,偶尔会遇到OMX解码器返回 Insufficient resources 的问题。

Gstreamer层的log大致如下:

19:14:21.590  5258  5409 D SKGST: ERROR omx gstomx.c:586:EventHandler:<omxh264dec-omxh264dec15>  -> avcdec got error: Insufficient resources (0x80001000)

19:14:21.590  5258  5410 D SKGST: ERROR omx gstomx.c:299:gst_omx_component_handle_messages:<omxh264dec-omxh264dec15>  -> avcdec got error: Insufficient resources (0x80001000)

19:14:21.590  5258  5410 D SKGST: ERROR omx gstomx.c:1301:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec15>  -> Component avcdec is in error state: Insufficient resources

19:14:21.590  5258  5410 D SKGST: ERROR omxvideodec gstomxvideodec.c:1738:gst_omx_video_dec_loop:<omxh264dec-omxh264dec15>  -> gst_omx_port_acquire_buffer return GST_OMX_ACQUIRE_BUFFER_ERROR

19:14:21.590  5258  5378 D SKGST: ERROR omx gstomx.c:1301:gst_omx_port_acquire_buffer:<omxh264dec-omxh264dec15>  -> Component avcdec is in error state: Insufficient resources

19:14:21.590  5258  5378 D SKGST: WARN omxvideodec gstomxvideodec.c:3108:gst_omx_video_dec_handle_frame:<omxh264dec-omxh264dec15>  -> error: OpenMAX component in error state Insufficient resources (0x80001000)

19:14:21.590  5258  5410 D SKGST: WARN omxvideodec gstomxvideodec.c:2106:gst_omx_video_dec_loop:<omxh264dec-omxh264dec15>  -> error: OpenMAX component in error state Insufficient resources (0x80001000)

OMX层log如下

[VDEC-1]---------------VIDEO INITIAL INFO-----------------
[VDEC-1] High Profile
[VDEC-1] Level_4.0
[VDEC-1] frame_mbs_only_flag : 1
[VDEC-1] Aspect Ratio [1]
[VDEC-1] H.264 Profile:100 Level:40 FrameMbsOnlyFlag:1
[VDEC-1] aspect_ratio_idc :1
[VDEC-1] Dec InitialInfo => m_iPicWidth: 1920 m_iPicHeight: 1088 frameRate: 50.00 frRes: 50 frDiv: 1
[VDEC-1] ---------------------------------------------------
[COMM-1] common-Info 1920 - 0 - 0, 1088 - 0 - 8, inter(1)/mjpgFmt(0)
[VDEC-1] slice_buf_addr = 0x8b600000, 0x180000
[VDEC-1] FrameBufDelay 2, MinFrameBufferCount 7
[VDEC-1] Not enough memory for VPU frame buffer, Available[0], Min[7], Need[11], min_size = 3761152
[6101][VDEC_ERROR] [OP: VDEC_DEC_SEQ_HEADER] [RET_CODE: -20000]
[6111][ERROR] Sequence header init failed (INIT-CNT: 1 / 300)
[6976][ERROR] ErrorProcess() - [VDEC_ERROR] Not enough memory (code: -20000)

从log来看,是OMX decoder检测到内存不足。仔细检测了代码流程和log。
发现原因是自己之前给APP层提供了一个GetMediaInfo类型的API,帮助APP获取一些多媒体相关的信息。而其实现是使用了 gst_discoverer 对象的相关这个API,gst_discoverer 对象实现的方式也是通过创建一个pipeline并运行来实现其功能的。
APP在使用的时候,每次都是启动用我播放的pipeline,然后紧接着调用这个GetMediaInfoAPI,这样就导致两个pipeline产生了资源冲突的问题(OMX videodec的内存资源)。
由于gst_discoverer的pipeline运行时间比较短,导致该问题只是几率性发生。

最后,通过增加媒体层API间的同步和调整APP调用逻辑,该问题得到解决。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值