public static void Init(bool noHardwareMode, IUserSettingService userSettingService)
        {
            Thread thread = new Thread(() =>
            {
                if (userSettingService.GetUserSetting <bool>(UserSettingConstants.ForceDisableHardwareSupport))
                {
                    noHardware = true;
                }
                else
                {
                    noHardware = noHardwareMode;
                }

                HandBrakeUtils.RegisterLogger();
                HandBrakeUtils.EnsureGlobalInit(noHardware);
            });

            thread.Start();
            if (!thread.Join(8000))
            {
                // Something is likely handing in a graphics driver.  Force disable this feature so we don't probe the hardware next time around.
                userSettingService.SetUserSetting(UserSettingConstants.ForceDisableHardwareSupport, true);
                throw new GeneralApplicationException(Resources.Startup_UnableToStart, Resources.Startup_UnableToStartInfo);
            }
        }
예제 #2
0
        /// <summary>
        /// Initializes static members of the Converters class.
        /// </summary>
        static Converters()
        {
            HandBrakeUtils.EnsureGlobalInit();

            VideoRates = new Dictionary <double, int>();
            foreach (var framerate in Encoders.VideoFramerates)
            {
                VideoRates.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture), framerate.Rate);
            }
        }
예제 #3
0
 /// <summary>
 /// Initializes static members of the Encoders class.
 /// </summary>
 static Encoders()
 {
     HandBrakeUtils.EnsureGlobalInit();
 }
예제 #4
0
 public static void Init(bool noHardwareMode)
 {
     noHardware = noHardwareMode;
     HandBrakeUtils.RegisterLogger();
     HandBrakeUtils.EnsureGlobalInit(noHardwareMode);
 }
예제 #5
0
 private void GlobalInitialize()
 {
     HandBrakeUtils.EnsureGlobalInit(initNoHardwareMode: false);
     HandBrakeUtils.SetDvdNav(Config.EnableLibDvdNav);
 }