diff options
Diffstat (limited to 'MediaBrowser.MediaEncoding/Probing')
3 files changed, 102 insertions, 0 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs index c9c8c34c2..eab8f79bb 100644 --- a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs +++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs @@ -310,5 +310,12 @@ namespace MediaBrowser.MediaEncoding.Probing /// <value>The color primaries.</value> [JsonPropertyName("color_primaries")] public string ColorPrimaries { get; set; } + + /// <summary> + /// Gets or sets the side_data_list. + /// </summary> + /// <value>The side_data_list.</value> + [JsonPropertyName("side_data_list")] + public IReadOnlyList<MediaStreamInfoSideData> SideDataList { get; set; } } } diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs new file mode 100644 index 000000000..095757bef --- /dev/null +++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace MediaBrowser.MediaEncoding.Probing +{ + /// <summary> + /// Class MediaStreamInfoSideData. + /// </summary> + public class MediaStreamInfoSideData + { + /// <summary> + /// Gets or sets the SideDataType. + /// </summary> + /// <value>The SideDataType.</value> + [JsonPropertyName("side_data_type")] + public string? SideDataType { get; set; } + + /// <summary> + /// Gets or sets the DvVersionMajor. + /// </summary> + /// <value>The DvVersionMajor.</value> + [JsonPropertyName("dv_version_major")] + public int? DvVersionMajor { get; set; } + + /// <summary> + /// Gets or sets the DvVersionMinor. + /// </summary> + /// <value>The DvVersionMinor.</value> + [JsonPropertyName("dv_version_minor")] + public int? DvVersionMinor { get; set; } + + /// <summary> + /// Gets or sets the DvProfile. + /// </summary> + /// <value>The DvProfile.</value> + [JsonPropertyName("dv_profile")] + public int? DvProfile { get; set; } + + /// <summary> + /// Gets or sets the DvLevel. + /// </summary> + /// <value>The DvLevel.</value> + [JsonPropertyName("dv_level")] + public int? DvLevel { get; set; } + + /// <summary> + /// Gets or sets the RpuPresentFlag. + /// </summary> + /// <value>The RpuPresentFlag.</value> + [JsonPropertyName("rpu_present_flag")] + public int? RpuPresentFlag { get; set; } + + /// <summary> + /// Gets or sets the ElPresentFlag. + /// </summary> + /// <value>The ElPresentFlag.</value> + [JsonPropertyName("el_present_flag")] + public int? ElPresentFlag { get; set; } + + /// <summary> + /// Gets or sets the BlPresentFlag. + /// </summary> + /// <value>The BlPresentFlag.</value> + [JsonPropertyName("bl_present_flag")] + public int? BlPresentFlag { get; set; } + + /// <summary> + /// Gets or sets the DvBlSignalCompatibilityId. + /// </summary> + /// <value>The DvBlSignalCompatibilityId.</value> + [JsonPropertyName("dv_bl_signal_compatibility_id")] + public int? DvBlSignalCompatibilityId { get; set; } + } +} diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 3f78d0d42..74d7341e9 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -841,6 +841,27 @@ namespace MediaBrowser.MediaEncoding.Probing { stream.ColorPrimaries = streamInfo.ColorPrimaries; } + + if (streamInfo.SideDataList != null) + { + foreach (var data in streamInfo.SideDataList) + { + // Parse Dolby Vision metadata from side_data + if (string.Equals(data.SideDataType, "DOVI configuration record", StringComparison.OrdinalIgnoreCase)) + { + stream.DvVersionMajor = data.DvVersionMajor; + stream.DvVersionMinor = data.DvVersionMinor; + stream.DvProfile = data.DvProfile; + stream.DvLevel = data.DvLevel; + stream.RpuPresentFlag = data.RpuPresentFlag; + stream.ElPresentFlag = data.ElPresentFlag; + stream.BlPresentFlag = data.BlPresentFlag; + stream.DvBlSignalCompatibilityId = data.DvBlSignalCompatibilityId; + + break; + } + } + } } else { |
