What platform are you using?
1) Usually the easiest way to get output buffer dump is to do it in vendor OMX IL (in every vendor impl which I worked there were ready functions/macros to do it)
2) If not you should try to dump buffer in ACodec onFillBufferDone
(you need to differentiate between audio/video) or onOutputBufferDrained
, you must get mGraphicBuffer
and get from it raw buffer - encapsulation is platform dependent eg for qc it would be
void const *buf = (void const*)((private_handle_t*)(info->mGraphicBuffer->handle))->base;
Assuming that info is (in ACodec::onOutputBufferDrained)
BufferInfo *info =
mCodec->findBufferByID(kPortIndexOutput, bufferID, &index);
In OMXCodec case you can make the same at the end of OMXCodec::read
Returned buf just save into the file, size to be written will be WxHxPixelRatio.