Beispiel #1
0
        /// <summary>
        /// Gets all video qualities available in a <see cref="MediaStreamInfoSet"/>.
        /// </summary>
        public static IEnumerable <VideoQuality> GetAllVideoQualities(this MediaStreamInfoSet streamInfoSet)
        {
            streamInfoSet.GuardNotNull(nameof(streamInfoSet));

            var qualities = new HashSet <VideoQuality>();

            foreach (var streamInfo in streamInfoSet.Muxed)
            {
                qualities.Add(streamInfo.VideoQuality);
            }
            foreach (var streamInfo in streamInfoSet.Video)
            {
                qualities.Add(streamInfo.VideoQuality);
            }

            return(qualities);
        }
Beispiel #2
0
        /// <summary>
        /// Gets all available media stream infos in a <see cref="MediaStreamInfoSet"/>.
        /// </summary>
        public static IEnumerable <MediaStreamInfo> GetAll(this MediaStreamInfoSet streamInfoSet)
        {
            streamInfoSet.GuardNotNull(nameof(streamInfoSet));

            foreach (var streamInfo in streamInfoSet.Muxed)
            {
                yield return(streamInfo);
            }
            foreach (var streamInfo in streamInfoSet.Audio)
            {
                yield return(streamInfo);
            }
            foreach (var streamInfo in streamInfoSet.Video)
            {
                yield return(streamInfo);
            }
        }