aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-07 22:25:24 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-07 22:25:24 -0400
commitbebba65d6137125d459a911b695131c063524c56 (patch)
tree9e501c50be814e161b262de538acc584343edacc /MediaBrowser.Model
parent4999f1948533f513f43966b7af03b3db8881645d (diff)
check video profile with substring
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Dlna/ConditionProcessor.cs2
-rw-r--r--MediaBrowser.Model/Dlna/ProfileConditionType.cs3
-rw-r--r--MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs68
3 files changed, 51 insertions, 22 deletions
diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs
index db004a65e..dd9a49ec4 100644
--- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs
+++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs
@@ -145,6 +145,8 @@ namespace MediaBrowser.Model.Dlna
switch (condition.Condition)
{
+ case ProfileConditionType.SubstringOf:
+ return StringHelper.IndexOfIgnoreCase(currentValue, expected) != -1;
case ProfileConditionType.Equals:
return StringHelper.EqualsIgnoreCase(currentValue, expected);
case ProfileConditionType.NotEquals:
diff --git a/MediaBrowser.Model/Dlna/ProfileConditionType.cs b/MediaBrowser.Model/Dlna/ProfileConditionType.cs
index 22156c47d..bfbd31f02 100644
--- a/MediaBrowser.Model/Dlna/ProfileConditionType.cs
+++ b/MediaBrowser.Model/Dlna/ProfileConditionType.cs
@@ -5,6 +5,7 @@
Equals = 0,
NotEquals = 1,
LessThanEqual = 2,
- GreaterThanEqual = 3
+ GreaterThanEqual = 3,
+ SubstringOf = 4
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs b/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs
index 09c26cb1f..1f0b9a262 100644
--- a/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs
+++ b/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs
@@ -1,23 +1,31 @@
-using System.Xml.Serialization;
+using System.Collections.Generic;
+using System.Xml.Serialization;
namespace MediaBrowser.Model.Dlna.Profiles
{
[XmlRoot("Profile")]
public class AndroidProfile : DefaultProfile
{
- public AndroidProfile()
+ public AndroidProfile(bool supportsHls, bool supportsMpegDash)
{
Name = "Android";
- TranscodingProfiles = new[]
+ List<TranscodingProfile> transcodingProfiles = new List<TranscodingProfile>();
+
+ transcodingProfiles.Add(new TranscodingProfile
{
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
+ Container = "mp3",
+ AudioCodec = "mp3",
+ Type = DlnaProfileType.Audio
+ });
+
+ if (supportsMpegDash)
+ {
+
+ }
+ if (supportsHls)
+ {
+ transcodingProfiles.Add(new TranscodingProfile
{
Protocol = "hls",
Container = "ts",
@@ -26,17 +34,19 @@ namespace MediaBrowser.Model.Dlna.Profiles
Type = DlnaProfileType.Video,
VideoProfile = "Baseline",
Context = EncodingContext.Streaming
- },
- new TranscodingProfile
- {
- Container = "mp4",
- VideoCodec = "h264",
- AudioCodec = "aac",
- Type = DlnaProfileType.Video,
- VideoProfile = "Baseline",
- Context = EncodingContext.Static
- }
- };
+ });
+ }
+ transcodingProfiles.Add(new TranscodingProfile
+ {
+ Container = "mp4",
+ VideoCodec = "h264",
+ AudioCodec = "aac",
+ Type = DlnaProfileType.Video,
+ VideoProfile = "Baseline",
+ Context = EncodingContext.Static
+ });
+
+ TranscodingProfiles = transcodingProfiles.ToArray();
DirectPlayProfiles = new[]
{
@@ -88,6 +98,22 @@ namespace MediaBrowser.Model.Dlna.Profiles
new CodecProfile
{
Type = CodecType.Video,
+ 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,
+
Conditions = new []
{
new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.Width, "1920"),