Split into legacy (Framework 4.8) and .NET 8 projects, WIP .NET 8 fixes

This commit is contained in:
N00MKRAD
2024-08-12 10:47:19 +02:00
parent 6c406a4846
commit b520d7212d
340 changed files with 50433 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
namespace Flowframes.Data.Streams
{
public class AttachmentStream : Stream
{
public string Filename { get; } = "";
public string MimeType { get; } = "";
public AttachmentStream(string codec, string codecLong, string filename, string mimeType)
{
base.Type = StreamType.Attachment;
Codec = codec;
CodecLong = codecLong;
Filename = filename;
MimeType = mimeType;
}
public override string ToString()
{
return $"{base.ToString()} - Filename: {Filename} - MIME Type: {MimeType}";
}
}
}

View File

@@ -0,0 +1,29 @@
namespace Flowframes.Data.Streams
{
public class AudioStream : Stream
{
public int Kbits { get; }
public int SampleRate { get; }
public int Channels { get; }
public string Layout { get; }
public AudioStream(string language, string title, string codec, string codecLong, int kbits, int sampleRate, int channels, string layout)
{
base.Type = StreamType.Audio;
Language = language;
Title = title;
Codec = codec;
CodecLong = codecLong;
Kbits = kbits;
SampleRate = sampleRate;
Channels = channels;
Layout = layout;
}
public override string ToString()
{
string title = string.IsNullOrWhiteSpace(Title.Trim()) ? "None" : Title;
return $"{base.ToString()} - Language: {Language} - Title: {title} - Kbps: {Kbits} - SampleRate: {SampleRate} - Channels: {Channels} - Layout: {Layout}";
}
}
}

View File

@@ -0,0 +1,17 @@
namespace Flowframes.Data.Streams
{
public class DataStream : Stream
{
public DataStream(string codec, string codecLong)
{
base.Type = StreamType.Data;
Codec = codec;
CodecLong = codecLong;
}
public override string ToString()
{
return $"{base.ToString()}";
}
}
}

View File

@@ -0,0 +1,19 @@
namespace Flowframes.Data.Streams
{
public class Stream
{
public enum StreamType { Video, Audio, Subtitle, Data, Attachment, Unknown }
public StreamType Type;
public int Index = -1;
public bool IsDefault = false;
public string Codec = "";
public string CodecLong = "";
public string Language = "";
public string Title = "";
public override string ToString()
{
return $"Stream #{Index.ToString().PadLeft(2, '0')}{(IsDefault ? "*" : "")} - {Codec} {Type}";
}
}
}

View File

@@ -0,0 +1,26 @@
using Flowframes.Extensions;
namespace Flowframes.Data.Streams
{
public class SubtitleStream : Stream
{
public bool Bitmap { get; }
public SubtitleStream(string language, string title, string codec, string codecLong, bool bitmap)
{
base.Type = StreamType.Subtitle;
Language = language;
Title = title;
Codec = codec;
CodecLong = codecLong;
Bitmap = bitmap;
}
public override string ToString()
{
string lang = string.IsNullOrWhiteSpace(Language.Trim()) ? "?" : Language;
string ttl = string.IsNullOrWhiteSpace(Title.Trim()) ? "None" : Title;
return $"{base.ToString()} - Language: {lang} - Title: {ttl} - Bitmap-based: {Bitmap.ToString().ToTitleCase()}";
}
}
}

View File

@@ -0,0 +1,37 @@
using System.Drawing;
namespace Flowframes.Data.Streams
{
public class VideoStream : Stream
{
public int FrameCount { get; } = 0;
public string PixelFormat { get; }
public int Kbits { get; }
public Size Resolution { get; }
public Size Sar { get; }
public Size Dar { get; }
public FpsInfo FpsInfo { get; }
public Fraction Rate { get => FpsInfo.Fps; }
public VideoStream(string language, string title, string codec, string codecLong, string pixFmt, int kbits, Size resolution, Size sar, Size dar, FpsInfo fpsInf, int frameCount)
{
base.Type = StreamType.Video;
Codec = codec;
CodecLong = codecLong;
PixelFormat = pixFmt;
Kbits = kbits;
Resolution = resolution;
Sar = sar;
Dar = dar;
FpsInfo = fpsInf;
FrameCount = frameCount;
Language = language;
Title = title;
}
public override string ToString()
{
return $"{base.ToString()} - Language: {Language} - Color Format: {PixelFormat} - Size: {Resolution.Width}x{Resolution.Height} - FPS: {Rate}";
}
}
}