mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-30 20:38:27 +01:00
Normalize orgPn usage
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -56,6 +57,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public MediaSourceInfo MediaSource { get; set; }
|
||||
|
||||
public TransportStreamTimestamp TargetTimestamp { get; set; }
|
||||
|
||||
public string MediaSourceId
|
||||
{
|
||||
get
|
||||
@@ -252,6 +255,68 @@ namespace MediaBrowser.Model.Dlna
|
||||
: stream == null ? null : stream.Channels;
|
||||
}
|
||||
}
|
||||
|
||||
public int? TotalOutputBitrate
|
||||
{
|
||||
get
|
||||
{
|
||||
return (TargetAudioBitrate ?? 0) + (VideoBitrate ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
public int? TargetWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
var videoStream = TargetVideoStream;
|
||||
|
||||
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,
|
||||
null,
|
||||
null,
|
||||
MaxWidth,
|
||||
MaxHeight);
|
||||
|
||||
return Convert.ToInt32(newSize.Width);
|
||||
}
|
||||
|
||||
return MaxWidth;
|
||||
}
|
||||
}
|
||||
|
||||
public int? TargetHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
var videoStream = TargetVideoStream;
|
||||
|
||||
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,
|
||||
null,
|
||||
null,
|
||||
MaxWidth,
|
||||
MaxHeight);
|
||||
|
||||
return Convert.ToInt32(newSize.Height);
|
||||
}
|
||||
|
||||
return MaxHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user