コード例 #1
0
ファイル: Util.cs プロジェクト: italodirenzo93/sdl2net
 internal static IntPtr LoadLibrary(string name)
 {
     return(CurrentPlatform switch
     {
         Platform.Windows => Windows.LoadLibraryW(name),
         Platform.Linux => Linux.dlopen(name, RTLD_LAZY),
         Platform.MacOS => MacOS.dlopen(name, RTLD_LAZY),
         _ => throw new NotSupportedException(RuntimeInformation.OSDescription)
     });
コード例 #2
0
        public IntPtr OnResolveDllImport(string libraryName, Assembly assembly, DllImportSearchPath?searchPath)
        {
            if (libraryName == "__Internal")
            {
                if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                {
                    return(Win32.GetModuleHandle(IntPtr.Zero));
                }
                else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
                {
                    return(_internalHandle);
                }
                else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
                {
                    return(MacOS.dlopen(IntPtr.Zero, MacOS.RTLD_LAZY));
                }
            }

            return(IntPtr.Zero);
        }
コード例 #3
0
        static public IEncoderDirectImage CreateDefaultVideoEncoder(ILogger logger, VoiceInfo info)
        {
            switch (info.Codec)
            {
            case Codec.VideoVP8:
            case Codec.VideoVP9:
                return(new VPxCodec.Encoder(logger, info));

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
            case Codec.VideoH264:
                //ve = new FFmpegCodec.Encoder(logger, info);
                return(new Windows.MFTCodec.VideoEncoder(logger, info));
#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
            case Codec.VideoH264:
                //ve = new FFmpegCodec.Encoder(logger, info);
                return(MacOS.VideoEncoder(logger, info));
#endif
            default:
                throw new UnsupportedCodecException("Platform.CreateDefaultVideoEncoder", info.Codec, logger);
            }
        }
コード例 #4
0
 void InitOS()
 {
     OS = new MacOS(this);
 }