There is a good news, I confirmed that MVD_Services DOES output every frames even a video contains B-frames, BUT in a strange way.
Usually I call these 2 functions for hardware decoding :
C:
mvdstdProcessVideoFrame();
mvdstdRenderVideoFrame();
Because of function name, I thought that I need to use
mvdstdProcessVideoFrame() to process video then call
mvdstdRenderVideoFrame() to get a video frame but it wasn't.
Actually, If videos do
NOT contain b-frames, it always :
(let's say I'm playing a video that shows "0" then "1" then "2" then "3" then "4"... on the screen)
mvdstdProcessVideoFrame() will process video and write output to the buffer. (frame that shows "0")
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
call it again, then
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
(so only 1 output)
and if videos
DO contain b-frames,
(let's say I'm playing a video that shows "0" then "1" then "2" then "3" then "4"... on the screen)
case 1 (same as without b-frames videos)
mvdstdProcessVideoFrame() will process video and write output to the buffer. (frame that shows "0")
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
call it again, then
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
(so only 1 output)
case 2
mvdstdProcessVideoFrame() will process video (only processing, no outputs).
mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "0")
call it again, then
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
(so only 1 output)
case 3
mvdstdProcessVideoFrame() will process video (only processing, no outputs).
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
call it again, then
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
(so no outputs at all)
case 4
mvdstdProcessVideoFrame() will process video (only processing, no outputs).
mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "0")
call it again, then
mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "1")
(so more than 1 outputs)
case 5
mvdstdProcessVideoFrame() will process video and write output to the buffer. (frame that shows "0")
mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "1")
call it again, then
mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "2")
(so more than 1 outputs)
About case 4 and case 5, it seems completely random that how many frames are written.
Maybe related to max B-frames in encoding settings?
But in the same video, sometimes it writes 3 frames but sometimes 2 frames.
(so maybe 2 frames, 3 frames or even 5 frames, no prediction is available)
Finally, the big problem is, no matter it wrote a frame to the buffer or not,
mvdstdProcessVideoFrame() WILL return
MVD_STATUS_FRAMEREADY(0x17003) and no matter it wrote a frame to the buffer or not,
mvdstdRenderVideoFrame() WILL return MVD_STATUS_OK(0x17000) or MVD_STATUS_BUSY(0x17002).
Edit :
So if I play a video that shows "0" then "1" then "2" then "3" then "4"... on the screen, which contains B-frames :
and let's say "case 2 -> case 3 -> case 4" happen, (let's say case 4 writes 2 frames)
then you'll see "0" -> "0" -> "2" on the screen.