EncodeFrameAsync - MFX_ERR_NULL_PTR

EncodeFrameAsync - MFX_ERR_NULL_PTR

sts = mfxENC->EncodeFrameAsync(NULL, YUVFrame, &mfxBS, &syncp);

So, for some reason I am getting sts returned with a -2, meaning MFX_ERR_NULL_PTR.

YUVFrame is not null and everything has been filled in

mfxBS does have some null parts to it, such as Data, but that's because EncodeFrameAsync is supposed to fill in mfxBS, right?

And syncp is also null but again, it's supposed to be set by EncodeFrameAsync, right?


Any idea why I could be suddenly getting this error, this was working until I changed a couple things, can't remember much changing these parameters though.  Thanks.



4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Actually I figured it out.. sort of, ((*YUVFrame).Data).A  is null, therefore it is failing.. so I'm current question is, why when I call sts = mfxAllocator.Lock(mfxAllocator.pthis, pmfxSurfaces[nEncSurfIdx]->Data.MemId, &(pmfxSurfaces[nEncSurfIdx]->Data));, YUV are all set to be non-null but A is not?


I'm calling simple_lock as the locking function, and it goes into this block of code, which does not set A:

if(D3DFMT_NV12 == desc.Format)
        ptr->Pitch    = (mfxU16)locked.Pitch;
        ptr->Y        = (mfxU8 *)locked.pBits;
        ptr->U        = (mfxU8 *)locked.pBits + desc.Height * locked.Pitch;
        ptr->V        = ptr->U + 1;

And it doesn't seem like it should need to set A, it was working before and then suddenly stopped.. I can always just set it anyway I guess.

Best Reply

Or not...  wait.. figured it out mostly, it was working the first time through, then I passed a reference of mfxBS out of the library and blanked out data.. anyway should be able to figure this out.


Also, figured this one out on my own, but for future reference, anyway to get faster support for the Media SDK library?  Maybe paying some small amount?  I appreciate that you guys are answering question and I always get back professional, helpful answers but potentially waiting a couple days for an answer is a long time when working 9 hours a day trying to figure this stuff out on my own if I don't hear back.

Very glad you were able to figure this out on your own.  In general the samples and tutorials are intended as places to go to figure out how to get applications working.  One advantage of a public forum is that the entire community is encouraged to reply.  We try our best to respond as quickly as possible and keep waiting time to a minimum but at this point there isn't an option to guarantee a maximum time to respond.  However, this feedback could be helpful for future planning.

Leave a Comment

Please sign in to add a comment. Not a member? Join today