Switching Element
This is an element which provides switching capabilities. It provides the data that is received from other, upstream, elements, and it can switch between data provided by these. The way it switches depends on an associated [ElementPolicy policy].
As an example, consider a situation in which one would like to mix a live stream (obtained, say from an HttpClientElement), with some files, obtained from a FileElement.
Also, it is a good idea to have a SwitchingElement as an intermediary in a pipeline that has some possibly disconnecting elements in the upstream (like an HttpServerElement, which emits an End-Of-Stream marker upon client disconnection). Having a SwitchingElement can provide a retry on the media or switching to a different one (depending on the policy), so the downstream consumers, like the clients, will not get the EOS in the middle of a live stream (for example).
Parameters:
- string policy_name_
- name of a valid, created, ElementPolicy, which determines how we can switch between media sources.
- string media_type_
- expected media type to be received (one of 'aac', 'mp3', 'flv', 'raw')
