mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 18:14:42 +01:00
Trying to make sense of the streaming code
Mostly small changes as I was looking through the code. * async void -> async Task * Properly implemented dispose methods * Pass the logstream directly to the JobLogger * Style fixes
This commit is contained in:
@@ -13,7 +13,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
_profile = profile;
|
||||
}
|
||||
|
||||
public string BuildImageHeader(string container,
|
||||
public string BuildImageHeader(
|
||||
string container,
|
||||
int? width,
|
||||
int? height,
|
||||
bool isDirectStream,
|
||||
@@ -28,8 +29,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
DlnaFlags.InteractiveTransferMode |
|
||||
DlnaFlags.DlnaV15;
|
||||
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||
DlnaMaps.FlagsToString(flagValue));
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", DlnaMaps.FlagsToString(flagValue));
|
||||
|
||||
ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container,
|
||||
width,
|
||||
@@ -37,7 +37,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (string.IsNullOrEmpty(orgPn))
|
||||
{
|
||||
orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
||||
orgPn = mediaProfile?.OrgPn;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(orgPn))
|
||||
@@ -50,7 +50,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
||||
}
|
||||
|
||||
public string BuildAudioHeader(string container,
|
||||
public string BuildAudioHeader(
|
||||
string container,
|
||||
string audioCodec,
|
||||
int? audioBitrate,
|
||||
int? audioSampleRate,
|
||||
@@ -102,7 +103,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
||||
}
|
||||
|
||||
public List<string> BuildVideoHeader(string container,
|
||||
public List<string> BuildVideoHeader(
|
||||
string container,
|
||||
string videoCodec,
|
||||
string audioCodec,
|
||||
int? width,
|
||||
@@ -206,7 +208,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return contentFeatureList;
|
||||
}
|
||||
|
||||
private string GetImageOrgPnValue(string container, int? width, int? height)
|
||||
private static string GetImageOrgPnValue(string container, int? width, int? height)
|
||||
{
|
||||
MediaFormatProfile? format = new MediaFormatProfileResolver()
|
||||
.ResolveImageFormat(container,
|
||||
@@ -216,7 +218,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return format.HasValue ? format.Value.ToString() : null;
|
||||
}
|
||||
|
||||
private string GetAudioOrgPnValue(string container, int? audioBitrate, int? audioSampleRate, int? audioChannels)
|
||||
private static string GetAudioOrgPnValue(string container, int? audioBitrate, int? audioSampleRate, int? audioChannels)
|
||||
{
|
||||
MediaFormatProfile? format = new MediaFormatProfileResolver()
|
||||
.ResolveAudioFormat(container,
|
||||
@@ -227,7 +229,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return format.HasValue ? format.Value.ToString() : null;
|
||||
}
|
||||
|
||||
private string[] GetVideoOrgPnValue(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestamp)
|
||||
private static string[] GetVideoOrgPnValue(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestamp)
|
||||
{
|
||||
return new MediaFormatProfileResolver().ResolveVideoFormat(container, videoCodec, audioCodec, width, height, timestamp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user