mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Merge pull request #374 from ep1kt3t0s/short-socket-naming
Short socket names to prevent 104 char limit
Former-commit-id: 11abaeecc3
This commit is contained in:
commit
2344f4868e
1 changed files with 5 additions and 3 deletions
|
@ -1,17 +1,19 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace FFMpegCore.Pipes
|
namespace FFMpegCore.Pipes
|
||||||
{
|
{
|
||||||
static class PipeHelpers
|
static class PipeHelpers
|
||||||
{
|
{
|
||||||
public static string GetUnqiuePipeName() => $"FFMpegCore_{Guid.NewGuid()}";
|
public static string GetUnqiuePipeName() => $"FFMpegCore_{Guid.NewGuid().ToString("N").Substring(0, 5)}";
|
||||||
|
|
||||||
public static string GetPipePath(string pipeName)
|
public static string GetPipePath(string pipeName)
|
||||||
{
|
{
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
return $@"\\.\pipe\{pipeName}";
|
return $@"\\.\pipe\{pipeName}";
|
||||||
else
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||||
|
return $"unix:{Path.GetTempPath()}/CoreFxPipe_{pipeName}";
|
||||||
return $"unix:/tmp/CoreFxPipe_{pipeName}";
|
return $"unix:/tmp/CoreFxPipe_{pipeName}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue