From e64924f4d385a53c94f5b884be10d8d56a2f73a9 Mon Sep 17 00:00:00 2001 From: crobibero Date: Mon, 3 Aug 2020 14:42:46 -0600 Subject: actually remove MediaBrowser.Api --- .../Playback/Hls/HlsCodecStringFactory.cs | 126 --------------------- 1 file changed, 126 deletions(-) delete mode 100644 MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs (limited to 'MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs') diff --git a/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs b/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs deleted file mode 100644 index 3bbb77a65e..0000000000 --- a/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Text; - - -namespace MediaBrowser.Api.Playback -{ - /// - /// Get various codec strings for use in HLS playlists. - /// - static class HlsCodecStringFactory - { - - /// - /// Gets a MP3 codec string. - /// - /// MP3 codec string. - public static string GetMP3String() - { - return "mp4a.40.34"; - } - - /// - /// Gets an AAC codec string. - /// - /// AAC profile. - /// AAC codec string. - public static string GetAACString(string profile) - { - StringBuilder result = new StringBuilder("mp4a", 9); - - if (string.Equals(profile, "HE", StringComparison.OrdinalIgnoreCase)) - { - result.Append(".40.5"); - } - else - { - // Default to LC if profile is invalid - result.Append(".40.2"); - } - - return result.ToString(); - } - - /// - /// Gets a H.264 codec string. - /// - /// H.264 profile. - /// H.264 level. - /// H.264 string. - public static string GetH264String(string profile, int level) - { - StringBuilder result = new StringBuilder("avc1", 11); - - if (string.Equals(profile, "high", StringComparison.OrdinalIgnoreCase)) - { - result.Append(".6400"); - } - else if (string.Equals(profile, "main", StringComparison.OrdinalIgnoreCase)) - { - result.Append(".4D40"); - } - else if (string.Equals(profile, "baseline", StringComparison.OrdinalIgnoreCase)) - { - result.Append(".42E0"); - } - else - { - // Default to constrained baseline if profile is invalid - result.Append(".4240"); - } - - string levelHex = level.ToString("X2"); - result.Append(levelHex); - - return result.ToString(); - } - - /// - /// Gets a H.265 codec string. - /// - /// H.265 profile. - /// H.265 level. - /// H.265 string. - public static string GetH265String(string profile, int level) - { - // The h265 syntax is a bit of a mystery at the time this comment was written. - // This is what I've found through various sources: - // FORMAT: [codecTag].[profile].[constraint?].L[level * 30].[UNKNOWN] - StringBuilder result = new StringBuilder("hev1", 16); - - if (string.Equals(profile, "main10", StringComparison.OrdinalIgnoreCase)) - { - result.Append(".2.6"); - } - else - { - // Default to main if profile is invalid - result.Append(".1.6"); - } - - result.Append(".L") - .Append(level * 3) - .Append(".B0"); - - return result.ToString(); - } - - /// - /// Gets an AC-3 codec string. - /// - /// AC-3 codec string. - public static string GetAC3String() - { - return "mp4a.a5"; - } - - /// - /// Gets an E-AC-3 codec string. - /// - /// E-AC-3 codec string. - public static string GetEAC3String() - { - return "mp4a.a6"; - } - } -} -- cgit v1.2.3