简体   繁体   English

OMX.qcom编码器随机崩溃

[英]OMX.qcom encoder random crash

The app is based on Grafika's camera capture activity ( https://github.com/google/grafika/tree/master/src/com/android/grafika ). 该应用程序基于Grafika的相机捕捉活动( https://github.com/google/grafika/tree/master/src/com/android/grafika )。 The user taps on a button to record a video. 用户点击按钮以录制视频。 A random crash is happening on Nexus 5x. Nexus 5x发生随机崩溃。 Posted below are 2 logs of when it is working and when it is not. 下面发布的是它工作时和不工作时的2个日志。 Please tell me what might be the cause of this crash and if you need me to post any part of the code. 请告诉我这次崩溃的原因可能是什么,如果你需要我发布代码的任何部分。

Working: 工作:

11-21 15:55:22.301 26556-27085/com.testvideo I/OMXClient: MuxOMX ctor
11-21 15:55:22.505 26556-27085/com.testvideo E/ACodec: [OMX.qcom.video.encoder.avc] storeMetaDataInBuffers (output) failed w/ err -1010
11-21 15:55:22.505 26556-27085/com.testvideo W/ACodec: do not know color format 0x7fa30c04 = 2141391876
11-21 15:55:22.506 26556-27085/com.testvideo W/ACodec: do not know color format 0x7f000789 = 2130708361
11-21 15:55:22.518 26556-27085/com.testvideo I/ACodec: setupAVCEncoderParameters with [profile: Baseline] [level: Level31]
11-21 15:55:22.520 26556-27085/com.testvideo I/ACodec: [OMX.qcom.video.encoder.avc] cannot encode color aspects. Ignoring.
11-21 15:55:22.520 26556-27085/com.testvideo I/ACodec: [OMX.qcom.video.encoder.avc] cannot encode HDR static metadata. Ignoring.
11-21 15:55:22.520 26556-27085/com.testvideo I/ACodec: setupVideoEncoder succeeded
11-21 15:55:22.523 26556-27085/com.testvideo W/ACodec: do not know color format 0x7f000789 = 2130708361
11-21 15:55:22.586 26556-27082/com.testvideo D/Grafika: EGLContext created, client version 3
11-21 15:55:22.632 26556-27085/com.testvideo D/ACodec: dataspace changed to 0x10c10000 (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) (R:2(Limited), S:1(BT709), T:3(SMPTE_170M))
11-21 15:55:22.698 26556-27082/com.testvideo I/MPEG4Writer: limits: 4294967295/0 bytes/us, bit rate: -1 bps and the estimated moov size 3193 bytes
11-21 15:55:22.721 26556-27098/com.testvideo I/MPEG4Writer: setStartTimestampUs: 0
11-21 15:55:22.721 26556-27098/com.testvideo I/MPEG4Writer: Earliest track starting time: 0
11-21 15:55:31.394 26556-26667/com.testvideo W/OpenGLRenderer: Incorrectly called buildLayer on View: LinearLayout, destroying layer...

When Crash occurs: 发生崩溃时:

11-21 15:28:09.401 526-3443/? I/MediaPlayerService: MediaPlayerService::getOMX
11-21 15:28:09.405 26648-9812/com.testvideo I/OMXClient: MuxOMX ctor
11-21 15:28:09.408 519-15317/? I/OMXMaster: makeComponentInstance(OMX.qcom.video.encoder.avc) in mediacodec process
11-21 15:28:09.432 26648-9374/com.testvideo W/TestVideo.CSR: Waiting for movie encoder to finish before drawing frame
11-21 15:28:09.583 519-15317/? E/OMX-VENC: Setting session priority failed
11-21 15:28:09.586 537-9463/? E/mm-camera-sensor: port_sensor_handle_aec_update:443miss aec update window, skip
11-21 15:28:09.640 519-15317/? I/OMX-VENC: Component_init : OMX.qcom.video.encoder.avc : return = 0x0
11-21 15:28:09.644 519-8957/? E/OMX-VENC: set_parameter: metamode is valid for input port only
11-21 15:28:09.644 519-8957/? W/OMXNodeInstance: [207006a:qcom.encoder.avc] component does not support metadata mode; using fallback
11-21 15:28:09.644 26648-9812/com.testvideo E/ACodec: [OMX.qcom.video.encoder.avc] storeMetaDataInBuffers (output) failed w/ err -1010
11-21 15:28:09.645 26648-9812/com.testvideo W/ACodec: do not know color format 0x7fa30c04 = 2141391876
11-21 15:28:09.645 26648-9812/com.testvideo W/ACodec: do not know color format 0x7f000789 = 2130708361
11-21 15:28:09.654 26648-9812/com.testvideo I/ACodec: setupAVCEncoderParameters with [profile: Baseline] [level: Level31]
11-21 15:28:09.655 26648-9812/com.testvideo I/ACodec: [OMX.qcom.video.encoder.avc] cannot encode color aspects. Ignoring.
11-21 15:28:09.655 26648-9812/com.testvideo I/ACodec: [OMX.qcom.video.encoder.avc] cannot encode HDR static metadata. Ignoring.
11-21 15:28:09.655 26648-9812/com.testvideo I/ACodec: setupVideoEncoder succeeded
11-21 15:28:09.658 26648-9812/com.testvideo W/ACodec: do not know color format 0x7f000789 = 2130708361
11-21 15:28:09.668 519-15317/? D/GraphicBufferSource: setting dataspace: 0x104
11-21 15:28:09.669 519-3849/? E/OMXNodeInstance: getParameter(207006a:qcom.encoder.avc, ParamConsumerUsageBits(0x6f800004)) ERROR: UnsupportedIndex(0x8000101a)
11-21 15:28:09.669 519-3674/? D/GraphicBufferSource: requesting color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M))

I have been encountered a similar question, not sure if it is the same. 我遇到过类似的问题,不确定它是否相同。

When it is working, it should come out with the fallowing log information. 当它工作时,它应该与退出的日志信息一起出来。

D/ACodec: dataspace changed to 0x10c10000 (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) (R:2(Limited), S:1(BT709), T:3(SMPTE_170M))

So the encoder could receive the status of buffer at initialization phase. 因此编码器可以在初始化阶段接收缓冲区的状态。

encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED

In my program, the OnframeAvailable function and the render thread have been locked at the same time and no longer been able to notify each other at the start of recording initialization. 在我的程序中,OnframeAvailable函数和渲染线程已同时被锁定,并且在记录初始化开始时不再能够相互通知。 Since the OnframeAvailable function has been stuck, the buffer could not be updated. 由于OnframeAvailable函数已被卡住,因此无法更新缓冲区。 As the result, the MeidaCodec never get the INFO_OUTPUT_FORMAT_CHANGED status. 结果,MeidaCodec永远不会获得INFO_OUTPUT_FORMAT_CHANGED状态。

Check if the frameAvailable() or frameAvailableSoon() is keeping update when recording start. 在录制开始时检查frameAvailable()或frameAvailableSoon()是否保持更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM