From 5a5b48feff3a0b0a660aaaa9bdfd04fd0fe711ed Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 23 Oct 2014 00:26:01 -0400 Subject: added new cabac value --- MediaBrowser.Model/Dlna/ConditionProcessor.cs | 3 +++ MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs | 2 ++ MediaBrowser.Model/Dlna/DeviceProfile.cs | 3 ++- MediaBrowser.Model/Dlna/ProfileConditionValue.cs | 3 ++- MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs | 3 ++- MediaBrowser.Model/Dlna/StreamBuilder.cs | 6 ++++-- MediaBrowser.Model/Dlna/StreamInfo.cs | 13 +++++++++++++ MediaBrowser.Model/Entities/MediaStream.cs | 6 ++++++ MediaBrowser.Model/MediaBrowser.Model.csproj | 1 - MediaBrowser.Model/Querying/ItemsResult.cs | 21 +-------------------- MediaBrowser.Model/Weather/WeatherUnits.cs | 17 ----------------- 11 files changed, 35 insertions(+), 43 deletions(-) delete mode 100644 MediaBrowser.Model/Weather/WeatherUnits.cs (limited to 'MediaBrowser.Model') diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index 4fedb36d6..e0a8e239e 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -19,6 +19,7 @@ namespace MediaBrowser.Model.Dlna int? packetLength, TransportStreamTimestamp? timestamp, bool? isAnamorphic, + bool? isCabac, int? refFrames) { switch (condition.Property) @@ -31,6 +32,8 @@ namespace MediaBrowser.Model.Dlna return true; case ProfileConditionValue.IsAnamorphic: return IsConditionSatisfied(condition, isAnamorphic); + case ProfileConditionValue.IsCabac: + return IsConditionSatisfied(condition, isCabac); case ProfileConditionValue.VideoFramerate: return IsConditionSatisfied(condition, videoFramerate); case ProfileConditionValue.VideoLevel: diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs index 5ded415aa..a3eeecff2 100644 --- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs +++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs @@ -116,6 +116,7 @@ namespace MediaBrowser.Model.Dlna int? packetLength, TranscodeSeekInfo transcodeSeekInfo, bool? isAnamorphic, + bool? isCabac, int? refFrames) { // first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none @@ -156,6 +157,7 @@ namespace MediaBrowser.Model.Dlna packetLength, timestamp, isAnamorphic, + isCabac, refFrames); List orgPnValues = new List(); diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index 94de34a28..66f593615 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -281,6 +281,7 @@ namespace MediaBrowser.Model.Dlna int? packetLength, TransportStreamTimestamp timestamp, bool? isAnamorphic, + bool? isCabac, int? refFrames) { container = StringHelper.TrimStart((container ?? string.Empty), '.'); @@ -315,7 +316,7 @@ namespace MediaBrowser.Model.Dlna var anyOff = false; foreach (ProfileCondition c in i.Conditions) { - if (!conditionProcessor.IsVideoConditionSatisfied(c, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames)) + if (!conditionProcessor.IsVideoConditionSatisfied(c, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames)) { anyOff = true; break; diff --git a/MediaBrowser.Model/Dlna/ProfileConditionValue.cs b/MediaBrowser.Model/Dlna/ProfileConditionValue.cs index 27abf9878..ae6dc74c8 100644 --- a/MediaBrowser.Model/Dlna/ProfileConditionValue.cs +++ b/MediaBrowser.Model/Dlna/ProfileConditionValue.cs @@ -16,6 +16,7 @@ VideoProfile = 11, VideoTimestamp = 12, IsAnamorphic = 13, - RefFrames = 14 + RefFrames = 14, + IsCabac = 15 } } \ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs b/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs index 1f27e5991..04b4a808d 100644 --- a/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs +++ b/MediaBrowser.Model/Dlna/Profiles/AndroidProfile.cs @@ -114,7 +114,8 @@ namespace MediaBrowser.Model.Dlna.Profiles 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 ProfileCondition(ProfileConditionType.NotEquals, ProfileConditionValue.IsAnamorphic, "true"), + new ProfileCondition(ProfileConditionType.Equals, ProfileConditionValue.IsCabac, "true") } }, diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 227fb3ad6..792e6de91 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -419,6 +419,7 @@ namespace MediaBrowser.Model.Dlna string videoProfile = videoStream == null ? null : videoStream.Profile; float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate; bool? isAnamorphic = videoStream == null ? null : videoStream.IsAnamorphic; + bool? isCabac = videoStream == null ? null : videoStream.IsCabac; int? audioBitrate = audioStream == null ? null : audioStream.BitRate; int? audioChannels = audioStream == null ? null : audioStream.Channels; @@ -431,7 +432,7 @@ namespace MediaBrowser.Model.Dlna // Check container conditions foreach (ProfileCondition i in conditions) { - if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames)) + if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames)) { return null; } @@ -458,7 +459,7 @@ namespace MediaBrowser.Model.Dlna foreach (ProfileCondition i in conditions) { - if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames)) + if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames)) { return null; } @@ -647,6 +648,7 @@ namespace MediaBrowser.Model.Dlna } case ProfileConditionValue.AudioProfile: case ProfileConditionValue.IsAnamorphic: + case ProfileConditionValue.IsCabac: case ProfileConditionValue.Has64BitOffsets: case ProfileConditionValue.PacketLength: case ProfileConditionValue.VideoTimestamp: diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index 58848ff50..4c03201f1 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -456,6 +456,19 @@ namespace MediaBrowser.Model.Dlna } } + public bool? IsTargetCabac + { + get + { + if (IsDirectStream) + { + return TargetVideoStream == null ? null : TargetVideoStream.IsCabac; + } + + return true; + } + } + public int? TargetWidth { get diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index b71f68d18..4a9b765c2 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -175,5 +175,11 @@ namespace MediaBrowser.Model.Entities /// /// true if this instance is anamorphic; otherwise, false. public bool? IsAnamorphic { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is cabac. + /// + /// null if [is cabac] contains no value, true if [is cabac]; otherwise, false. + public bool? IsCabac { get; set; } } } diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index bb6f94b11..32f655ae7 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -402,7 +402,6 @@ - diff --git a/MediaBrowser.Model/Querying/ItemsResult.cs b/MediaBrowser.Model/Querying/ItemsResult.cs index b3f771e4b..3b9c59733 100644 --- a/MediaBrowser.Model/Querying/ItemsResult.cs +++ b/MediaBrowser.Model/Querying/ItemsResult.cs @@ -5,26 +5,7 @@ namespace MediaBrowser.Model.Querying /// /// Represents the result of a query for items /// - public class ItemsResult + public class ItemsResult : QueryResult { - /// - /// The set of items returned based on sorting, paging, etc - /// - /// The items. - public BaseItemDto[] Items { get; set; } - - /// - /// The total number of records available - /// - /// The total record count. - public int TotalRecordCount { get; set; } - - /// - /// Initializes a new instance of the class. - /// - public ItemsResult() - { - Items = new BaseItemDto[] { }; - } } } diff --git a/MediaBrowser.Model/Weather/WeatherUnits.cs b/MediaBrowser.Model/Weather/WeatherUnits.cs deleted file mode 100644 index d27982e95..000000000 --- a/MediaBrowser.Model/Weather/WeatherUnits.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace MediaBrowser.Model.Weather -{ - /// - /// Enum WeatherUnits - /// - public enum WeatherUnits - { - /// - /// The fahrenheit - /// - Fahrenheit, - /// - /// The celsius - /// - Celsius - } -} \ No newline at end of file -- cgit v1.2.3