mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-13 03:00:25 +01:00
add codec tag value
This commit is contained in:
@@ -20,15 +20,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
bool? isCabac,
|
||||
int? refFrames,
|
||||
int? numVideoStreams,
|
||||
int? numAudioStreams)
|
||||
int? numAudioStreams,
|
||||
string videoCodecTag)
|
||||
{
|
||||
switch (condition.Property)
|
||||
{
|
||||
case ProfileConditionValue.AudioProfile:
|
||||
// TODO: Implement
|
||||
return true;
|
||||
case ProfileConditionValue.Has64BitOffsets:
|
||||
return true;
|
||||
case ProfileConditionValue.IsAnamorphic:
|
||||
return IsConditionSatisfied(condition, isAnamorphic);
|
||||
case ProfileConditionValue.IsCabac:
|
||||
@@ -39,6 +35,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
return IsConditionSatisfied(condition, videoLevel);
|
||||
case ProfileConditionValue.VideoProfile:
|
||||
return IsConditionSatisfied(condition, videoProfile);
|
||||
case ProfileConditionValue.VideoCodecTag:
|
||||
return IsConditionSatisfied(condition, videoCodecTag);
|
||||
case ProfileConditionValue.PacketLength:
|
||||
return IsConditionSatisfied(condition, packetLength);
|
||||
case ProfileConditionValue.VideoBitDepth:
|
||||
@@ -58,7 +56,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
case ProfileConditionValue.VideoTimestamp:
|
||||
return IsConditionSatisfied(condition, timestamp);
|
||||
default:
|
||||
throw new ArgumentException("Unexpected condition on video file: " + condition.Property);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
bool? isCabac,
|
||||
int? refFrames,
|
||||
int? numVideoStreams,
|
||||
int? numAudioStreams)
|
||||
int? numAudioStreams,
|
||||
string videoCodecTag)
|
||||
{
|
||||
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
|
||||
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
|
||||
@@ -159,7 +160,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
isCabac,
|
||||
refFrames,
|
||||
numVideoStreams,
|
||||
numAudioStreams);
|
||||
numAudioStreams,
|
||||
videoCodecTag);
|
||||
|
||||
List<string> orgPnValues = new List<string>();
|
||||
|
||||
|
||||
@@ -286,7 +286,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
bool? isCabac,
|
||||
int? refFrames,
|
||||
int? numVideoStreams,
|
||||
int? numAudioStreams)
|
||||
int? numAudioStreams,
|
||||
string videoCodecTag)
|
||||
{
|
||||
container = StringHelper.TrimStart((container ?? string.Empty), '.');
|
||||
|
||||
@@ -320,7 +321,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var anyOff = false;
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(c, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames, numVideoStreams, numAudioStreams))
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(c, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames, numVideoStreams, numAudioStreams, videoCodecTag))
|
||||
{
|
||||
anyOff = true;
|
||||
break;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
IsCabac = 15,
|
||||
NumAudioStreams = 16,
|
||||
NumVideoStreams = 17,
|
||||
IsSecondaryAudio
|
||||
IsSecondaryAudio = 18,
|
||||
VideoCodecTag = 19
|
||||
}
|
||||
}
|
||||
@@ -571,6 +571,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate;
|
||||
bool? isAnamorphic = videoStream == null ? null : videoStream.IsAnamorphic;
|
||||
bool? isCabac = videoStream == null ? null : videoStream.IsCabac;
|
||||
string videoCodecTag = videoStream == null ? null : videoStream.CodecTag;
|
||||
|
||||
int? audioBitrate = audioStream == null ? null : audioStream.BitRate;
|
||||
int? audioChannels = audioStream == null ? null : audioStream.Channels;
|
||||
@@ -586,7 +587,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
// Check container conditions
|
||||
foreach (ProfileCondition i in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames, numVideoStreams, numAudioStreams))
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames, numVideoStreams, numAudioStreams, videoCodecTag))
|
||||
{
|
||||
LogConditionFailure(profile, "VideoContainerProfile", i, mediaSource);
|
||||
|
||||
@@ -619,7 +620,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
foreach (ProfileCondition i in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames, numVideoStreams, numAudioStreams))
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isCabac, refFrames, numVideoStreams, numAudioStreams, videoCodecTag))
|
||||
{
|
||||
LogConditionFailure(profile, "VideoCodecProfile", i, mediaSource);
|
||||
|
||||
@@ -966,8 +967,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new ArgumentException("Unrecognized ProfileConditionValue");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,6 +489,21 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target video codec tag.
|
||||
/// </summary>
|
||||
/// <value>The target video codec tag.</value>
|
||||
public string TargetVideoCodecTag
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetVideoStream;
|
||||
return !IsDirectStream
|
||||
? null
|
||||
: stream == null ? null : stream.CodecTag;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio bitrate that will be in the output stream
|
||||
/// </summary>
|
||||
|
||||
@@ -18,6 +18,12 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <value>The codec.</value>
|
||||
public string Codec { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the codec tag.
|
||||
/// </summary>
|
||||
/// <value>The codec tag.</value>
|
||||
public string CodecTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the language.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user