remove mono compiler directives

This commit is contained in:
Luke Pulverenti
2014-10-06 19:58:46 -04:00
parent a9eed234ba
commit f02f322208
110 changed files with 1398 additions and 919 deletions

View File

@@ -6,6 +6,11 @@ namespace MediaBrowser.Model.ApiClient
public ConnectionState State { get; set; }
public ServerInfo ServerInfo { get; set; }
public IApiClient ApiClient { get; set; }
public ConnectionResult()
{
State = ConnectionState.Unavailable;
}
}
public enum ConnectionState

View File

@@ -175,7 +175,7 @@ namespace MediaBrowser.Model.Configuration
public PeopleMetadataOptions PeopleMetadataOptions { get; set; }
public string[] SecureApps2 { get; set; }
public string[] InsecureApps { get; set; }
public bool SaveMetadataHidden { get; set; }
@@ -226,15 +226,12 @@ namespace MediaBrowser.Model.Configuration
PeopleMetadataOptions = new PeopleMetadataOptions();
SecureApps2 = new[]
InsecureApps = new[]
{
"Dashboard",
"MBKinect",
"NuVue",
"Media Browser Theater",
//"Chrome Companion",
"MB-Classic"
"Roku",
"Chromecast",
"iOS",
"Android"
};
MetadataOptions = new[]

View File

@@ -20,5 +20,19 @@ namespace MediaBrowser.Model.Dlna
{
IsRequired = true;
}
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value)
: this(condition, property, value, false)
{
}
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value, bool isRequired)
{
Condition = condition;
Property = property;
Value = value;
IsRequired = isRequired;
}
}
}

View File

@@ -0,0 +1,134 @@
using System.Xml.Serialization;
namespace MediaBrowser.Model.Dlna.Profiles
{
[XmlRoot("Profile")]
public class AndroidProfile : DefaultProfile
{
public AndroidProfile()
{
Name = "Android";
TranscodingProfiles = new[]
{
new TranscodingProfile
{
Container = "mp3",
AudioCodec = "mp3",
Type = DlnaProfileType.Audio
},
new TranscodingProfile
{
Protocol = "hls",
Container = "ts",
VideoCodec = "h264",
AudioCodec = "aac",
Type = DlnaProfileType.Video,
VideoProfile = "Baseline",
Context = EncodingContext.Streaming
},
new TranscodingProfile
{
Container = "mp4",
VideoCodec = "h264",
AudioCodec = "aac",
Type = DlnaProfileType.Video,
VideoProfile = "Baseline",
Context = EncodingContext.Static
}
};
DirectPlayProfiles = new[]
{
new DirectPlayProfile
{
Container = "mp4",
VideoCodec = "h264,mpeg4",
AudioCodec = "aac",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "mp4,aac",
AudioCodec = "aac",
Type = DlnaProfileType.Audio
},
new DirectPlayProfile
{
Container = "mp3",
AudioCodec = "mp3",
Type = DlnaProfileType.Audio
},
new DirectPlayProfile
{
Container = "flac",
AudioCodec = "flac",
Type = DlnaProfileType.Audio
},
new DirectPlayProfile
{
Container = "ogg",
AudioCodec = "vorbis",
Type = DlnaProfileType.Audio
},
new DirectPlayProfile
{
Container = "jpeg,png,gif,bmp",
Type = DlnaProfileType.Photo
}
};
CodecProfiles = new[]
{
new CodecProfile
{
Type = CodecType.Video,
Conditions = new []
{
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.Width, "1920"),
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.Height, "1080"),
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.VideoBitDepth, "8"),
new ProfileCondition(ProfileConditionType.NotEquals, ProfileConditionValue.IsAnamorphic, "true")
}
},
new CodecProfile
{
Type = CodecType.VideoAudio,
Codec = "aac",
Conditions = new []
{
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioChannels, "2")
}
},
new CodecProfile
{
Type = CodecType.Audio,
Codec = "aac",
Conditions = new []
{
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioChannels, "2")
}
},
new CodecProfile
{
Type = CodecType.Audio,
Codec = "mp3",
Conditions = new []
{
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioChannels, "2"),
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioBitrate, "320000")
}
}
};
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Dlna
{
public class ResolutionNormalizer
{
private static readonly List<ResolutionConfiguration> Configurations =
new List<ResolutionConfiguration>
{
new ResolutionConfiguration(426, 320000),
new ResolutionConfiguration(640, 400000),
new ResolutionConfiguration(720, 950000),
new ResolutionConfiguration(1280, 2500000)
};
public static ResolutionOptions Normalize(int maxBitrate,
string codec,
int? maxWidth,
int? maxHeight)
{
foreach (var config in Configurations)
{
if (maxBitrate <= config.MaxBitrate)
{
var originvalValue = maxWidth;
maxWidth = Math.Min(config.MaxWidth, maxWidth ?? config.MaxWidth);
if (!originvalValue.HasValue || originvalValue.Value != maxWidth.Value)
{
maxHeight = null;
}
break;
}
}
return new ResolutionOptions
{
MaxWidth = maxWidth,
MaxHeight = maxHeight
};
}
}
public class ResolutionConfiguration
{
public int MaxWidth { get; set; }
public int MaxBitrate { get; set; }
public ResolutionConfiguration(int maxWidth, int maxBitrate)
{
MaxWidth = maxWidth;
MaxBitrate = maxBitrate;
}
}
public class ResolutionOptions
{
public int? MaxWidth { get; set; }
public int? MaxHeight { get; set; }
}
}

View File

@@ -86,6 +86,9 @@
<Compile Include="Configuration\XbmcMetadataOptions.cs" />
<Compile Include="Configuration\SubtitlePlaybackMode.cs" />
<Compile Include="Connect\UserLinkType.cs" />
<Compile Include="Dlna\Profiles\AndroidProfile.cs" />
<Compile Include="Dlna\Profiles\DefaultProfile.cs" />
<Compile Include="Dlna\ResolutionNormalizer.cs" />
<Compile Include="Drawing\ImageOrientation.cs" />
<Compile Include="Dto\StreamOptions.cs" />
<Compile Include="Entities\ExtraType.cs" />