remove tvos dts hack no longer needed

pull/702/head
Luke Pulverenti 8 years ago
parent 524e7facc8
commit de9cd28a79

@ -98,6 +98,9 @@ namespace Emby.Dlna.ContentDirectory
if (string.Equals(methodName, "Search", StringComparison.OrdinalIgnoreCase)) if (string.Equals(methodName, "Search", StringComparison.OrdinalIgnoreCase))
return HandleSearch(methodParams, user, deviceId).Result; return HandleSearch(methodParams, user, deviceId).Result;
if (string.Equals(methodName, "X_BrowseByLetter", StringComparison.OrdinalIgnoreCase))
return HandleX_BrowseByLetter(methodParams, user, deviceId).Result;
throw new ResourceNotFoundException("Unexpected control request name: " + methodName); throw new ResourceNotFoundException("Unexpected control request name: " + methodName);
} }
@ -118,7 +121,7 @@ namespace Emby.Dlna.ContentDirectory
_userDataManager.SaveUserData(user.Id, item, userdata, UserDataSaveReason.TogglePlayed, _userDataManager.SaveUserData(user.Id, item, userdata, UserDataSaveReason.TogglePlayed,
CancellationToken.None); CancellationToken.None);
return new Dictionary<string,string>(StringComparer.OrdinalIgnoreCase); return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
} }
private IEnumerable<KeyValuePair<string, string>> HandleGetSearchCapabilities() private IEnumerable<KeyValuePair<string, string>> HandleGetSearchCapabilities()
@ -147,7 +150,7 @@ namespace Emby.Dlna.ContentDirectory
private IEnumerable<KeyValuePair<string, string>> HandleGetSystemUpdateID() private IEnumerable<KeyValuePair<string, string>> HandleGetSystemUpdateID()
{ {
var headers = new Dictionary<string,string>(StringComparer.OrdinalIgnoreCase); var headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
headers.Add("Id", _systemUpdateId.ToString(_usCulture)); headers.Add("Id", _systemUpdateId.ToString(_usCulture));
return headers; return headers;
} }
@ -309,6 +312,12 @@ namespace Emby.Dlna.ContentDirectory
}; };
} }
private Task<IEnumerable<KeyValuePair<string, string>>> HandleX_BrowseByLetter(IDictionary<string, string> sparams, User user, string deviceId)
{
// TODO: Implement this method
return HandleSearch(sparams, user, deviceId);
}
private async Task<IEnumerable<KeyValuePair<string, string>>> HandleSearch(IDictionary<string, string> sparams, User user, string deviceId) private async Task<IEnumerable<KeyValuePair<string, string>>> HandleSearch(IDictionary<string, string> sparams, User user, string deviceId)
{ {
var searchCriteria = new SearchCriteria(GetValueOrDefault(sparams, "SearchCriteria", "")); var searchCriteria = new SearchCriteria(GetValueOrDefault(sparams, "SearchCriteria", ""));
@ -553,20 +562,6 @@ namespace Emby.Dlna.ContentDirectory
return result; return result;
} }
private bool EnablePeopleDisplay(BaseItem item)
{
if (_libraryManager.GetPeopleNames(new InternalPeopleQuery
{
ItemId = item.Id
}).Count > 0)
{
return item is Movie;
}
return false;
}
private ServerItem GetItemFromObjectId(string id, User user) private ServerItem GetItemFromObjectId(string id, User user)
{ {
return DidlBuilder.IsIdRoot(id) return DidlBuilder.IsIdRoot(id)

@ -207,8 +207,7 @@ namespace Emby.Dlna.Didl
streamInfo.TargetVideoStreamCount, streamInfo.TargetVideoStreamCount,
streamInfo.TargetAudioStreamCount, streamInfo.TargetAudioStreamCount,
streamInfo.TargetVideoCodecTag, streamInfo.TargetVideoCodecTag,
streamInfo.IsTargetAVC, streamInfo.IsTargetAVC);
streamInfo.AllAudioCodecs);
foreach (var contentFeature in contentFeatureList) foreach (var contentFeature in contentFeatureList)
{ {
@ -348,8 +347,7 @@ namespace Emby.Dlna.Didl
streamInfo.TargetVideoStreamCount, streamInfo.TargetVideoStreamCount,
streamInfo.TargetAudioStreamCount, streamInfo.TargetAudioStreamCount,
streamInfo.TargetVideoCodecTag, streamInfo.TargetVideoCodecTag,
streamInfo.IsTargetAVC, streamInfo.IsTargetAVC);
streamInfo.AllAudioCodecs);
var filename = url.Substring(0, url.IndexOf('?')); var filename = url.Substring(0, url.IndexOf('?'));

@ -541,8 +541,7 @@ namespace Emby.Dlna.PlayTo
streamInfo.TargetVideoStreamCount, streamInfo.TargetVideoStreamCount,
streamInfo.TargetAudioStreamCount, streamInfo.TargetAudioStreamCount,
streamInfo.TargetVideoCodecTag, streamInfo.TargetVideoCodecTag,
streamInfo.IsTargetAVC, streamInfo.IsTargetAVC);
streamInfo.AllAudioCodecs);
return list.FirstOrDefault(); return list.FirstOrDefault();
} }

@ -2358,8 +2358,7 @@ namespace MediaBrowser.Api.Playback
state.TargetVideoStreamCount, state.TargetVideoStreamCount,
state.TargetAudioStreamCount, state.TargetAudioStreamCount,
state.TargetVideoCodecTag, state.TargetVideoCodecTag,
state.IsTargetAVC, state.IsTargetAVC);
state.AllAudioCodecs);
if (mediaProfile != null) if (mediaProfile != null)
{ {
@ -2581,8 +2580,7 @@ namespace MediaBrowser.Api.Playback
state.TargetVideoStreamCount, state.TargetVideoStreamCount,
state.TargetAudioStreamCount, state.TargetAudioStreamCount,
state.TargetVideoCodecTag, state.TargetVideoCodecTag,
state.IsTargetAVC, state.IsTargetAVC
state.AllAudioCodecs
).FirstOrDefault() ?? string.Empty; ).FirstOrDefault() ?? string.Empty;
} }

@ -245,17 +245,6 @@ namespace MediaBrowser.Api.Playback
public int? OutputAudioBitrate; public int? OutputAudioBitrate;
public int? OutputVideoBitrate; public int? OutputVideoBitrate;
public List<string> AllAudioCodecs
{
get
{
return MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio)
.Select(i => i.Codec)
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToList();
}
}
public string ActualOutputVideoCodec public string ActualOutputVideoCodec
{ {
get get

@ -118,17 +118,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
} }
} }
public List<string> AllAudioCodecs
{
get
{
return MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio)
.Select(i => i.Codec)
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToList();
}
}
private void DisposeIsoMount() private void DisposeIsoMount()
{ {
if (IsoMount != null) if (IsoMount != null)

@ -846,8 +846,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
state.TargetVideoStreamCount, state.TargetVideoStreamCount,
state.TargetAudioStreamCount, state.TargetAudioStreamCount,
state.TargetVideoCodecTag, state.TargetVideoCodecTag,
state.IsTargetAVC, state.IsTargetAVC);
state.AllAudioCodecs);
if (mediaProfile != null) if (mediaProfile != null)
{ {

@ -24,15 +24,12 @@ namespace MediaBrowser.Model.Dlna
int? numVideoStreams, int? numVideoStreams,
int? numAudioStreams, int? numAudioStreams,
string videoCodecTag, string videoCodecTag,
bool? isAvc, bool? isAvc )
List<string> allAudioCodecs )
{ {
switch (condition.Property) switch (condition.Property)
{ {
case ProfileConditionValue.IsAnamorphic: case ProfileConditionValue.IsAnamorphic:
return IsConditionSatisfied(condition, isAnamorphic); return IsConditionSatisfied(condition, isAnamorphic);
case ProfileConditionValue.HasAudioCodec:
return IsHasAudioCodecConditionSatisfied(condition, allAudioCodecs);
case ProfileConditionValue.IsAvc: case ProfileConditionValue.IsAvc:
return IsConditionSatisfied(condition, isAvc); return IsConditionSatisfied(condition, isAvc);
case ProfileConditionValue.VideoFramerate: case ProfileConditionValue.VideoFramerate:
@ -167,25 +164,6 @@ namespace MediaBrowser.Model.Dlna
} }
} }
private bool IsHasAudioCodecConditionSatisfied(ProfileCondition condition, List<string> allAudioCodecs)
{
if (allAudioCodecs.Count == 0)
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
switch (condition.Condition)
{
case ProfileConditionType.Equals:
return allAudioCodecs.Contains(condition.Value, StringComparer.Ordinal);
case ProfileConditionType.NotEquals:
return !allAudioCodecs.Contains(condition.Value, StringComparer.Ordinal);
default:
throw new InvalidOperationException("Unexpected ProfileConditionType");
}
}
private bool IsConditionSatisfied(ProfileCondition condition, bool? currentValue) private bool IsConditionSatisfied(ProfileCondition condition, bool? currentValue)
{ {
if (!currentValue.HasValue) if (!currentValue.HasValue)

@ -119,8 +119,7 @@ namespace MediaBrowser.Model.Dlna
int? numVideoStreams, int? numVideoStreams,
int? numAudioStreams, int? numAudioStreams,
string videoCodecTag, string videoCodecTag,
bool? isAvc, bool? isAvc)
List<string> allAudioCodecs)
{ {
// 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 // 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
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo); string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
@ -162,8 +161,7 @@ namespace MediaBrowser.Model.Dlna
numVideoStreams, numVideoStreams,
numAudioStreams, numAudioStreams,
videoCodecTag, videoCodecTag,
isAvc, isAvc);
allAudioCodecs);
List<string> orgPnValues = new List<string>(); List<string> orgPnValues = new List<string>();

@ -297,8 +297,7 @@ namespace MediaBrowser.Model.Dlna
int? numVideoStreams, int? numVideoStreams,
int? numAudioStreams, int? numAudioStreams,
string videoCodecTag, string videoCodecTag,
bool? isAvc, bool? isAvc)
List<string> allAudioCodecs)
{ {
container = StringHelper.TrimStart(container ?? string.Empty, '.'); container = StringHelper.TrimStart(container ?? string.Empty, '.');
@ -332,7 +331,7 @@ namespace MediaBrowser.Model.Dlna
var anyOff = false; var anyOff = false;
foreach (ProfileCondition c in i.Conditions) foreach (ProfileCondition c in i.Conditions)
{ {
if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs)) if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
anyOff = true; anyOff = true;
break; break;

@ -21,7 +21,6 @@
NumVideoStreams = 17, NumVideoStreams = 17,
IsSecondaryAudio = 18, IsSecondaryAudio = 18,
VideoCodecTag = 19, VideoCodecTag = 19,
IsAvc = 20, IsAvc = 20
HasAudioCodec = 21
} }
} }

@ -411,7 +411,6 @@ namespace MediaBrowser.Model.Dlna
} }
var allMediaStreams = item.MediaStreams; var allMediaStreams = item.MediaStreams;
var allAudioCodecs = allMediaStreams.Where(i => i.Type == MediaStreamType.Audio).Select(i => i.Codec).Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
MediaStream videoStream = item.VideoStream; MediaStream videoStream = item.VideoStream;
@ -556,7 +555,7 @@ namespace MediaBrowser.Model.Dlna
int? numAudioStreams = item.GetStreamCount(MediaStreamType.Audio); int? numAudioStreams = item.GetStreamCount(MediaStreamType.Audio);
int? numVideoStreams = item.GetStreamCount(MediaStreamType.Video); int? numVideoStreams = item.GetStreamCount(MediaStreamType.Video);
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs)) if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item); LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item);
applyConditions = false; applyConditions = false;
@ -739,12 +738,10 @@ namespace MediaBrowser.Model.Dlna
int? numAudioStreams = mediaSource.GetStreamCount(MediaStreamType.Audio); int? numAudioStreams = mediaSource.GetStreamCount(MediaStreamType.Audio);
int? numVideoStreams = mediaSource.GetStreamCount(MediaStreamType.Video); int? numVideoStreams = mediaSource.GetStreamCount(MediaStreamType.Video);
var allAudioCodecs = allMediaStreams.Where(i => i.Type == MediaStreamType.Audio).Select(i => i.Codec).Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
// Check container conditions // Check container conditions
foreach (ProfileCondition i in conditions) foreach (ProfileCondition i in conditions)
{ {
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs)) if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
LogConditionFailure(profile, "VideoContainerProfile", i, mediaSource); LogConditionFailure(profile, "VideoContainerProfile", i, mediaSource);
@ -771,7 +768,7 @@ namespace MediaBrowser.Model.Dlna
bool applyConditions = true; bool applyConditions = true;
foreach (ProfileCondition applyCondition in i.ApplyConditions) foreach (ProfileCondition applyCondition in i.ApplyConditions)
{ {
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs)) if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
LogConditionFailure(profile, "VideoCodecProfile", applyCondition, mediaSource); LogConditionFailure(profile, "VideoCodecProfile", applyCondition, mediaSource);
applyConditions = false; applyConditions = false;
@ -791,7 +788,7 @@ namespace MediaBrowser.Model.Dlna
foreach (ProfileCondition i in conditions) foreach (ProfileCondition i in conditions)
{ {
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs)) if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
LogConditionFailure(profile, "VideoCodecProfile", i, mediaSource); LogConditionFailure(profile, "VideoCodecProfile", i, mediaSource);

@ -413,17 +413,6 @@ namespace MediaBrowser.Model.Dlna
} }
} }
public List<string> AllAudioCodecs
{
get
{
return MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio)
.Select(i => i.Codec)
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToList();
}
}
/// <summary> /// <summary>
/// Returns the video stream that will be used /// Returns the video stream that will be used
/// </summary> /// </summary>

Loading…
Cancel
Save