public dynamic CreateOptions(MemberInfo memberInfo, Type testClassType) { var sauceBuildName = Environment.GetEnvironmentVariable("SAUCE_BUILD_NAME"); var buildName = string.IsNullOrEmpty(sauceBuildName) ? BuildName : sauceBuildName; var driverOptions = GetDriverOptionsBasedOnBrowser(testClassType); AddAdditionalCapabilities(testClassType, driverOptions); var sauceOptions = new Dictionary <string, string>(); string browserName = Enum.GetName(typeof(BrowserType), Browser); sauceOptions.Add("platform", Platform); sauceOptions.Add("version", BrowserVersion); sauceOptions.Add("screenResolution", ScreenResolution); sauceOptions.Add("recordVideo", RecordVideo.ToString()); sauceOptions.Add("recordScreenshots", RecordScreenshots.ToString()); sauceOptions.Add("extendedDebugging", EnableExtendedDebugging.ToString()); sauceOptions.Add("capturePerformance", CapturePerformance.ToString()); sauceOptions.Add("build", buildName); sauceOptions.Add("name", testClassType.FullName); var credentials = CloudProviderCredentialsResolver.GetCredentials(); driverOptions.AddAdditionalCapability("username", credentials.Item1); driverOptions.AddAdditionalCapability("accessKey", credentials.Item2); driverOptions.AddAdditionalCapability("name", testClassType.FullName); return(driverOptions); }
public bool SetupEncoder(CapturePerformance ScreenCapturePerformance, ScreenEncoder.CaptureType ScreenCaptureType, params System.Object[] ParameterArray) { string sWMEFile ; switch (ScreenCapturePerformance) { case CapturePerformance.Extreme: sWMEFile = m_sProfileDirectory + "\\" + "ScreenCapture_1000k_30fps.wme"; break; case CapturePerformance.VeryHigh: sWMEFile = m_sProfileDirectory + "\\" + "ScreenCapture_700k_25fps.wme"; break; case CapturePerformance.High: sWMEFile = m_sProfileDirectory + "\\" + "ScreenCapture_341k_15fps.wme"; break; case CapturePerformance.MediumHigh: sWMEFile = m_sProfileDirectory + "\\" + "ScreenCapture_250k_15fps.wme"; break; case CapturePerformance.Medium: sWMEFile = m_sProfileDirectory + "\\" + "ScreenCapture_93k_10fps.wme"; break; case CapturePerformance.Low: sWMEFile = m_sProfileDirectory + "\\" + "ScreenCapture_32k_5fps.wme"; break; case CapturePerformance.VeryLow: sWMEFile = m_sProfileDirectory + "\\" + "ScreenCapture_13k_3fps.wme"; break; default: //log.WriteLog("SignalType must be a valid OysterEncoder.VideoSignalType"); return false; } m_sWMEFilename = sWMEFile; // m_bIsEncoderStreaming = false; // verify that the WMEFilename is exists if (!System.IO.File.Exists(sWMEFile)) { //log.WriteLog(sWMEFile + " does not exist."); return false; } // initialize the Winnov capture card on the specified channel // by setting the source index for both audio and video // initialize the WMEncoder // load the WMEFilename into the WMEncoder m_encoder.Load(sWMEFile); // prepare the WMEncoder // m_encoder.EnableAutoArchive = false; m_encoder.PrepareToEncode(true); // m_videosource2 = (WMEncoderLib.IWMEncVideoSource2) // m_encoder.SourceGroupCollection.Add("SourceGroup").AddSource(WMEncoderLib.WMENC_SOURCE_TYPE.WMENC_VIDEO); // m_videosource2.SetInput("ScreenCap://ScreenCapture1","",""); m_videosource2 = (WMEncoderLib.IWMEncVideoSource2) m_encoder.SourceGroupCollection.Item("Screen") .get_Source(WMEncoderLib.WMENC_SOURCE_TYPE.WMENC_VIDEO,0); m_bag = new PropertyBag.BagInterface(m_videosource2); switch (ScreenCaptureType) { case ScreenEncoder.CaptureType.FullScreen: WriteProperty(ScreenEncoder.CaptureProperty.EntireScreen,true); break; case ScreenEncoder.CaptureType.WindowByHandle: WriteProperty(ScreenEncoder.CaptureProperty.CaptureWindow,(System.IntPtr)((CarverLab.Utility.Window)ParameterArray[0]).hwnd); break; case ScreenEncoder.CaptureType.WindowByName: WriteProperty(ScreenEncoder.CaptureProperty.WindowTitle,(string)((CarverLab.Utility.Window) ParameterArray[0]).WindowText); break; default: break; } // start the WMEncoder streaming //m_encoder.Start(); //m_bIsEncoderStreaming = true; // end routine return true; }