FFMpegCore/FFMpegCore/FFMpeg/Pipes/PipeHelpers.cs
2023-01-31 21:24:44 +01:00

18 lines
514 B
C#

using System;
using System.Runtime.InteropServices;
namespace FFMpegCore.Pipes
{
static class PipeHelpers
{
public static string GetUnqiuePipeName() => $"FFMpegCore_{Guid.NewGuid().ToString("N").Substring(0, 5)}";
public static string GetPipePath(string pipeName)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
return $@"\\.\pipe\{pipeName}";
else
return $"unix:/tmp/CoreFxPipe_{pipeName}";
}
}
}