mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 05:57:20 -04:00
Add json parser for DOVI side_data
This commit is contained in:
parent
d342b79218
commit
3f37ef70e1
4 changed files with 150 additions and 0 deletions
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
}
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -72,6 +72,54 @@ namespace MediaBrowser.Model.Entities
|
|||
/// <value>The color primaries.</value>
|
||||
public string ColorPrimaries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision version major.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision version major.</value>
|
||||
public int? DvVersionMajor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision version minor.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision version minor.</value>
|
||||
public int? DvVersionMinor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision profile.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision profile.</value>
|
||||
public int? DvProfile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision level.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision level.</value>
|
||||
public int? DvLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision rpu present flag.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision rpu present flag.</value>
|
||||
public int? RpuPresentFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision el present flag.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision el present flag.</value>
|
||||
public int? ElPresentFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision bl present flag.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision bl present flag.</value>
|
||||
public int? BlPresentFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision bl signal compatibility id.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision bl signal compatibility id.</value>
|
||||
public int? DvBlSignalCompatibilityId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the comment.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue