Explorar o código

Add json parser for video rotation side data

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
nyanmisaka hai 1 ano
pai
achega
bf654bde60

+ 7 - 0
MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs

@@ -69,5 +69,12 @@ namespace MediaBrowser.MediaEncoding.Probing
         /// <value>The DvBlSignalCompatibilityId.</value>
         [JsonPropertyName("dv_bl_signal_compatibility_id")]
         public int? DvBlSignalCompatibilityId { get; set; }
+
+        /// <summary>
+        /// Gets or sets the Rotation.
+        /// </summary>
+        /// <value>The Rotation.</value>
+        [JsonPropertyName("rotation")]
+        public int? Rotation { get; set; }
     }
 }

+ 5 - 1
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;
                         }
                     }
                 }

+ 6 - 0
MediaBrowser.Model/Entities/MediaStream.cs

@@ -122,6 +122,12 @@ namespace MediaBrowser.Model.Entities
         /// <value>The Dolby Vision bl signal compatibility id.</value>
         public int? DvBlSignalCompatibilityId { get; set; }
 
+        /// <summary>
+        /// Gets or sets the Rotation.
+        /// </summary>
+        /// <value>The video rotation.</value>
+        public int? Rotation { get; set; }
+
         /// <summary>
         /// Gets or sets the comment.
         /// </summary>