0

everyone is know that the struct of "OMX_BUFFERHEADERTYPE" carry data buffer. The field "pBuffer" point to data buffer ,and the "nFilledLen" means number of bytes currently in the buffer. I try to dump yuvdata from "OnFillBufferDone()" in "OMX.cpp" , but the data dumped was corrupt and incomplete. the code as the following:

OMX_ERRORTYPE OMX::OnFillBufferDone(
    node_id node, buffer_id buffer, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer) {
ALOGV("OnFillBufferDone buffer=%p", pBuffer);

omx_message msg;
msg.type = omx_message::FILL_BUFFER_DONE;
msg.node = node;
msg.u.extended_buffer_data.buffer = buffer;
msg.u.extended_buffer_data.range_offset = pBuffer->nOffset;
msg.u.extended_buffer_data.range_length = pBuffer->nFilledLen;
msg.u.extended_buffer_data.flags = pBuffer->nFlags;
msg.u.extended_buffer_data.timestamp = pBuffer->nTimeStamp;
//dump date code
if(pBuffer->nFilledLen>0) {
FILE *fp=NULL;
fp=fopen("/data/video.yuv","a+");
if(fp) {
    fwrite((unsigned char *)pBuffer->pBuffer,1,pBuffer->nFilledLen,fp);
    fclose(fp);
}else {
    ALOGE(" catch data is failure");
}/*...*/}}}

Is wrong that the method dumping yuv data ?

Can you tell me how to dump yuv ? Thanks!!!!

SMART mr
  • 1
  • 2
  • Is there a reason why you want to dump it in OMX.cpp? Here is similar topic but solved in ACodec/OMXCodec http://stackoverflow.com/questions/21717728/how-to-dump-yuv-from-omxcodec-decoding-output/21729549#21729549 – Ryszard Grzesica May 02 '16 at 08:36
  • @ Ryszard Grzesica Thank you very much! – SMART mr May 08 '16 at 05:04
  • Thank you very very very very ... much. I've been wondering why I failed. it is ignored that I need to distinguish between audio or video data. – SMART mr May 08 '16 at 05:13

0 Answers0