diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-24 01:08:10 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-24 01:08:10 -0400 |
| commit | a748c660cb3b20fba0f141025a41afa4426a935c (patch) | |
| tree | beb1c7b0ace7a697f53253ecba2471039842c452 /MediaBrowser.Api/Playback/StreamState.cs | |
| parent | 0ab3a1bf8e437591e8f949ed198f33b95522c703 (diff) | |
updated dlna profiles
Diffstat (limited to 'MediaBrowser.Api/Playback/StreamState.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamState.cs | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 8a8246b69..fe9199244 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Net; +using System.Globalization; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.LiveTv; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Drawing; @@ -221,5 +222,88 @@ namespace MediaBrowser.Api.Playback return VideoRequest.MaxHeight ?? VideoRequest.Height; } } + + /// <summary> + /// Predicts the audio sample rate that will be in the output stream + /// </summary> + public int? TargetVideoBitDepth + { + get + { + var stream = VideoStream; + return stream == null || !Request.Static ? null : stream.BitDepth; + } + } + + /// <summary> + /// Predicts the audio sample rate that will be in the output stream + /// </summary> + public double? TargetFramerate + { + get + { + var stream = VideoStream; + var requestedFramerate = VideoRequest.MaxFramerate ?? VideoRequest.Framerate; + + return requestedFramerate.HasValue && !Request.Static + ? requestedFramerate + : stream == null ? null : stream.AverageFrameRate ?? stream.RealFrameRate; + } + } + + /// <summary> + /// Predicts the audio sample rate that will be in the output stream + /// </summary> + public double? TargetVideoLevel + { + get + { + var stream = VideoStream; + return !string.IsNullOrEmpty(VideoRequest.Level) && !Request.Static + ? double.Parse(VideoRequest.Level, CultureInfo.InvariantCulture) + : stream == null ? null : stream.Level; + } + } + + public TransportStreamTimestamp TargetTimestamp + { + get + { + var stream = VideoStream; + + return !Request.Static + ? TransportStreamTimestamp.VALID + : stream == null ? TransportStreamTimestamp.VALID : stream.Timestamp; + } + } + + /// <summary> + /// Predicts the audio sample rate that will be in the output stream + /// </summary> + public int? TargetPacketLength + { + get + { + var stream = VideoStream; + return !Request.Static + ? null + : stream == null ? null : stream.PacketLength; + } + } + + /// <summary> + /// Predicts the audio sample rate that will be in the output stream + /// </summary> + public string TargetVideoProfile + { + get + { + var stream = VideoStream; + return !string.IsNullOrEmpty(VideoRequest.Profile) && !Request.Static + ? VideoRequest.Profile + : stream == null ? null : stream.Profile; + } + } + } } |
