This commit is contained in:
45
CinemaLib/API/StreamVideo.cs
Normal file
45
CinemaLib/API/StreamVideo.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace CinemaLib.API;
|
||||
|
||||
public class StreamVideo
|
||||
{
|
||||
public int width { get; set; } // horizontal resolution in pixels
|
||||
public int height { get; set; } // vertical resolution in pixels
|
||||
public string codec { get; set; } // ie. AVC
|
||||
public double? aspect { get; set; } // aspect ratio, ie. 1.778
|
||||
[JsonPropertyName("hdr")]
|
||||
public JsonElement? hdr_raw_donotuse { get; set; } // ie. Dolby Vision / SMPTE ST 2086
|
||||
[JsonIgnore()]
|
||||
public bool hasHdr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (hdr_raw_donotuse == null)
|
||||
return false;
|
||||
|
||||
switch (hdr_raw_donotuse.Value.ValueKind) {
|
||||
case JsonValueKind.True: return true;
|
||||
case JsonValueKind.False: return false;
|
||||
case JsonValueKind.String: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
[JsonIgnore()]
|
||||
public string? hdrQuality // ie. Dolby Vision / SMPTE ST 2086
|
||||
{
|
||||
get
|
||||
{
|
||||
return hdr_raw_donotuse != null && hdr_raw_donotuse.Value.ValueKind == JsonValueKind.String
|
||||
? hdr_raw_donotuse.Value.GetString()
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("3d")]
|
||||
public bool is3d { get; set; }
|
||||
public double? duration { get; set; } // in seconds
|
||||
}
|
||||
Reference in New Issue
Block a user