diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-22 20:50:47 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-22 20:50:47 -0400 |
| commit | fdd8c67162233659656d3c719a6734cbe5f87d9f (patch) | |
| tree | 19a8187dcf4a6df362d93dfb44b4e31aa6ba5929 /MediaBrowser.Api/Playback/StreamState.cs | |
| parent | 54eb7cb85537ef6959e3f1fab7871361b9bf8243 (diff) | |
add correct media format profiles to res elements
Diffstat (limited to 'MediaBrowser.Api/Playback/StreamState.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamState.cs | 78 |
1 files changed, 68 insertions, 10 deletions
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index e41f29663..067a3f978 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -1,6 +1,7 @@ using MediaBrowser.Common.Net; using MediaBrowser.Controller.LiveTv; using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; @@ -32,9 +33,7 @@ namespace MediaBrowser.Api.Playback public Stream LogFileStream { get; set; } public MediaStream AudioStream { get; set; } - public MediaStream VideoStream { get; set; } - public MediaStream SubtitleStream { get; set; } /// <summary> @@ -50,7 +49,6 @@ namespace MediaBrowser.Api.Playback public bool IsInputVideo { get; set; } public VideoType VideoType { get; set; } - public IsoType? IsoType { get; set; } public List<string> PlayableStreamFileNames { get; set; } @@ -64,8 +62,8 @@ namespace MediaBrowser.Api.Playback public long? RunTimeTicks; - public string AudioSync = "1"; - public string VideoSync = "vfr"; + public string OutputAudioSync = "1"; + public string OutputVideoSync = "vfr"; public List<string> SupportedAudioCodecs { get; set; } @@ -80,19 +78,14 @@ namespace MediaBrowser.Api.Playback public string InputVideoSync { get; set; } public bool DeInterlace { get; set; } - public bool ReadInputAtNativeFramerate { get; set; } - public string InputFormat { get; set; } - public string InputVideoCodec { get; set; } - public string InputAudioCodec { get; set; } public string MimeType { get; set; } public string OrgPn { get; set; } - // DLNA Settings public bool EstimateContentLength { get; set; } public bool EnableMpegtsM2TsMode { get; set; } public TranscodeSeekInfo TranscodeSeekInfo { get; set; } @@ -162,5 +155,70 @@ namespace MediaBrowser.Api.Playback } } } + + public int? OutputAudioChannels; + public int? OutputAudioSampleRate; + public int? OutputAudioBitrate; + public int? OutputVideoBitrate; + + public string OutputContainer { get; set; } + + public int? TotalOutputBitrate + { + get + { + return (OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0); + } + } + + public int? OutputWidth + { + get + { + if (VideoStream != null && VideoStream.Width.HasValue && VideoStream.Height.HasValue) + { + var size = new ImageSize + { + Width = VideoStream.Width.Value, + Height = VideoStream.Height.Value + }; + + var newSize = DrawingUtils.Resize(size, + VideoRequest.Width, + VideoRequest.Height, + VideoRequest.MaxWidth, + VideoRequest.MaxHeight); + + return Convert.ToInt32(newSize.Width); + } + + return VideoRequest.MaxWidth ?? VideoRequest.Width; + } + } + + public int? OutputHeight + { + get + { + if (VideoStream != null && VideoStream.Width.HasValue && VideoStream.Height.HasValue) + { + var size = new ImageSize + { + Width = VideoStream.Width.Value, + Height = VideoStream.Height.Value + }; + + var newSize = DrawingUtils.Resize(size, + VideoRequest.Width, + VideoRequest.Height, + VideoRequest.MaxWidth, + VideoRequest.MaxHeight); + + return Convert.ToInt32(newSize.Height); + } + + return VideoRequest.MaxHeight ?? VideoRequest.Height; + } + } } } |
