core/adaptivedemux2: Add support for Stream Variants
If a certain elementary stream can be provided as different "qualities", there is currently no way:
- To inform other users of those
- To be able to select them
A typical example are the variants of HLS/DASH GstStream, where they are currently exposed as a single GstStream
but:
- They can have different bitrate
- They can have different resolution
- They could even have different codecs
The provider (adaptivedemux2
for ex) will decide which of those variants it will be pushing.
A simple API addition to support those use-cases would be to:
- keep backwards-compatibility by using that "top-level" generic
GstStream
- add to that
GstStream
the list of "variant"GstStream
Ex (pseudo-code):
videostream = gst_stream_new("main video", GST_TYPE_VIDEO, ...);
stream240 = gst_stream_new("240 quality", GST_TYPE_VIDEO, bitrate=..., caps=240p caps, ...);
gst_stream_add_variant(videostream, stream240);
/* ... add more variants ... */
gst_stream_collection_add_stream (collection, videostream);
The fact there are "variants" is invisible to everyone, except for those who want to choose a specific variant by querying whether a GstStream
has variants and then can do stream selection using the variant stream-id instead of the top-level stream-id.