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 | |
| parent | 0ab3a1bf8e437591e8f949ed198f33b95522c703 (diff) | |
updated dlna profiles
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 28 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamState.cs | 86 |
2 files changed, 109 insertions, 5 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 93f3e2d9f9..a4abb129b3 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1665,8 +1665,21 @@ namespace MediaBrowser.Api.Playback } var mediaProfile = state.VideoRequest == null ? - profile.GetAudioMediaProfile(state.OutputContainer, audioCodec) : - profile.GetVideoMediaProfile(state.OutputContainer, audioCodec, videoCodec); + profile.GetAudioMediaProfile(state.OutputContainer, audioCodec, state.OutputAudioChannels, state.OutputAudioBitrate) : + profile.GetVideoMediaProfile(state.OutputContainer, + audioCodec, + videoCodec, + state.OutputAudioBitrate, + state.OutputAudioChannels, + state.OutputWidth, + state.OutputHeight, + state.TargetVideoBitDepth, + state.OutputVideoBitrate, + state.TargetVideoProfile, + state.TargetVideoLevel, + state.TargetFramerate, + state.TargetPacketLength, + state.TargetTimestamp); if (mediaProfile != null) { @@ -1752,10 +1765,17 @@ namespace MediaBrowser.Api.Playback audioCodec, state.OutputWidth, state.OutputHeight, - state.TotalOutputBitrate, - TransportStreamTimestamp.VALID, + state.TargetVideoBitDepth, + state.OutputVideoBitrate, + state.OutputAudioBitrate, + state.OutputAudioChannels, + state.TargetTimestamp, isStaticallyStreamed, state.RunTimeTicks, + state.TargetVideoProfile, + state.TargetVideoLevel, + state.TargetFramerate, + state.TargetPacketLength, state.TranscodeSeekInfo ); } diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 8a8246b69d..fe9199244b 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; + } + } + } } |
