using System.Runtime.InteropServices; using Kyoo.Abstractions.Models; using Kyoo.Abstractions.Models.Attributes; namespace Kyoo.Core.Models.Watch { /// /// The unmanaged stream that the transcoder will return. /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] public class Stream { /// /// The title of the stream. /// public string Title { get; set; } /// /// The language of this stream (as a ISO-639-2 language code) /// public string Language { get; set; } /// /// The codec of this stream. /// public string Codec { get; set; } /// /// Is this stream the default one of it's type? /// [MarshalAs(UnmanagedType.I1)] public bool IsDefault; /// /// Is this stream tagged as forced? /// [MarshalAs(UnmanagedType.I1)] public bool IsForced; /// /// The path of this track. /// [SerializeIgnore] public string Path { get; set; } /// /// The type of this stream. /// [SerializeIgnore] public StreamType Type { get; set; } /// /// Create a track from this stream. /// /// A new track that represent this stream. public Track ToTrack() { return new() { Title = Title, Language = Language, Codec = Codec, IsDefault = IsDefault, IsForced = IsForced, Path = Path, Type = Type, IsExternal = false }; } } }