|
|
|
@ -17,53 +17,53 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
|
|
|
|
|
private MediaFormatProfile[] ResolveVideoFormatInternal(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "asf"))
|
|
|
|
|
if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
MediaFormatProfile? val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height);
|
|
|
|
|
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "mp4"))
|
|
|
|
|
if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height);
|
|
|
|
|
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "avi"))
|
|
|
|
|
if (string.Equals(container, "avi", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.AVI };
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "mkv"))
|
|
|
|
|
if (string.Equals(container, "mkv", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.MATROSKA };
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ps") ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(container, "ts"))
|
|
|
|
|
if (string.Equals(container, "mpeg2ps", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
string.Equals(container, "ts", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL };
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "mpeg1video"))
|
|
|
|
|
if (string.Equals(container, "mpeg1video", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.MPEG1 };
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ts") ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(container, "mpegts") ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(container, "m2ts"))
|
|
|
|
|
if (string.Equals(container, "mpeg2ts", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
string.Equals(container, "mpegts", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
string.Equals(container, "m2ts", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return ResolveVideoMPEG2TSFormat(videoCodec, audioCodec, width, height, timestampType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "flv"))
|
|
|
|
|
if (string.Equals(container, "flv", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.FLV };
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "wtv"))
|
|
|
|
|
if (string.Equals(container, "wtv", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.WTV };
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "3gp"))
|
|
|
|
|
if (string.Equals(container, "3gp", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec);
|
|
|
|
|
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "ogv") || StringHelper.EqualsIgnoreCase(container, "ogg"))
|
|
|
|
|
if (string.Equals(container, "ogv", StringComparison.OrdinalIgnoreCase) || string.Equals(container, "ogg", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.OGV };
|
|
|
|
|
|
|
|
|
|
return new MediaFormatProfile[] { };
|
|
|
|
@ -89,7 +89,7 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
resolution = "H";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg2video"))
|
|
|
|
|
if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
var list = new List<MediaFormatProfile>();
|
|
|
|
|
|
|
|
|
@ -97,18 +97,18 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));
|
|
|
|
|
list.Add(ValueOf("MPEG_TS_SD_KO" + suffix));
|
|
|
|
|
|
|
|
|
|
if ((timestampType == TransportStreamTimestamp.Valid) && StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
if ((timestampType == TransportStreamTimestamp.Valid) && string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
list.Add(MediaFormatProfile.MPEG_TS_JP_T);
|
|
|
|
|
}
|
|
|
|
|
return list.ToArray();
|
|
|
|
|
}
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264"))
|
|
|
|
|
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "lpcm"))
|
|
|
|
|
if (string.Equals(audioCodec, "lpcm", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_50_LPCM_T };
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts"))
|
|
|
|
|
if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (timestampType == TransportStreamTimestamp.None)
|
|
|
|
|
{
|
|
|
|
@ -117,7 +117,7 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_T };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2"))
|
|
|
|
|
if (string.Equals(audioCodec, "mp2", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (timestampType == TransportStreamTimestamp.None)
|
|
|
|
|
{
|
|
|
|
@ -127,19 +127,19 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_T", resolution)) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) };
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
|
|
|
|
|
if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_MPEG1_L3{1}", resolution, suffix)) };
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
|
|
|
|
|
string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) };
|
|
|
|
|
}
|
|
|
|
|
else if (StringHelper.EqualsIgnoreCase(videoCodec, "vc1"))
|
|
|
|
|
else if (string.Equals(videoCodec, "vc1", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576))
|
|
|
|
|
{
|
|
|
|
@ -147,23 +147,23 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
}
|
|
|
|
|
return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO };
|
|
|
|
|
}
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts"))
|
|
|
|
|
if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
suffix = StringHelper.EqualsIgnoreCase(suffix, "_ISO") ? suffix : "_T";
|
|
|
|
|
suffix = string.Equals(suffix, "_ISO", StringComparison.OrdinalIgnoreCase) ? suffix : "_T";
|
|
|
|
|
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") || StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4"))
|
|
|
|
|
else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) || string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) };
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
|
|
|
|
|
if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) };
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2"))
|
|
|
|
|
if (string.Equals(audioCodec, "mp2", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) };
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
|
|
|
|
|
if (string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -177,16 +177,16 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
|
|
|
|
|
private MediaFormatProfile? ResolveVideoMP4Format(string videoCodec, string audioCodec, int? width, int? height)
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264"))
|
|
|
|
|
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "lpcm"))
|
|
|
|
|
if (string.Equals(audioCodec, "lpcm", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.AVC_MP4_LPCM;
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
|
|
|
|
|
string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.AVC_MP4_MP_SD_AC3;
|
|
|
|
|
}
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
|
|
|
|
|
if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.AVC_MP4_MP_SD_MPEG1_L3;
|
|
|
|
|
}
|
|
|
|
@ -194,41 +194,41 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
{
|
|
|
|
|
if ((width.Value <= 720) && (height.Value <= 576))
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.AVC_MP4_MP_SD_AAC_MULT5;
|
|
|
|
|
}
|
|
|
|
|
else if ((width.Value <= 1280) && (height.Value <= 720))
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.AVC_MP4_MP_HD_720p_AAC;
|
|
|
|
|
}
|
|
|
|
|
else if ((width.Value <= 1920) && (height.Value <= 1080))
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.AVC_MP4_MP_HD_1080i_AAC;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4"))
|
|
|
|
|
else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (width.HasValue && height.HasValue && width.Value <= 720 && height.Value <= 576)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.MPEG4_P2_MP4_ASP_AAC;
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "ac3") || StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
|
|
|
|
|
if (string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase) || string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.MPEG4_P2_MP4_NDSD;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
else if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.MPEG4_P2_MP4_SP_L6_AAC;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (StringHelper.EqualsIgnoreCase(videoCodec, "h263") && StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
else if (string.Equals(videoCodec, "h263", StringComparison.OrdinalIgnoreCase) && string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.MPEG4_H263_MP4_P0_L10_AAC;
|
|
|
|
|
}
|
|
|
|
@ -238,20 +238,20 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
|
|
|
|
|
private MediaFormatProfile? ResolveVideo3GPFormat(string videoCodec, string audioCodec)
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264"))
|
|
|
|
|
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.AVC_3GPP_BL_QCIF15_AAC;
|
|
|
|
|
}
|
|
|
|
|
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4"))
|
|
|
|
|
else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma"))
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AAC;
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(audioCodec, "amrnb"))
|
|
|
|
|
if (string.Equals(audioCodec, "amrnb", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AMR;
|
|
|
|
|
}
|
|
|
|
|
else if (StringHelper.EqualsIgnoreCase(videoCodec, "h263") && StringHelper.EqualsIgnoreCase(audioCodec, "amrnb"))
|
|
|
|
|
else if (string.Equals(videoCodec, "h263", StringComparison.OrdinalIgnoreCase) && string.Equals(audioCodec, "amrnb", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.MPEG4_H263_3GPP_P0_L10_AMR;
|
|
|
|
|
}
|
|
|
|
@ -261,15 +261,15 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
|
|
|
|
|
private MediaFormatProfile? ResolveVideoASFFormat(string videoCodec, string audioCodec, int? width, int? height)
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(videoCodec, "wmv") &&
|
|
|
|
|
(string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma") || StringHelper.EqualsIgnoreCase(videoCodec, "wmapro")))
|
|
|
|
|
if (string.Equals(videoCodec, "wmv", StringComparison.OrdinalIgnoreCase) &&
|
|
|
|
|
(string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase) || string.Equals(videoCodec, "wmapro", StringComparison.OrdinalIgnoreCase)))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (width.HasValue && height.HasValue)
|
|
|
|
|
{
|
|
|
|
|
if ((width.Value <= 720) && (height.Value <= 576))
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma"))
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.WMVMED_FULL;
|
|
|
|
|
}
|
|
|
|
@ -277,14 +277,14 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma"))
|
|
|
|
|
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.WMVHIGH_FULL;
|
|
|
|
|
}
|
|
|
|
|
return MediaFormatProfile.WMVHIGH_PRO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(videoCodec, "vc1"))
|
|
|
|
|
if (string.Equals(videoCodec, "vc1", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (width.HasValue && height.HasValue)
|
|
|
|
|
{
|
|
|
|
@ -296,7 +296,7 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
return MediaFormatProfile.VC1_ASF_AP_L3_WMA;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg2video"))
|
|
|
|
|
else if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return MediaFormatProfile.DVR_MS;
|
|
|
|
|
}
|
|
|
|
@ -306,27 +306,27 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
|
|
|
|
|
public MediaFormatProfile? ResolveAudioFormat(string container, int? bitrate, int? frequency, int? channels)
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "asf"))
|
|
|
|
|
if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return ResolveAudioASFFormat(bitrate);
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "mp3"))
|
|
|
|
|
if (string.Equals(container, "mp3", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.MP3;
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "lpcm"))
|
|
|
|
|
if (string.Equals(container, "lpcm", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return ResolveAudioLPCMFormat(frequency, channels);
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "mp4") ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(container, "aac"))
|
|
|
|
|
if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
string.Equals(container, "aac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return ResolveAudioMP4Format(bitrate);
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "adts"))
|
|
|
|
|
if (string.Equals(container, "adts", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return ResolveAudioADTSFormat(bitrate);
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "flac"))
|
|
|
|
|
if (string.Equals(container, "flac", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.FLAC;
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "oga") ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(container, "ogg"))
|
|
|
|
|
if (string.Equals(container, "oga", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
string.Equals(container, "ogg", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.OGG;
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
@ -388,17 +388,17 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
|
|
|
|
|
public MediaFormatProfile? ResolveImageFormat(string container, int? width, int? height)
|
|
|
|
|
{
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "jpeg") ||
|
|
|
|
|
StringHelper.EqualsIgnoreCase(container, "jpg"))
|
|
|
|
|
if (string.Equals(container, "jpeg", StringComparison.OrdinalIgnoreCase) ||
|
|
|
|
|
string.Equals(container, "jpg", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return ResolveImageJPGFormat(width, height);
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "png"))
|
|
|
|
|
if (string.Equals(container, "png", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return ResolveImagePNGFormat(width, height);
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "gif"))
|
|
|
|
|
if (string.Equals(container, "gif", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.GIF_LRG;
|
|
|
|
|
|
|
|
|
|
if (StringHelper.EqualsIgnoreCase(container, "raw"))
|
|
|
|
|
if (string.Equals(container, "raw", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return MediaFormatProfile.RAW;
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|