Exemplo n.º 1
0
        public void GetAudioCodecName_KnownCodecs_DeterminesGoodCodec(string codecCommonName, string codecId, string format, string expectedCodec)
        {
            // Act
            string result = CodecHelper.GetAudioCodecName(codecCommonName, codecId, format);

            // Assert
            Assert.Equal(expectedCodec, result);
        }
        private static Audio ConvertAudioStream(AudioStream stream)
        {
            Audio audio = new Audio
            {
                Language         = LanguageHelper.GetLanguageCode(stream.miGetString("Language/String")),
                Codec            = CodecHelper.GetAudioCodecName(stream.codecCommonName, stream.codecId, stream.format),
                NumberOfChannels = stream.channels
            };

            return(audio);
        }
        private static Video ConvertVideoStream(VideoStream stream)
        {
            Video video = new Video
            {
                Aspect            = stream.pixelAspectRatio.ToString(CultureInfo.InvariantCulture),
                Codec             = CodecHelper.GetVideoCodecName(stream.codecCommonName, stream.codecId, stream.format),
                DurationInSeconds = stream.duration / 1000,
                Height            = stream.height,
                LongLanguage      = stream.miGetString("Language/String"),
                ScanType          = stream.miGetString("ScanType"),
                Width             = stream.width
            };

            video.Language = LanguageHelper.GetLanguageCode(video.LongLanguage);

            if (video.Aspect == "0")
            {
                video.Aspect = "Unknown";
            }
            return(video);
        }