Each zero-copy import made a video-processing context of its own, on its
strips' surfaces, and a driver's first run on a new context costs it a few
milliseconds its later runs do not. A guest's decoder makes a new pool of
buffers for each stream, so each stream's start paid that on the decode
thread once a buffer: on the Radeon 780M (radeonsi, Mesa 26.2.6), 43 new
imports over three streams in Safari issued their first run in 5.3 ms at
the median, against 94 us on a context of their size that another import
had already run on.
The imports of a frame size now share one context, made on no surface with
the size's first import and destroyed with its last: the table of contexts
holds weak references only, so a context holds no memory past the imports
that use it. One import's runs are issued on it at a time. The import check
keeps a context of its own.
The new ignored test checks that two imports of a size share a context, that
another size gets another, that each run writes what its frame decoded, and
that the context goes with the size's last import and a new one is made for
the next.