aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/StreamState.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Playback/StreamState.cs')
-rw-r--r--MediaBrowser.Api/Playback/StreamState.cs242
1 files changed, 0 insertions, 242 deletions
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs
index 1daca9e33..2cf7d81af 100644
--- a/MediaBrowser.Api/Playback/StreamState.cs
+++ b/MediaBrowser.Api/Playback/StreamState.cs
@@ -250,248 +250,6 @@ namespace MediaBrowser.Api.Playback
public DeviceProfile DeviceProfile { 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);
- }
-
- if (VideoRequest == null)
- {
- return null;
- }
-
- 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);
- }
-
- if (VideoRequest == null)
- {
- return null;
- }
-
- 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>
- /// Gets the target reference frames.
- /// </summary>
- /// <value>The target reference frames.</value>
- public int? TargetRefFrames
- {
- get
- {
- var stream = VideoStream;
- return stream == null || !Request.Static ? null : stream.RefFrames;
- }
- }
-
- public int? TargetVideoStreamCount
- {
- get
- {
- if (Request.Static)
- {
- return GetMediaStreamCount(MediaStreamType.Video, int.MaxValue);
- }
- return GetMediaStreamCount(MediaStreamType.Video, 1);
- }
- }
-
- public int? TargetAudioStreamCount
- {
- get
- {
- if (Request.Static)
- {
- return GetMediaStreamCount(MediaStreamType.Audio, int.MaxValue);
- }
- return GetMediaStreamCount(MediaStreamType.Audio, 1);
- }
- }
-
- public bool? IsTargetAnamorphic
- {
- get
- {
- if (Request.Static)
- {
- return VideoStream == null ? null : VideoStream.IsAnamorphic;
- }
-
- return false;
- }
- }
-
- public bool? IsTargetInterlaced
- {
- get
- {
- if (Request.Static)
- {
- return VideoStream == null ? (bool?)null : VideoStream.IsInterlaced;
- }
-
- if (DeInterlace)
- {
- return false;
- }
-
- return VideoStream == null ? (bool?)null : VideoStream.IsInterlaced;
- }
- }
-
- private int? GetMediaStreamCount(MediaStreamType type, int limit)
- {
- var count = MediaSource.GetStreamCount(type);
-
- if (count.HasValue)
- {
- count = Math.Min(count.Value, limit);
- }
-
- return count;
- }
-
- /// <summary>
- /// Predicts the audio sample rate that will be in the output stream
- /// </summary>
- public float? TargetFramerate
- {
- get
- {
- var stream = VideoStream;
- var requestedFramerate = VideoRequest.MaxFramerate ?? VideoRequest.Framerate;
-
- return requestedFramerate.HasValue && !Request.Static
- ? requestedFramerate
- : stream == null ? null : stream.AverageFrameRate ?? stream.RealFrameRate;
- }
- }
-
- public TransportStreamTimestamp TargetTimestamp
- {
- get
- {
- var defaultValue = string.Equals(OutputContainer, "m2ts", StringComparison.OrdinalIgnoreCase) ?
- TransportStreamTimestamp.Valid :
- TransportStreamTimestamp.None;
-
- return !Request.Static
- ? defaultValue
- : InputTimestamp;
- }
- }
-
- /// <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;
- }
- }
-
- public string TargetVideoCodecTag
- {
- get
- {
- var stream = VideoStream;
- return !Request.Static
- ? null
- : stream == null ? null : stream.CodecTag;
- }
- }
-
- public bool? IsTargetAVC
- {
- get
- {
- if (Request.Static)
- {
- return VideoStream == null ? null : VideoStream.IsAVC;
- }
-
- return true;
- }
- }
-
public TranscodingJob TranscodingJob;
public override void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentComplete, long? bytesTranscoded, int? bitRate)
{