jellyfin/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs

161 lines
5.5 KiB
C#
Raw Normal View History

2014-10-08 02:25:24 +00:00
using System.Collections.Generic;
using System.Xml.Serialization;
2014-07-17 03:17:14 +00:00
2014-10-06 23:58:46 +00:00
namespace MediaBrowser.Model.Dlna.Profiles
2014-07-17 03:17:14 +00:00
{
[XmlRoot("Profile")]
public class AndroidProfile : DefaultProfile
{
2014-10-08 02:25:24 +00:00
public AndroidProfile(bool supportsHls, bool supportsMpegDash)
2014-07-17 03:17:14 +00:00
{
Name = "Android";
2014-10-08 02:25:24 +00:00
List<TranscodingProfile> transcodingProfiles = new List<TranscodingProfile>();
transcodingProfiles.Add(new TranscodingProfile
2014-07-17 03:17:14 +00:00
{
2014-10-08 02:25:24 +00:00
Container = "mp3",
AudioCodec = "mp3",
Type = DlnaProfileType.Audio
});
if (supportsMpegDash)
{
}
if (supportsHls)
{
transcodingProfiles.Add(new TranscodingProfile
2014-07-17 03:17:14 +00:00
{
Protocol = "hls",
Container = "ts",
VideoCodec = "h264",
AudioCodec = "aac",
Type = DlnaProfileType.Video,
VideoProfile = "Baseline",
Context = EncodingContext.Streaming
2014-10-08 02:25:24 +00:00
});
}
transcodingProfiles.Add(new TranscodingProfile
{
Container = "mp4",
VideoCodec = "h264",
AudioCodec = "aac",
Type = DlnaProfileType.Video,
VideoProfile = "Baseline",
Context = EncodingContext.Static
});
TranscodingProfiles = transcodingProfiles.ToArray();
2014-07-17 03:17:14 +00:00
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,
2014-10-08 02:25:24 +00:00
Codec= "h264",
Conditions = new []
{
new ProfileCondition(ProfileConditionType.SubstringOf, ProfileConditionValue.VideoProfile, "baseline"),
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.Video,
2014-07-17 03:17:14 +00:00
Conditions = new []
{
2014-10-06 23:58:46 +00:00
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")
2014-07-17 03:17:14 +00:00
}
},
new CodecProfile
{
Type = CodecType.VideoAudio,
Codec = "aac",
Conditions = new []
{
2014-10-06 23:58:46 +00:00
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioChannels, "2")
2014-07-17 03:17:14 +00:00
}
},
new CodecProfile
{
Type = CodecType.Audio,
Codec = "aac",
Conditions = new []
{
2014-10-06 23:58:46 +00:00
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioChannels, "2")
2014-07-17 03:17:14 +00:00
}
},
new CodecProfile
{
Type = CodecType.Audio,
Codec = "mp3",
Conditions = new []
{
2014-10-06 23:58:46 +00:00
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioChannels, "2"),
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioBitrate, "320000")
2014-07-17 03:17:14 +00:00
}
}
};
}
}
}