How to know all frames are deocded of capture plane?

How to know if all packets are decoded in video decoder(multimedia api - nvdec)?
I can get its eos from output_plane with bytesued = 0. But I have not found any method to know the eos from capture_plane if use DMA memory type. Because bytesuse is always 123 from v4l2_buf on capture_plane even if qbuffer with bytesused = 0.

Once you get EoS in output_plane, it indicates all decoded frames are sent out in capture_plane and you can exit loop of capture_plane. Please check how ctx.got_eos works in 00_video_decode.