To use the HW decoder in android via libstagefright, what to set for kKeyAVCC in the metadata to decode the base base instead of playing MP4?

I am trying to use libstagefright to decode h264 compressed frames. I don't have an MP4 file, instead I want to decode frame by frame. I studied the sample from the link. This example uses ffmpeg to parse the mp4 file. and using ffmpeg avcodeccontext, it installs and finds the required metadata. Now I want to set kKeyAVCC, kKeyWidth, kKeyHeight, kKeyIsSyncFrame and kKeyTime. I do not know about each of these parameters. So, all I want to know is to set all these parameters? What is the purpose of these parameters and what to set them for metadata for frame decoding. When I do not set kKeyTime, omxcodec crashes when reading mediabuffer. And if I get success while working with reading, I do not get the metadata value that I set in the reading method from MediaBuffer. I get a video frame dimesiones and error code INFO_FORMAT_CHANGED.

+5
source share
1 answer

, OMXCodec::Create. , MetaData, vanilla android.

, AwesomePlayer::initVideoDecoder, mVideoTrack->getFormat() . , MediaBuffer, .

configureCodec. OMXCodec .

kKeyAVCC Codec Specific Data csd, SPS PPS H.264.

kKeyWidth kKeyHeight width height . . , colorFormat , kKeyColorFormat.

openmax. OMXCodec::read, .

OMXCodec::drainInputBuffer, MediaBuffer ( ). MediaBuffer , input port OMX. timestamp . kKeyTime, MediaBuffer.

, , MediaBuffer, , timestamp , .

kKeyIsSyncFrame. Encoder FillBufferDone, .. , IDR frame, . .

OMXCodec, .

P.S. Android Stagefright, - . , .

+9

All Articles