EncodedImage::SpatialIndex() is supposed to refer to the spatial index of an encoded image. Seems pretty self-explanatory?
But historically, when simulcast was used, the very same method would return the simulcast index instead. In practise this meant "if VP8 or H264, return simulcast index, else if VP9 or AV1, return spatial index". A consequence of this, other than confusion and unnecessary gating logic on codec type, is that it is not currently possible to do
VP9 simulcast or possibly other combinations of
scalability modes.
To fix this and unblock new use cases, EncodedImage::SimulcastIndex() and SetSimulcastIndex() were recently added. To allow dependencies to migrate from SpatialIndex() to SimulcastIndex() where necessary, this method temporarily also returns SpatialIndex() if not set, as a fallback logic to support old code.
Next week, the fallback logic will be removed and SimulcastIndex() will always refer to the simulcast index and SpatialIndex() will always refer to the spatial index. CL
here. Apps that depend on the assumption that SpatialIndex()/SetSpatialIndex() refers to the simulcast index should update.