<div dir="ltr"><div>hi, all... I try to use hw decoder by libstagefright with Android but so many mistakes frustrate me. I play ipcam rtsp stream with ffmpeg and I refer to the following tutorial:</div><div>        <a href="https://vec.io/posts/use-android-hardware-decoder-with-omxcodec-in-ndk">https://vec.io/posts/use-android-hardware-decoder-with-omxcodec-in-ndk</a></div>
<div>It will check extradata[0] first as following, but the extradata[0] for ipcam rtsp stream is 0 instead of 1. If I commit the "if statement", OMXCodec tells me the error message "Malformed AVC codec specific data." when I call OMXCodec::Create().</div>
<div>    if (mVideoTrack->extradata[0] == 1) {</div><div>        mFormat->setData(kKeyAVCC, kTypeAVCC, mVideoTrack->extradata, mVideoTrack->extradata_size);</div><div>    }</div><div>As far as I know that the extradata will store the sprop-parameter-sets comes from sdp protocol. But I don't know why it checks the extradata[0] and whether it's necessary. Can you please give me any instruction? Thanks.</div>
</div>