The queue needs to track each frame/packet's stream index, this is achieved by maintaining a parallel AVFifo instance for that purpose. This is simpler than implementing custom AVContainerFifo callbacks.
It is similar to AVThreadMessageQueue, but supports multiple streams, each with its own EOF state.