Skip to content

Commit 14c0520

Browse files
authored
Revert "Basic multiplatform (#218)" (#226)
This reverts commit d2fc566.
1 parent d2fc566 commit 14c0520

File tree

4 files changed

+3
-32
lines changed

4 files changed

+3
-32
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,5 @@ UpgradeLog*.XML
105105

106106
*.stackdump
107107

108-
# JetBrains Rider
109-
.idea/
110-
*.sln.iml
111-
112108
# Local
113109
/FFmpeg.AutoGen.Example/frame.*.jpg

FFmpeg.AutoGen/FFmpeg.AutoGen.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;netstandard2.1;netstandard2.0;net472;net45</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;netstandard2.0;net472;net45</TargetFrameworks>
55
<GeneratePackageOnBuild Condition=" $(Configuration) == 'Release' ">true</GeneratePackageOnBuild>
66
<Description>FFmpeg auto generated unsafe bindings for C#/.NET and Mono.</Description>
77
</PropertyGroup>

FFmpeg.AutoGen/FFmpeg.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using System.Runtime.InteropServices;
54
using FFmpeg.AutoGen.Native;
65

76
namespace FFmpeg.AutoGen
@@ -39,23 +38,11 @@ static ffmpeg()
3938
{
4039
GetOrLoadLibrary = libraryName => LoadLibrary(libraryName, true);
4140

42-
#if NET
43-
//BSD has #define EAGAIN 35 in errno.h, other OS have EAGAIN 11. Apple is based on BSD
44-
bool bsdStyleErrno =
45-
OperatingSystem.IsFreeBSD()
46-
|| OperatingSystem.IsMacCatalyst()
47-
|| OperatingSystem.IsMacOS()
48-
|| OperatingSystem.IsIOS()
49-
|| OperatingSystem.IsTvOS()
50-
|| OperatingSystem.IsWatchOS();
51-
EAGAIN = bsdStyleErrno ? 35 : 11;
52-
#else
5341
EAGAIN = LibraryLoader.GetPlatformId() switch
5442
{
5543
PlatformID.MacOSX => 35,
5644
_ => 11
5745
};
58-
#endif
5946
}
6047

6148
/// <summary>

FFmpeg.AutoGen/Native/LibraryLoader.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace FFmpeg.AutoGen.Native
66
{
7-
public delegate PlatformID? GetPlatformId();
7+
public delegate PlatformID GetPlatformId();
88

99
public delegate string GetNativeLibraryName(string libraryName, int version);
1010

@@ -16,23 +16,11 @@ static LibraryLoader()
1616
{
1717
#if NET45 || NET40
1818
return Environment.OSVersion.Platform;
19-
#elif NET
20-
if (OperatingSystem.IsWindows())
21-
return PlatformID.Win32NT;
22-
if (OperatingSystem.IsMacCatalyst()
23-
|| OperatingSystem.IsMacOS()
24-
|| OperatingSystem.IsIOS()
25-
|| OperatingSystem.IsTvOS()
26-
|| OperatingSystem.IsWatchOS())
27-
return PlatformID.MacOSX; // all share similar .dylib calling style. But only static libs on iOS store apps!
28-
if (OperatingSystem.IsAndroid() || OperatingSystem.IsFreeBSD() || OperatingSystem.IsLinux())
29-
return PlatformID.Unix;
30-
return null;
3119
#else
3220
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return PlatformID.Win32NT;
3321
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) return PlatformID.Unix;
3422
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) return PlatformID.MacOSX;
35-
return null;
23+
throw new PlatformNotSupportedException();
3624
#endif
3725
};
3826

0 commit comments

Comments
 (0)