From bf654bde600fa6a67b19d27cf82f600a47ca3638 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Sat, 30 Mar 2024 05:55:15 +0800 Subject: [PATCH] Add json parser for video rotation side data Signed-off-by: nyanmisaka --- .../Probing/MediaStreamInfoSideData.cs | 7 +++++++ .../Probing/ProbeResultNormalizer.cs | 6 +++++- MediaBrowser.Model/Entities/MediaStream.cs | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs index 5dbc438e44..65d1ddf892 100644 --- a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs +++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs @@ -69,5 +69,12 @@ namespace MediaBrowser.MediaEncoding.Probing /// The DvBlSignalCompatibilityId. [JsonPropertyName("dv_bl_signal_compatibility_id")] public int? DvBlSignalCompatibilityId { get; set; } + + /// + /// Gets or sets the Rotation. + /// + /// The Rotation. + [JsonPropertyName("rotation")] + public int? Rotation { get; set; } } } diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 5397a6752d..0a42d504a8 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -887,8 +887,12 @@ namespace MediaBrowser.MediaEncoding.Probing stream.ElPresentFlag = data.ElPresentFlag; stream.BlPresentFlag = data.BlPresentFlag; stream.DvBlSignalCompatibilityId = data.DvBlSignalCompatibilityId; + } - break; + // Parse video rotation metadata from side_data + else if (string.Equals(data.SideDataType, "Display Matrix", StringComparison.OrdinalIgnoreCase)) + { + stream.Rotation = data.Rotation; } } } diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index a620bc9b54..fa09902e53 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -122,6 +122,12 @@ namespace MediaBrowser.Model.Entities /// The Dolby Vision bl signal compatibility id. public int? DvBlSignalCompatibilityId { get; set; } + /// + /// Gets or sets the Rotation. + /// + /// The video rotation. + public int? Rotation { get; set; } + /// /// Gets or sets the comment. ///