示例#1
0
 static bool PropSuccess(MediaProperties props)
 {
     if (props.Type == MediaType.NotSupported)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
示例#2
0
        public static MediaProperties Parse(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (!stream.CanSeek)
            {
                throw new ArgumentException("Stream must be seekable.");
            }

            foreach (var f in mediaDispatch)
            {
                stream.Position = 0;
                MediaProperties props = f(stream);

                if (PropSuccess(props))
                {
                    return(props);
                }
            }

            return(new MediaProperties());
        }