aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Dto
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-30 12:16:34 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-30 12:16:34 -0400
commit5f044cfd68eecf116df1a646806fc091f3fb63aa (patch)
tree572b7a009f9c308e1b365801028738b59762a1a4 /MediaBrowser.Model/Dto
parent0bd27381e0ef5a0a17ea93bb86a752c5d2cc2e1a (diff)
add setting to control transcodng throttle
Diffstat (limited to 'MediaBrowser.Model/Dto')
-rw-r--r--MediaBrowser.Model/Dto/MediaSourceInfo.cs34
1 files changed, 32 insertions, 2 deletions
diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
index 3b4513724..302d18bc0 100644
--- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs
+++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
@@ -46,8 +46,8 @@ namespace MediaBrowser.Model.Dto
public int? Bitrate { get; set; }
public TransportStreamTimestamp? Timestamp { get; set; }
- public Dictionary<string, string> RequiredHttpHeaders { get; set; }
-
+ public Dictionary<string, string> RequiredHttpHeaders { get; set; }
+
public string TranscodingUrl { get; set; }
public string TranscodingSubProtocol { get; set; }
public string TranscodingContainer { get; set; }
@@ -135,5 +135,35 @@ namespace MediaBrowser.Model.Dto
return null;
}
+
+ public int? GetStreamCount(MediaStreamType type)
+ {
+ int numMatches = 0;
+ int numStreams = 0;
+
+ foreach (MediaStream i in MediaStreams)
+ {
+ numStreams++;
+ if (i.Type == type)
+ {
+ numMatches++;
+ }
+ }
+
+ return numStreams == 0 ? (int?)null : numMatches;
+ }
+
+ public bool? IsSecondaryAudio(MediaStream stream)
+ {
+ foreach (MediaStream currentStream in MediaStreams)
+ {
+ if (currentStream.Type == MediaStreamType.Audio)
+ {
+ return currentStream.Index != stream.Index;
+ }
+ }
+
+ return null;
+ }
}
}