mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-17 10:58:58 -07:00
07cc4be6a7
* Add analyzers to MediaBrowser.XbmcMetadata * Enable TreatWarningsAsErrors for MediaBrowser.XbmcMetadata * Add analyzers to MediaBrowser.WebDashboard * Enable TreatWarningsAsErrors for MediaBrowser.WebDashboard * Disable SA1600 in favor of CS1591
59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
#pragma warning disable CS1591
|
|
|
|
namespace MediaBrowser.Model.Dlna
|
|
{
|
|
public static class DlnaMaps
|
|
{
|
|
private static readonly string DefaultStreaming =
|
|
FlagsToString(DlnaFlags.StreamingTransferMode |
|
|
DlnaFlags.BackgroundTransferMode |
|
|
DlnaFlags.ConnectionStall |
|
|
DlnaFlags.ByteBasedSeek |
|
|
DlnaFlags.DlnaV15);
|
|
|
|
private static readonly string DefaultInteractive =
|
|
FlagsToString(DlnaFlags.InteractiveTransferMode |
|
|
DlnaFlags.BackgroundTransferMode |
|
|
DlnaFlags.ConnectionStall |
|
|
DlnaFlags.ByteBasedSeek |
|
|
DlnaFlags.DlnaV15);
|
|
|
|
public static string FlagsToString(DlnaFlags flags)
|
|
{
|
|
return string.Format("{0:X8}{1:D24}", (ulong)flags, 0);
|
|
}
|
|
|
|
public static string GetOrgOpValue(bool hasKnownRuntime, bool isDirectStream, TranscodeSeekInfo profileTranscodeSeekInfo)
|
|
{
|
|
if (hasKnownRuntime)
|
|
{
|
|
string orgOp = string.Empty;
|
|
|
|
// Time-based seeking currently only possible when transcoding
|
|
orgOp += isDirectStream ? "0" : "1";
|
|
|
|
// Byte-based seeking only possible when not transcoding
|
|
orgOp += isDirectStream || profileTranscodeSeekInfo == TranscodeSeekInfo.Bytes ? "1" : "0";
|
|
|
|
return orgOp;
|
|
}
|
|
|
|
// No seeking is available if we don't know the content runtime
|
|
return "00";
|
|
}
|
|
|
|
public static string GetImageOrgOpValue()
|
|
{
|
|
string orgOp = string.Empty;
|
|
|
|
// Time-based seeking currently only possible when transcoding
|
|
orgOp += "0";
|
|
|
|
// Byte-based seeking only possible when not transcoding
|
|
orgOp += "0";
|
|
|
|
return orgOp;
|
|
}
|
|
}
|
|
}
|