-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: FFMPEG支持
win_amd64
、linux_amd64
、win_arm64
、linux_arm64
- Loading branch information
1 parent
72d1460
commit b7d5fba
Showing
5 changed files
with
104 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package nicelee.bilibili.util; | ||
|
||
public class SysUtil { | ||
static String OS; | ||
static String ARCH; | ||
static String EXE_SUFFIX; | ||
|
||
public static boolean surportFFmpegOfficially() { | ||
String os_arch = String.format("%s_%s", SysUtil.getOS(), SysUtil.getARCH()); | ||
switch (os_arch) { | ||
case "linux_amd64": | ||
case "linux_arm64": | ||
case "win_amd64": | ||
case "win_arm64": | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
public static String getOS() { | ||
if (OS == null) { | ||
String osName = System.getProperty("os.name").toLowerCase(); | ||
Logger.println(osName); | ||
if (osName.startsWith("win")) | ||
OS = "win"; | ||
else if (osName.startsWith("linux")) | ||
OS = "linux"; | ||
else | ||
OS = "unknown"; | ||
} | ||
return OS; | ||
} | ||
|
||
public static String getARCH() { | ||
if (ARCH == null) { | ||
String arch = System.getProperty("os.arch").toLowerCase(); | ||
Logger.println(arch); | ||
if (arch.equals("amd64") || arch.equals("x86_64")) | ||
ARCH = "amd64"; | ||
else if (arch.equals("arm64") || arch.equals("aarch64")) | ||
ARCH = "arm64"; | ||
else | ||
ARCH = "unknown"; | ||
} | ||
return ARCH; | ||
} | ||
|
||
public static String getEXE_SUFFIX() { | ||
if (EXE_SUFFIX == null) { | ||
if ("win".equals(getOS())) | ||
EXE_SUFFIX = ".exe"; | ||
else | ||
EXE_SUFFIX = ""; | ||
} | ||
return EXE_SUFFIX; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters