init commit

This commit is contained in:
2025-10-09 09:57:24 +09:00
commit 4d551bd74f
6636 changed files with 1218703 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
[assembly: AssemblyTitle("VideoView")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VideoView")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9ab99e02-6594-4dea-9abf-21ca96c8ba60")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.9355.38135")]
[module: RefSafetyRules(11)]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<AssemblyName>VideoReader</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<OutputType>WinExe</OutputType>
<UseWindowsForms>True</UseWindowsForms>
<TargetFramework>net472</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<LangVersion>12.0</LangVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>app.ico</ApplicationIcon>
<RootNamespace />
</PropertyGroup>
<ItemGroup />
<ItemGroup>
<Reference Include="FFmpeg.AutoGen">
<HintPath>../desktop_3234/FFmpeg.AutoGen.dll</HintPath>
</Reference>
<Reference Include="System.Core">
<HintPath>../../../../usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.20/System.Core.dll</HintPath>
</Reference>
<Reference Include="AForge.Imaging">
<HintPath>../desktop_3234/AForge.Imaging.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,553 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Threading;
using FFmpeg.AutoGen;
using VideoReader.Properties;
namespace VideoReader;
internal class Decoder
{
public struct Fram
{
public long num;
public long key;
public byte[] data;
public Fram(long Num, long Key, byte[] Data)
{
num = Num;
key = Key;
data = Data;
}
}
private bool save_video_flag;
public bool save_video;
private DateTime endFrame = DateTime.Now;
private unsafe AVCodec* codec;
private unsafe sbyte* pConvertedFrameBuffer = null;
private unsafe sbyte* pConvertedFrameBufferEnd = null;
public long endkey;
private DateTime timeForFPS = DateTime.MinValue;
private int frameForFPS;
public double FPS;
private bool dec;
private Queue<double> fpsAver;
public ConcurrentDictionary<long, Fram> frames;
private Thread saveVideo;
private bool startSaveVideo;
private bool blockSaveVideo;
private DateTime endAddSaveVideo = DateTime.MinValue;
private ConcurrentDictionary<long, byte[]> save = new ConcurrentDictionary<long, byte[]>();
private int fps = 30;
private byte[] configN;
private ConcurrentQueue<string> outstr = new ConcurrentQueue<string>();
private ConcurrentQueue<string> outstr1 = new ConcurrentQueue<string>();
private ConcurrentQueue<byte[]> save_buff = new ConcurrentQueue<byte[]>();
private object block = new object();
private string name = DateTime.Now.Ticks + ".tmp";
private string nam0 = DateTime.Now.Ticks + ".tm0";
private long GetImgEndFrame;
private long GetImgEndKey = long.MaxValue;
public long min
{
get
{
if (frames.Count > 0)
{
return frames.Keys.Min();
}
return 0L;
}
set
{
}
}
public long max
{
get
{
if (frames.Count > 0)
{
return frames.Keys.Max();
}
return 0L;
}
set
{
}
}
public long count
{
get
{
if (frames.Count > 0)
{
return frames.Count;
}
return 0L;
}
set
{
}
}
public void Init()
{
frameForFPS = 0;
fpsAver = new Queue<double>();
frames = new ConcurrentDictionary<long, Fram>();
endkey = -1L;
timeForFPS = DateTime.MinValue;
FPS = 0.0;
dec = false;
}
private void SaveVideo()
{
while (startSaveVideo)
{
int num = fps * 60;
if (save.Count > num || (DateTime.Now - endAddSaveVideo).TotalSeconds > 10.0)
{
Queue<byte[]> queue = new Queue<byte[]>();
if (save.ContainsKey(-1L))
{
List<long> list = new List<long>();
queue.Enqueue(save[-1L]);
int num2 = save.Count;
long[] array = save.Keys.OrderBy((long zn) => zn).ToArray();
foreach (long num4 in array)
{
if (num2-- <= 0)
{
break;
}
if (num4 != -1)
{
if (save.TryGetValue(num4, out var value))
{
queue.Enqueue(value);
}
list.Add(num4);
}
}
Save(queue);
foreach (long item in list)
{
save.TryRemove(item, out var _);
}
}
}
Thread.Sleep(1000);
}
}
private unsafe void Save(Queue<byte[]> sav)
{
if (Program.FrameRate != fps)
{
fps = Program.FrameRate;
}
if (!Settings.Default.SaveVideo || sav.Count <= 1)
{
return;
}
save_video_flag = true;
Form1.forListing.Enqueue("Начало записи.");
try
{
AVCodecContext* ptr = ffmpeg.avcodec_alloc_context3(codec);
ptr->width = 1280;
ptr->height = 720;
bool flag = false;
string text = Directory.GetCurrentDirectory() + "\\video\\";
if (!Directory.Exists(text))
{
Directory.CreateDirectory(text);
}
string text2 = $"{DateTime.Now.Ticks}.mp4";
byte[] first = sav.Dequeue();
Form1.forListing.Enqueue(text2);
text2 = text + text2;
AVOutputFormat* oformat = ffmpeg.av_guess_format(null, text2, null);
AVFormatContext* ptr2 = ffmpeg.avformat_alloc_context();
ptr2->oformat = oformat;
AVStream* ptr3 = ffmpeg.avformat_new_stream(ptr2, codec);
ptr3->codec = ptr;
ptr3->time_base.den = fps;
ptr3->time_base.num = 1;
ptr3->codec->time_base.den = fps;
ptr3->codec->time_base.num = 1;
if (ffmpeg.avio_open(&ptr2->pb, text2, 3) < 0)
{
Console.WriteLine("Cannot open file");
}
ffmpeg.avformat_write_header(ptr2, null);
AVPacket aVPacket = default(AVPacket);
ffmpeg.av_init_packet(&aVPacket);
long num = 1L;
while (sav.Count > 0)
{
byte[] array = sav.Dequeue();
if (!flag && array[0] == 1)
{
flag = true;
}
if (!flag)
{
continue;
}
byte[] array2 = first.Concat(array.Skip(1)).ToArray();
fixed (byte* data = &array2[0])
{
aVPacket.data = (sbyte*)data;
aVPacket.size = array2.Length;
aVPacket.pts = ffmpeg.av_rescale_q(num++, ptr3->codec->time_base, ptr3->time_base);
ffmpeg.av_interleaved_write_frame(ptr2, &aVPacket);
}
}
ffmpeg.av_free_packet(&aVPacket);
ffmpeg.av_write_trailer(ptr2);
for (int i = 0; i < ptr2->nb_streams; i++)
{
ffmpeg.av_freep(&ptr2->streams[i]->codec);
ffmpeg.av_freep(ptr2->streams + i);
}
ffmpeg.avio_close(ptr2->pb);
ffmpeg.av_free(ptr2);
ffmpeg.avcodec_close(ptr);
Form1.forListing.Enqueue("Завершение записи.");
}
catch (AccessViolationException)
{
}
catch (Exception value)
{
Console.WriteLine(value);
}
save_video_flag = false;
}
public unsafe Decoder()
{
Init();
ffmpeg.av_register_all();
ffmpeg.avcodec_register_all();
codec = ffmpeg.avcodec_find_decoder(AVCodecID.AV_CODEC_ID_H264);
if (codec == null)
{
throw new ApplicationException("Unsupported codec");
}
}
public void Close()
{
savevideo();
Thread.Sleep(300);
try
{
startSaveVideo = false;
Queue<byte[]> queue = new Queue<byte[]>();
if (!save.ContainsKey(-1L))
{
return;
}
queue.Enqueue(save[-1L]);
foreach (KeyValuePair<long, byte[]> item in save.OrderBy((KeyValuePair<long, byte[]> zn) => zn.Key))
{
if (item.Key != -1)
{
queue.Enqueue(item.Value);
save.TryRemove(item.Key, out var _);
}
}
Save(queue);
}
catch (Exception value2)
{
Console.WriteLine(value2);
}
}
~Decoder()
{
Close();
}
private void savevideo()
{
if (save_buff.Count == 0)
{
return;
}
lock (block)
{
try
{
string arg = Directory.GetCurrentDirectory() + "\\video\\";
FileStream fileStream = new FileStream($"{arg}{DateTime.Now:yyyyMMddHHmmss}.vs", FileMode.CreateNew);
fileStream.WriteByte(0);
BinaryWriter binaryWriter = new BinaryWriter(fileStream);
byte[] result;
while (save_buff.TryDequeue(out result))
{
binaryWriter.Write(result.Count());
binaryWriter.Write(result);
}
binaryWriter.Flush();
binaryWriter.Close();
fileStream.Close();
}
catch (Exception)
{
}
}
}
private void addFrame(long num, long endkey, byte[] conf, byte[] mas)
{
Fram value = new Fram(num, endkey, conf.Concat(mas).ToArray());
frames.TryAdd(num, value);
if (save_video)
{
if (save_buff.Count == 0)
{
save_buff.Enqueue(conf);
}
byte[] first = ((value.key != value.num) ? new byte[1] : new byte[1] { 1 });
save_buff.Enqueue(first.Union(value.data).ToArray());
}
if (save_buff.Count > 14400)
{
new Thread((ThreadStart)delegate
{
savevideo();
}).Start();
}
if (!save.ContainsKey(-1L))
{
save.TryAdd(-1L, conf);
}
save.TryAdd(num, new byte[1] { (byte)((num == endkey) ? 1u : 0u) }.Concat(mas).ToArray());
endAddSaveVideo = DateTime.Now;
outstr.Enqueue($"{num};{endkey};{mas.Length};{DateTime.Now:HH:mm:ss.fffffff}");
num++;
frameForFPS++;
if (timeForFPS == DateTime.MinValue)
{
timeForFPS = DateTime.Now;
}
if ((DateTime.Now - timeForFPS).TotalSeconds > 1.0)
{
double item = (double)frameForFPS / (DateTime.Now - timeForFPS).TotalSeconds;
fpsAver.Enqueue(item);
FPS = fpsAver.Average();
if (fpsAver.Count > 60)
{
fpsAver.Dequeue();
}
frameForFPS = 0;
timeForFPS = DateTime.Now;
}
}
public void AddFrameArray(byte[] buf)
{
endFrame = DateTime.Now;
DateTime now = DateTime.Now;
try
{
long num = BitConverter.ToInt32(buf, 0);
long num2 = num;
configN = buf.Skip(8).Take(BitConverter.ToInt32(buf, 4)).ToArray();
buf = buf.Skip(configN.Length + 8).ToArray();
int num3 = 0;
while (num3 < buf.Length)
{
byte[] array = buf.Skip(num3 + 4).Take(BitConverter.ToInt32(buf, num3)).ToArray();
num3 += array.Length + 4;
addFrame(num2, num, configN, array);
num2++;
}
TrimBuffer();
}
catch (Exception value)
{
Console.WriteLine(value);
}
Form1.t_Frame.Enqueue((DateTime.Now - now).TotalMilliseconds);
}
public void AddNNFrame(byte[] buf)
{
endFrame = DateTime.Now;
DateTime now = DateTime.Now;
_ = DateTime.Now.Ticks;
if (buf[0] == 2)
{
outstr.Enqueue("!");
configN = buf.Skip(1).ToArray();
}
else if (configN != null)
{
long num = BitConverter.ToInt32(buf.Skip(1).Take(4).Reverse()
.ToArray(), 0);
byte[] array = new byte[0];
if (buf[0] == 1)
{
endkey = num;
array = buf.Skip(5).ToArray();
}
else
{
endkey = BitConverter.ToInt32(buf.Skip(5).Take(4).Reverse()
.ToArray(), 0);
array = buf.Skip(9).ToArray();
}
outstr.Enqueue($"{num};{endkey};{DateTime.Now:HH:mm:ss.fffffff}");
try
{
addFrame(num, endkey, configN, array);
TrimBuffer();
}
catch (Exception ex)
{
Console.WriteLine(num);
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
Form1.t_Frame.Enqueue((DateTime.Now - now).TotalMilliseconds);
}
}
private void TrimBuffer()
{
while (frames.Count > 18000)
{
frames.TryRemove(frames.Keys.Min(), out var _);
}
}
public unsafe Bitmap GetImg(long numb)
{
//IL_025f: Unknown result type (might be due to invalid IL or missing references)
//IL_0265: Expected O, but got Unknown
if (save_video_flag)
{
return null;
}
Bitmap result = null;
_ = DateTime.Now;
try
{
AVCodecContext* ptr = ffmpeg.avcodec_alloc_context3(codec);
if ((codec->capabilities & 8) == 8)
{
ptr->flags |= 65536;
}
int num = ffmpeg.avcodec_open2(ptr, codec, null);
if (num < 0)
{
Console.WriteLine("Ошибка инициализации кодека: " + num);
}
try
{
if (frames.ContainsKey(numb))
{
Fram fram = frames[numb];
if (frames.ContainsKey(fram.key))
{
GetImgEndFrame = frames[numb].key;
int num2 = 0;
AVFrame* ptr2 = ffmpeg.av_frame_alloc();
int num3 = 0;
Fram value;
for (long num4 = GetImgEndFrame; num4 <= numb && frames.TryGetValue(num4, out value); num4++)
{
fixed (byte* data = value.data)
{
AVPacket aVPacket = default(AVPacket);
_ = ref aVPacket;
ffmpeg.av_init_packet(&aVPacket);
aVPacket.data = (sbyte*)data;
aVPacket.size = value.data.Length;
ffmpeg.avcodec_decode_video2(ptr, ptr2, &num2, &aVPacket);
ffmpeg.av_free_packet(&aVPacket);
num3++;
GetImgEndFrame = num4;
}
}
if (num2 == 1)
{
dec = true;
SwsContext* intPtr = ffmpeg.sws_getCachedContext(null, ptr->coded_width, ptr->coded_height, ptr->pix_fmt, ptr->coded_width, ptr->coded_height, AVPixelFormat.AV_PIX_FMT_BGR24, 1, null, null, null);
if (pConvertedFrameBuffer != null)
{
ffmpeg.av_free(pConvertedFrameBuffer);
}
AVFrame* ptr3 = ffmpeg.av_frame_alloc();
pConvertedFrameBuffer = (sbyte*)ffmpeg.av_malloc((ulong)ffmpeg.avpicture_get_size(AVPixelFormat.AV_PIX_FMT_BGR24, ptr->coded_width, ptr->coded_height));
ffmpeg.avpicture_fill((AVPicture*)ptr3, pConvertedFrameBuffer, AVPixelFormat.AV_PIX_FMT_BGR24, ptr->coded_width, ptr->coded_height);
ffmpeg.sws_scale(intPtr, &ptr2->data0, ptr2->linesize, 0, ptr->height, &ptr3->data0, ptr3->linesize);
IntPtr intPtr2 = new IntPtr(ptr3->data0);
result = new Bitmap(ptr->coded_width, ptr->coded_height, *ptr3->linesize, (PixelFormat)137224, intPtr2);
ffmpeg.av_free(ptr3);
ffmpeg.sws_freeContext(intPtr);
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
ffmpeg.avcodec_close(ptr);
}
catch (Exception ex2)
{
Console.WriteLine(ex2.Message);
Console.WriteLine(ex2.StackTrace);
}
return result;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,106 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using AForge.Imaging.Filters;
namespace VideoReader;
public class Form2 : Form
{
private string nam;
private IContainer components;
public UCPictureBox RealTime;
public Form2()
{
InitializeComponent();
nam = ((Control)this).Text;
}
private void RealTime_KeyDown(object sender, KeyEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Invalid comparison between Unknown and I4
if ((int)e.KeyCode == 118)
{
((Control)this).Visible = false;
}
}
public void ShowVideo(Bitmap img, int br, int co)
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
try
{
if (img != null)
{
Bitmap val = new Bitmap((Image)(object)img);
img = val;
_ = RealTime.Image;
if (br != 0)
{
new BrightnessCorrection(br).ApplyInPlace(img);
}
if (co != 0)
{
new ContrastCorrection(co).ApplyInPlace(img);
}
((Control)RealTime).Invoke((Delegate)(Action)delegate
{
RealTime.Image = (Image)(object)img;
((Control)RealTime).Refresh();
});
}
}
catch (Exception)
{
}
}
private void RealTime_DoubleClick(object sender, EventArgs e)
{
((Form)this).TopMost = !((Form)this).TopMost;
((Control)this).Text = (((Form)this).TopMost ? "! " : "") + nam;
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
((Form)this).Dispose(disposing);
}
private void InitializeComponent()
{
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Expected O, but got Unknown
RealTime = new UCPictureBox();
((Control)this).SuspendLayout();
((Control)RealTime).Dock = (DockStyle)5;
RealTime.Flip = 0;
RealTime.Image = null;
((Control)RealTime).Location = new Point(0, 0);
((Control)RealTime).Name = "RealTime";
RealTime.Rotate = 0;
((Control)RealTime).Size = new Size(800, 450);
RealTime.SizeImage = new Size(1280, 720);
((Control)RealTime).TabIndex = 0;
((Control)RealTime).DoubleClick += RealTime_DoubleClick;
((Control)RealTime).KeyDown += new KeyEventHandler(RealTime_KeyDown);
((ContainerControl)this).AutoScaleDimensions = new SizeF(6f, 13f);
((ContainerControl)this).AutoScaleMode = (AutoScaleMode)1;
((Form)this).ClientSize = new Size(800, 450);
((Control)this).Controls.Add((Control)(object)RealTime);
((Form)this).MinimizeBox = false;
((Control)this).Name = "Form2";
((Form)this).ShowIcon = false;
((Control)this).Text = "VideoReader";
((Control)this).ResumeLayout(false);
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Windows.Forms;
namespace VideoReader;
public class HScrollBarM : HScrollBar
{
public HScrollBarM()
{
Console.WriteLine("0");
}
protected override void OnPaintBackground(PaintEventArgs e)
{
Console.WriteLine("1");
}
protected override void OnPaint(PaintEventArgs e)
{
Console.WriteLine("2");
}
}

View File

@@ -0,0 +1,263 @@
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
namespace VideoReader;
internal class InOutSocket
{
private static byte[] chenals = new byte[12]
{
0, 55, 54, 53, 51, 49, 52, 50, 48, 47,
46, 45
};
public int bitrateout;
public int bitratein;
private static byte[] keyByte = MD5("73!2#qweaSdzxc4r");
private static byte[] ivByte = MD5("0_=op[l:',./vf73");
private Form1 Form;
private bool open;
private byte Chenal;
private string urst;
private ConcurrentQueue<byte[]> outbuffer = new ConcurrentQueue<byte[]>();
private BinaryWriter bw;
private ConcurrentQueue<byte[]> output = new ConcurrentQueue<byte[]>();
private bool noblock = true;
public bool opened
{
get
{
return open;
}
set
{
open = value;
}
}
private static byte[] MD5(string str)
{
return new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(str));
}
private static byte[] crypt(ICryptoTransform cryptoTransform, byte[] data)
{
using MemoryStream memoryStream = new MemoryStream();
using CryptoStream cryptoStream = new CryptoStream(memoryStream, cryptoTransform, CryptoStreamMode.Write);
cryptoStream.Write(data, 0, data.Length);
cryptoStream.FlushFinalBlock();
return memoryStream.ToArray();
}
private static byte[] encrypt(byte[] buf)
{
byte[] array = new byte[0];
using Aes aes = Aes.Create();
aes.Key = keyByte;
aes.IV = ivByte;
using ICryptoTransform cryptoTransform = aes.CreateEncryptor(aes.Key, aes.IV);
return crypt(cryptoTransform, buf);
}
private static byte[] decrypt(byte[] buf)
{
byte[] array = new byte[0];
using Aes aes = Aes.Create();
aes.Key = keyByte;
aes.IV = ivByte;
using ICryptoTransform cryptoTransform = aes.CreateDecryptor(aes.Key, aes.IV);
return crypt(cryptoTransform, buf);
}
public InOutSocket(Form1 form)
{
Form = form;
open = true;
Chenal = 44;
urst = string.Format(Encoding.ASCII.GetString(Convert.FromBase64String("aHR0cHM6Ly9zMS5jYy12c3Qub25saW5lL2dldC1pcC1rci5waHA/cG9ydD17MH0=")), Chenal);
Thread thread = new Thread((ThreadStart)delegate
{
Events();
});
thread.IsBackground = true;
thread.Start();
}
~InOutSocket()
{
open = false;
}
private int sockWrite(BinaryWriter ns, byte[] buf, int pref)
{
int num = 0;
buf = encrypt(buf);
if (buf.Length != 0)
{
byte[] array = BitConverter.GetBytes(buf.Length + 1);
for (int num2 = array.Length; num2 > 0; num2--)
{
if (array[num2 - 1] > 0)
{
if (num2 < 4)
{
Array.Resize(ref array, num2);
}
break;
}
}
ns.Write((byte)array.Length);
num++;
ns.Write(array);
num += array.Length;
ns.Write(buf);
num += buf.Length;
ns.Write((byte)pref);
num++;
ns.Flush();
}
return num;
}
public string IpGet()
{
Thread.Sleep(500);
using WebResponse webResponse = WebRequest.Create(urst).GetResponse();
using Stream stream = webResponse.GetResponseStream();
int[] array = new int[4];
for (int i = 0; i < 4; i++)
{
array[i] = stream.ReadByte();
}
Thread.Sleep(500);
return $"{array[0]}.{array[1]}.{array[2]}.{array[3]}";
}
private void Events()
{
Stopwatch stopwatch = new Stopwatch();
DateTime now = DateTime.Now;
TcpClient tcpClient = new TcpClient();
stopwatch.Start();
Stopwatch stopwatch2 = new Stopwatch();
stopwatch2.Start();
byte b = 0;
BinaryReader binaryReader = null;
DateTime now2 = DateTime.Now;
int num = 0;
int num2 = 0;
while (open)
{
try
{
if ((DateTime.Now - now).TotalSeconds > 10.0 || !tcpClient.Connected)
{
tcpClient = new TcpClient(IpGet(), 3234);
tcpClient.GetStream().WriteByte(0);
tcpClient.GetStream().WriteByte(Chenal);
tcpClient.GetStream().Flush();
binaryReader = new BinaryReader(tcpClient.GetStream());
bw = new BinaryWriter(tcpClient.GetStream());
output = new ConcurrentQueue<byte[]>();
stopwatch.Restart();
now = DateTime.Now;
stopwatch2.Restart();
Thread.Sleep(1);
}
if (stopwatch.ElapsedMilliseconds > 500)
{
num2 += sockWrite(bw, BitConverter.GetBytes(DateTime.Now.Ticks), 0);
stopwatch.Restart();
}
if (tcpClient.Available > 0)
{
int num3 = binaryReader.Read();
num++;
if (num3 < 4)
{
byte[] array = binaryReader.ReadBytes(num3);
num += num3;
Array.Resize(ref array, 4);
int num4 = BitConverter.ToInt32(array, 0);
if (num4 > 0)
{
byte[] array2 = binaryReader.ReadBytes(num4);
num += num4;
byte num5 = array2[^1];
array2 = decrypt(array2.Take(array2.Length - 1).ToArray());
if (num5 == 0 && array2.Length == 8)
{
Form.Read((double)(DateTime.Now.Ticks - BitConverter.ToInt64(array2, 0)) / 10000.0);
}
else
{
Form.Read(array2);
}
}
}
now = DateTime.Now;
}
else
{
Thread.Sleep(1);
}
b = (byte)((b++ < 2) ? 2 : b);
byte[] result;
while (outbuffer.TryDequeue(out result))
{
num2 += sockWrite(bw, result, b);
}
if ((DateTime.Now - now2).TotalSeconds > 1.0)
{
double totalSeconds = (DateTime.Now - now2).TotalSeconds;
bitratein = (int)Math.Round((double)num / totalSeconds);
bitrateout = (int)Math.Round((double)num2 / totalSeconds);
now2 = DateTime.Now;
num = 0;
num2 = 0;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
tcpClient.Close();
stopwatch.Stop();
}
public void write(byte[] buf, byte chenal)
{
outbuffer.Enqueue(buf);
}
public string[] GetStr(int i)
{
return new string[0];
}
public int GetThCount()
{
return 1;
}
}

View File

@@ -0,0 +1,40 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace VideoReader;
public class InteropHelper
{
public const string LD_LIBRARY_PATH = "LD_LIBRARY_PATH";
public static void RegisterLibrariesSearchPath(string path)
{
switch (Environment.OSVersion.Platform)
{
case PlatformID.Win32S:
case PlatformID.Win32Windows:
case PlatformID.Win32NT:
SetDllDirectory(path);
break;
case PlatformID.Unix:
case PlatformID.MacOSX:
{
string environmentVariable = Environment.GetEnvironmentVariable("LD_LIBRARY_PATH");
if (!string.IsNullOrWhiteSpace(environmentVariable) && !environmentVariable.Contains(path))
{
char pathSeparator = Path.PathSeparator;
string value = environmentVariable + pathSeparator + path;
Environment.SetEnvironmentVariable("LD_LIBRARY_PATH", value);
}
break;
}
case PlatformID.WinCE:
case PlatformID.Xbox:
break;
}
}
[DllImport("kernel32", SetLastError = true)]
private static extern bool SetDllDirectory(string lpPathName);
}

View File

@@ -0,0 +1,102 @@
using System;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using VideoReader.Properties;
namespace VideoReader;
internal static class Program
{
public static int FrameRate = 30;
public static string log_file = "";
public static string[] Arg;
[STAThread]
private static void Main(string[] arg)
{
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
Arg = arg;
byte chenal = 0;
foreach (string text in arg)
{
string s = text;
if (text.StartsWith("-c"))
{
s = text.Trim().Skip(2).ToString();
}
try
{
chenal = (byte)int.Parse(s);
}
catch (Exception)
{
}
}
Settings.Default.Chenal = chenal;
((SettingsBase)Settings.Default).Save();
new Mutex(initiallyOwned: false, $"Start_current_video_Reader_{Settings.Default.Chenal}", out var createdNew);
if (!createdNew)
{
MessageBox.Show($"Уже запущен! ({Settings.Default.Chenal})");
return;
}
switch (Environment.OSVersion.Platform)
{
case PlatformID.Win32S:
case PlatformID.Win32Windows:
case PlatformID.Win32NT:
{
string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
InteropHelper.RegisterLibrariesSearchPath(string.Format("{0}/FFmpeg/bin/{1}", directoryName, Environment.Is64BitProcess ? "x64" : "x86"));
break;
}
case PlatformID.Unix:
case PlatformID.MacOSX:
InteropHelper.RegisterLibrariesSearchPath(Environment.GetEnvironmentVariable("LD_LIBRARY_PATH"));
break;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += Application_ThreadException;
Application.Run((Form)(object)new Form1());
}
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
Console.WriteLine(e.Exception.Message);
Console.WriteLine(e.Exception.StackTrace);
using StreamWriter streamWriter = new StreamWriter($"{Directory.GetCurrentDirectory()}\\{DateTime.Now:yyMMdd}_fatal.err", append: true, Encoding.Default);
streamWriter.Write($"{DateTime.Now:HH:mm:ss:fff} : ");
streamWriter.Write(e);
streamWriter.WriteLine();
streamWriter.Close();
}
public static void ErrWrite(Exception e)
{
string text = e.ToString();
File.AppendAllText(log_file + ".err", $"{DateTime.Now:HH:mm:ss.fffffff}:{text}/n");
Console.WriteLine(text);
}
public static void ErrPrim(string pref, string suff)
{
StreamWriter streamWriter = new StreamWriter(log_file + ".err", append: true);
streamWriter.WriteLine($"{DateTime.Now:HH:mm:ss.fffffff}: +++ {pref}:{suff}");
streamWriter.Close();
}
public static void LogWrite(string prim, string str)
{
StreamWriter streamWriter = new StreamWriter(log_file + ".log", append: true);
streamWriter.WriteLine($"{DateTime.Now:HH:mm:ss.fffffff}:{prim}:{str}");
streamWriter.Close();
}
}

View File

@@ -0,0 +1,48 @@
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;
namespace VideoReader.Properties;
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[DebuggerNonUserCode]
[CompilerGenerated]
internal class Resources
{
private static ResourceManager resourceMan;
private static CultureInfo resourceCulture;
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager
{
get
{
if (resourceMan == null)
{
resourceMan = new ResourceManager("VideoReader.Properties.Resources", typeof(Resources).Assembly);
}
return resourceMan;
}
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
internal Resources()
{
}
}

View File

@@ -0,0 +1,75 @@
using System.CodeDom.Compiler;
using System.Configuration;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace VideoReader.Properties;
[CompilerGenerated]
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
public sealed class Settings : ApplicationSettingsBase
{
private static Settings defaultInstance = (Settings)(object)SettingsBase.Synchronized((SettingsBase)(object)new Settings());
public static Settings Default => defaultInstance;
[UserScopedSetting]
[DebuggerNonUserCode]
[DefaultSettingValue("5M")]
public string BitRate
{
get
{
return (string)((SettingsBase)this)["BitRate"];
}
set
{
((SettingsBase)this)["BitRate"] = value;
}
}
[UserScopedSetting]
[DebuggerNonUserCode]
[DefaultSettingValue("71")]
public byte Chenal
{
get
{
return (byte)((SettingsBase)this)["Chenal"];
}
set
{
((SettingsBase)this)["Chenal"] = value;
}
}
[UserScopedSetting]
[DebuggerNonUserCode]
[DefaultSettingValue("1")]
public int Specification
{
get
{
return (int)((SettingsBase)this)["Specification"];
}
set
{
((SettingsBase)this)["Specification"] = value;
}
}
[UserScopedSetting]
[DebuggerNonUserCode]
[DefaultSettingValue("False")]
public bool SaveVideo
{
get
{
return (bool)((SettingsBase)this)["SaveVideo"];
}
set
{
((SettingsBase)this)["SaveVideo"] = value;
}
}
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Runtime.InteropServices;
using FFmpeg.AutoGen;
namespace VideoReader;
internal class SaveVideo
{
private unsafe AVFormatContext* pFormatContext;
private unsafe AVStream* st;
private unsafe void Write_Frame(byte[] buff, long number)
{
AVPacket aVPacket = default(AVPacket);
AVPacket* ptr = &aVPacket;
ffmpeg.av_init_packet(ptr);
IntPtr intPtr = Marshal.AllocHGlobal(buff.Length);
Marshal.Copy(buff, 0, intPtr, buff.Length);
ptr->data = (sbyte*)intPtr.ToPointer();
ptr->size = buff.Length;
ptr->pts = ffmpeg.av_rescale_q(number, st->codec->time_base, st->time_base);
ffmpeg.av_interleaved_write_frame(pFormatContext, ptr);
Marshal.FreeHGlobal(intPtr);
ffmpeg.av_free_packet(ptr);
}
}

View File

@@ -0,0 +1,203 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace VideoReader;
[Description("Very basic slider control with selection range.")]
public class SelectionRangeSlider : UserControl
{
private enum MovingMode
{
MovingValue,
MovingMin,
MovingMax
}
private int min;
private int max = 100;
private int selectedMin;
private int selectedMax = 100;
private int value = 50;
private MovingMode movingMode;
private IContainer components;
[Description("Minimum value of the slider.")]
public int Min
{
get
{
return min;
}
set
{
min = value;
((Control)this).Invalidate();
}
}
[Description("Maximum value of the slider.")]
public int Max
{
get
{
return max;
}
set
{
max = value;
((Control)this).Invalidate();
}
}
[Description("Minimum value of the selection range.")]
public int SelectedMin
{
get
{
return selectedMin;
}
set
{
selectedMin = value;
if (this.SelectionChanged != null)
{
this.SelectionChanged(this, null);
}
((Control)this).Invalidate();
}
}
[Description("Maximum value of the selection range.")]
public int SelectedMax
{
get
{
return selectedMax;
}
set
{
selectedMax = value;
if (this.SelectionChanged != null)
{
this.SelectionChanged(this, null);
}
((Control)this).Invalidate();
}
}
[Description("Current value.")]
public int Value
{
get
{
return value;
}
set
{
this.value = value;
if (this.ValueChanged != null)
{
this.ValueChanged(this, null);
}
((Control)this).Invalidate();
}
}
[Description("Fired when SelectedMin or SelectedMax changes.")]
public event EventHandler SelectionChanged;
[Description("Fired when Value changes.")]
public event EventHandler ValueChanged;
public SelectionRangeSlider()
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Expected O, but got Unknown
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Expected O, but got Unknown
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Expected O, but got Unknown
InitializeComponent();
((Control)this).SetStyle((ControlStyles)8192, true);
((Control)this).SetStyle((ControlStyles)131072, true);
((Control)this).Paint += new PaintEventHandler(SelectionRangeSlider_Paint);
((Control)this).MouseDown += new MouseEventHandler(SelectionRangeSlider_MouseDown);
((Control)this).MouseMove += new MouseEventHandler(SelectionRangeSlider_MouseMove);
}
private void SelectionRangeSlider_Paint(object sender, PaintEventArgs e)
{
e.Graphics.FillRectangle(Brushes.White, ((Control)this).ClientRectangle);
Rectangle rectangle = new Rectangle((selectedMin - Min) * ((Control)this).Width / (Max - Min), 0, (selectedMax - selectedMin) * ((Control)this).Width / (Max - Min), ((Control)this).Height);
e.Graphics.FillRectangle(Brushes.Blue, rectangle);
e.Graphics.DrawRectangle(Pens.Black, 0, 0, ((Control)this).Width - 1, ((Control)this).Height - 1);
e.Graphics.DrawLine(Pens.Black, (Value - Min) * ((Control)this).Width / (Max - Min), 0, (Value - Min) * ((Control)this).Width / (Max - Min), ((Control)this).Height);
}
private void SelectionRangeSlider_MouseDown(object sender, MouseEventArgs e)
{
int num = Min + e.X * (Max - Min) / ((Control)this).Width;
int num2 = Math.Abs(num - Value);
int num3 = Math.Abs(num - SelectedMin);
int val = Math.Abs(num - SelectedMax);
int num4 = Math.Min(num2, Math.Min(num3, val));
if (num4 == num2)
{
movingMode = MovingMode.MovingValue;
}
else if (num4 == num3)
{
movingMode = MovingMode.MovingMin;
}
else
{
movingMode = MovingMode.MovingMax;
}
SelectionRangeSlider_MouseMove(sender, e);
}
private void SelectionRangeSlider_MouseMove(object sender, MouseEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Invalid comparison between Unknown and I4
if ((int)e.Button == 1048576)
{
int num = Min + e.X * (Max - Min) / ((Control)this).Width;
if (movingMode == MovingMode.MovingValue)
{
Value = num;
}
else if (movingMode == MovingMode.MovingMin)
{
SelectedMin = num;
}
else if (movingMode == MovingMode.MovingMax)
{
SelectedMax = num;
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
((ContainerControl)this).Dispose(disposing);
}
private void InitializeComponent()
{
components = new Container();
((ContainerControl)this).AutoScaleMode = (AutoScaleMode)1;
}
}

View File

@@ -0,0 +1,342 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace VideoReader;
public class UCPictureBox : UserControl
{
private Size size = new Size(1280, 720);
private Image image;
private float scale = 1f;
private Point PointImage = new Point(0, 0);
public RotateFlipType RotateFlip;
private int rotate;
private int flip;
private object block = new object();
private Point mousestart;
private bool Mousestart;
private IContainer components;
public int Rotate
{
get
{
return rotate;
}
set
{
rotate = value;
RoutFlip();
}
}
public int Flip
{
get
{
return flip;
}
set
{
flip = value;
RoutFlip();
}
}
public Image Image
{
get
{
return image;
}
set
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
Image val = image;
if (value != null)
{
image = (Image)new Bitmap(value);
}
if (val != null && value == null)
{
val.Dispose();
}
else if (val != null && value != null && ((object)image).GetHashCode() != ((object)value).GetHashCode())
{
val.Dispose();
}
}
}
public Size SizeImage
{
get
{
return size;
}
set
{
size = value;
}
}
public UCPictureBox()
{
InitializeComponent();
((Control)this).DoubleBuffered = true;
}
private void RoutFlip()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
RotateFlipType rotateFlip = (RotateFlipType)0;
if (rotate == 0 && flip == 1)
{
rotateFlip = (RotateFlipType)4;
}
else if (rotate == 0 && flip == 2)
{
rotateFlip = (RotateFlipType)6;
}
else if (rotate == 0 && flip == 3)
{
rotateFlip = (RotateFlipType)2;
}
else if (rotate == 90 && flip == 0)
{
rotateFlip = (RotateFlipType)1;
}
else if (rotate == 90 && flip == 1)
{
rotateFlip = (RotateFlipType)5;
}
else if (rotate == 90 && flip == 2)
{
rotateFlip = (RotateFlipType)7;
}
else if (rotate == 90 && flip == 3)
{
rotateFlip = (RotateFlipType)3;
}
else if (rotate == 180 && flip == 0)
{
rotateFlip = (RotateFlipType)2;
}
else if (rotate == 180 && flip == 1)
{
rotateFlip = (RotateFlipType)6;
}
else if (rotate == 180 && flip == 2)
{
rotateFlip = (RotateFlipType)4;
}
else if (rotate == 180 && flip == 3)
{
rotateFlip = (RotateFlipType)0;
}
else if (rotate == 270 && flip == 0)
{
rotateFlip = (RotateFlipType)3;
}
else if (rotate == 270 && flip == 1)
{
rotateFlip = (RotateFlipType)7;
}
else if (rotate == 270 && flip == 2)
{
rotateFlip = (RotateFlipType)5;
}
else if (rotate == 270 && flip == 3)
{
rotateFlip = (RotateFlipType)1;
}
RotateFlip = rotateFlip;
((Control)this).Refresh();
}
public Point rePoint(Point point)
{
Point result = default(Point);
if (Rotate == 0)
{
result.X = (int)((float)point.X * scale) + PointImage.X;
result.Y = (int)((float)point.Y * scale) + PointImage.Y;
}
else if (Rotate == 90)
{
result.X = (int)((float)point.Y * scale) + PointImage.Y;
result.Y = size.Height - ((int)((float)point.X * scale) + PointImage.X);
}
else if (Rotate == 180)
{
result.X = size.Width - ((int)((float)point.X * scale) + PointImage.X);
result.Y = size.Height - ((int)((float)point.Y * scale) + PointImage.Y);
}
else if (Rotate == 270)
{
result.X = size.Width - ((int)((float)point.Y * scale) + PointImage.Y);
result.Y = (int)((float)point.X * scale) + PointImage.X;
}
if (Flip == 1 || Flip == 3)
{
result.X = size.Width - result.X;
}
if (Flip == 2 || Flip == 3)
{
result.Y = size.Height - result.Y;
}
return result;
}
public void Zoom(bool zoom)
{
if (zoom)
{
scale += scale / 25f;
}
else
{
scale -= scale / 25f;
}
if (scale > 3f)
{
scale = 3f;
}
if ((double)scale < 0.1)
{
scale = 0.1f;
}
((Control)this).Refresh();
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Invalid comparison between Unknown and I4
Rectangle rectangle = new Rectangle(PointImage.X, PointImage.Y, Convert.ToInt32((float)((Control)this).Width * scale), Convert.ToInt32((float)((Control)this).Height * scale));
lock (block)
{
if (image != null && (int)image.PixelFormat != 0)
{
Bitmap val = new Bitmap(image);
((Image)val).RotateFlip(RotateFlip);
e.Graphics.Clear(((Control)this).BackColor);
if ((int)RotateFlip == 0 || (int)RotateFlip == 2)
{
e.Graphics.DrawImage((Image)(object)val, new Rectangle(0, 0, ((Control)this).Width, ((Control)this).Height), rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, (GraphicsUnit)2);
}
else
{
e.Graphics.DrawImage((Image)(object)val, new Rectangle(0, 0, ((Control)this).Width, ((Control)this).Height), rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, (GraphicsUnit)2);
}
}
else
{
((ScrollableControl)this).OnPaintBackground(e);
}
}
}
protected override void OnMouseWheel(MouseEventArgs e)
{
if (e.Delta < 0)
{
Zoom(zoom: true);
}
else
{
Zoom(zoom: false);
}
}
protected override void OnMouseDown(MouseEventArgs e)
{
((UserControl)this).OnMouseDown(e);
Mousestart = true;
mousestart = e.Location;
}
protected override void OnMouseUp(MouseEventArgs e)
{
((Control)this).OnMouseUp(e);
Mousestart = false;
}
protected override void OnMouseMove(MouseEventArgs e)
{
((Control)this).OnMouseMove(e);
if (Mousestart)
{
PointImage.X += mousestart.X - e.X;
PointImage.Y += mousestart.Y - e.Y;
mousestart = e.Location;
if (PointImage.X < 0)
{
PointImage.X = 0;
}
if (PointImage.Y < 0)
{
PointImage.Y = 0;
}
((Control)this).Refresh();
}
}
protected override void OnMouseLeave(EventArgs e)
{
((Control)this).OnMouseLeave(e);
Mousestart = false;
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
((ContainerControl)this).Dispose(disposing);
}
private void InitializeComponent()
{
((Control)this).SuspendLayout();
((ContainerControl)this).AutoScaleMode = (AutoScaleMode)0;
((Control)this).Name = "UCPictureBox";
((Control)this).ResumeLayout(false);
}
}

View File

@@ -0,0 +1,81 @@
using System;
using System.Runtime.InteropServices;
namespace VideoReader;
public class libfaad
{
public struct NeAACDecConfiguration
{
public char defObjectType;
public int defSampleRate;
public char outputFormat;
public char downMatrix;
public char useOldADTSFormat;
}
public struct NeAACDecFrameInfo
{
public int bytesconsumed;
public int samples;
public char channels;
public char error;
public int samplerate;
public char sbr;
public char object_type;
public char header_type;
public char num_front_channels;
public char num_side_channels;
public char num_back_channels;
public char num_lfe_channels;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public char[] channel_position;
public char ps;
}
private const string libPath = "libfaad2.dll";
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr NeAACDecOpen();
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr NeAACDecGetCurrentConfiguration(IntPtr hpDecoder);
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern char NeAACDecSetConfiguration(IntPtr hpDecoder, IntPtr config);
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public unsafe static extern int NeAACDecInit(IntPtr hpDecoder, byte[] buffer, int buffer_size, ulong* samplerate, char* channels);
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public unsafe static extern char NeAACDecInit2(IntPtr hpDecoder, byte[] buffer, int SizeOfDecoderSpecificInfo, ulong* samplerate, char* channels);
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr NeAACDecDecode(IntPtr hpDecoder, out NeAACDecFrameInfo hInfo, byte[] buffer, int buffer_size);
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void NeAACDecClose(IntPtr hpDecoder);
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public unsafe static extern char* NeAACDecGetErrorMessage(char errcode);
[DllImport("libfaad2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern char NeAACDecAudioSpecificConfig(IntPtr pBuffer, int buffer_size, IntPtr mp4ASC);
}

6
output_3234/app.config Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

BIN
output_3234/app.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB