I'm trying to decode a h.264 stream using Windows Media Foundation. I'm slowly wading through the API, and one thing I cannot seem to figure out is how to know when the IMFTransform is finished using a IMFTransform provided by ProcessInput. The documentation says "the MFT stores the sample and holds a reference count on the IMFSample pointer." Ignoring the fact that this is absolutely horrendous, how are you supposed to determine when it's actually done, given that you cannot get the reference count of a com_ptr so far as I am aware. You can technically call AddRef and the Release, using what Release returns, but per the documentation the value returned is meant to be used for "testing purposes only". So what is the correct way of determining this?

0 Answers