mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-25 04:39:25 +01:00
Split into legacy (Framework 4.8) and .NET 8 projects, WIP .NET 8 fixes
This commit is contained in:
22
Flowframes/Data/Streams/AttachmentStream.cs
Normal file
22
Flowframes/Data/Streams/AttachmentStream.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Flowframes/Data/Streams/AudioStream.cs
Normal file
29
Flowframes/Data/Streams/AudioStream.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Flowframes/Data/Streams/DataStream.cs
Normal file
17
Flowframes/Data/Streams/DataStream.cs
Normal 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()}";
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Flowframes/Data/Streams/Stream.cs
Normal file
19
Flowframes/Data/Streams/Stream.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Flowframes/Data/Streams/SubtitleStream.cs
Normal file
26
Flowframes/Data/Streams/SubtitleStream.cs
Normal 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()}";
|
||||
}
|
||||
}
|
||||
}
|
||||
37
Flowframes/Data/Streams/VideoStream.cs
Normal file
37
Flowframes/Data/Streams/VideoStream.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user