Memory allocation // MFX_ERR_UNSUPPORTED while decoding frames
I'm trying to set up a decoding application using the Intel Media SDK. As for now, I will use the software implementation to decode a h264 stream.
I have 2 questions :
UsingMFXVideoCore_SetFrameAllocator andMFXVideoCore_SetBufferAllocator just after invoking MFX_Init(), I set up callback to manager externally memory allocations. According to the documentation, the frame allocator's Alloc callback should be called once during MFXVideoDECODE_Init call. This is not the case for me... I never run into these functions. I use MFX_IOPATTERN_OUT_SYSTEM_MEMORY as IOPattern parameter (but usingMFX_IOPATTERN_OUT_VIDEO_MEMORY leads to the same behaviour)
TheMFXVideoDECODE_Init returns MFX_ERR_NONE, but I can't go further : the first call to MFXVideoDECODE_DecodeFrameAsync returns -3 (MFX_ERR_UNSUPPORTED). Since headers decoding went well, I do not see what feature is not supported here...
I do not think these issues are linked : I have the second issue even if I use default allocators.
Overall I suggest you check out the Media SDK "sample_decode" sample. The sample provides details on how to setup the decode pipeline including how to allocate D3D or system memory surfaces. Please also verify if you can decode your stream using the sample.
1) I suspect that the reason for allocation failure is something missing in the setup of the buffers.
2) DecodeFrameAsync could fail in many ways, for instance if the stream is corrupted. If you are still having issue after trying the sample then, if you can, please provide the stream so we can take a look at it.
I solved my DecodeFrameAsync issue. However, regarding my first issue, the problem was not an allocation failure : In fact, no call to frame allocator callbacks are performed by decoder at all. In the decoder sample, frame allocator callback are explicitly called by the user (and not by the decoder).In my opinion, it make sense since I provide buffers to the decoder, but I just want to be sure I do not miss any important point here.