Given generateKeyFrame is called either from sender or transformer, we need to hop to the right task source to resolve promises in either case.
It is also unclear whether the pendingTask set is manipulated from the worker scope and in parallel (encoder steps).
We should tighten the spec there.
We probably want to coalesce generateKeyFrame from sender and transformer.