private void InitializeProviderManager(string vsAppPath, string providerPath) { VsProviderCollection vsProviders = new VsProviderCollection(); vsProviders.Load(providerPath); string fullFileName = Path.Combine(vsAppPath, "cameras.config"); Hashtable[] data = ConfigData.loadCamConfig(fullFileName); VsProviderManagerDic = new Dictionary <string, VsProviderManager>(); foreach (var v in data) { string camId = v["name"].ToString(); //// string source = v[""]; string ProviderName = v["provider"].ToString(); // // string ProviderName = "Vs.Provider.Axis.Axis2110Description"; // Hashtable reader = new Hashtable(); // reader["source"] = v["source"];//source; // reader["login"] = v["login"]; ; // reader["password"] = v["password"]; // reader["size"] = "640x480"; // reader["stype"] = "1"; // reader["interval"] = "250"; //if (coreProvider != null) //{ // coreProvider.Stop(); //} VsProvider provider = vsProviders.GetProviderByName(ProviderName); VsProviderManagerDic.Add(camId, new VsProviderManager(v, provider)); } //{ // string camId = "cam1"; // string source = "@device:pnp:\\\\?\\usb#vid_eb1a&pid_2761&mi_00#6&30952a2b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\global"; // string ProviderName = "Vs.Provider.Local.CaptureDeviceDescription"; // // string ProviderName = "Vs.Provider.Axis.Axis2110Description"; // Hashtable reader = new Hashtable(); // reader["source"] = source;//source; // reader["login"] = "******"; // reader["password"] = "******"; // reader["size"] = "640x480"; // reader["stype"] = "1"; // reader["interval"] = "250"; // //if (coreProvider != null) // //{ // // coreProvider.Stop(); // //} // VsProvider provider = vsProviders.GetProviderByName(ProviderName); // VsProviderManagerDic.Add(camId, new VsProviderManager(reader, provider)); //} //{ // string camId = "cam2"; // string source = "camera-210-01.coe.psu.ac.th"; // string ProviderName = "Vs.Provider.Axis.Axis2110Description"; // Hashtable reader = new Hashtable(); // reader["source"] = source;//source; // reader["login"] = "******"; // reader["password"] = "******"; // reader["size"] = "640x480"; // reader["stype"] = "1"; // reader["interval"] = "250"; // //if (coreProvider != null) // //{ // // coreProvider.Stop(); // //} // VsProvider provider = vsProviders.GetProviderByName(ProviderName); // VsProviderManagerDic.Add(camId, new VsProviderManager(reader, provider)); //} //coreProvider = provider.CreateVideoSource(provider.LoadConfiguration(reader)); }
private void InitializeProviderManager(string vsAppPath, string providerPath) { VsProviderCollection vsProviders = new VsProviderCollection(); vsProviders.Load(providerPath); string fullFileName = Path.Combine(vsAppPath, "cameras.config"); Hashtable[] data = ConfigData.loadCamConfig(fullFileName); VsProviderManagerDic = new Dictionary<string, VsProviderManager>(); foreach (var v in data) { string camId = v["name"].ToString(); //// string source = v[""]; string ProviderName = v["provider"].ToString(); // // string ProviderName = "Vs.Provider.Axis.Axis2110Description"; // Hashtable reader = new Hashtable(); // reader["source"] = v["source"];//source; // reader["login"] = v["login"]; ; // reader["password"] = v["password"]; // reader["size"] = "640x480"; // reader["stype"] = "1"; // reader["interval"] = "250"; //if (coreProvider != null) //{ // coreProvider.Stop(); //} VsProvider provider = vsProviders.GetProviderByName(ProviderName); VsProviderManagerDic.Add(camId, new VsProviderManager(v, provider)); } //{ // string camId = "cam1"; // string source = "@device:pnp:\\\\?\\usb#vid_eb1a&pid_2761&mi_00#6&30952a2b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\global"; // string ProviderName = "Vs.Provider.Local.CaptureDeviceDescription"; // // string ProviderName = "Vs.Provider.Axis.Axis2110Description"; // Hashtable reader = new Hashtable(); // reader["source"] = source;//source; // reader["login"] = "******"; // reader["password"] = "******"; // reader["size"] = "640x480"; // reader["stype"] = "1"; // reader["interval"] = "250"; // //if (coreProvider != null) // //{ // // coreProvider.Stop(); // //} // VsProvider provider = vsProviders.GetProviderByName(ProviderName); // VsProviderManagerDic.Add(camId, new VsProviderManager(reader, provider)); //} //{ // string camId = "cam2"; // string source = "camera-210-01.coe.psu.ac.th"; // string ProviderName = "Vs.Provider.Axis.Axis2110Description"; // Hashtable reader = new Hashtable(); // reader["source"] = source;//source; // reader["login"] = "******"; // reader["password"] = "******"; // reader["size"] = "640x480"; // reader["stype"] = "1"; // reader["interval"] = "250"; // //if (coreProvider != null) // //{ // // coreProvider.Stop(); // //} // VsProvider provider = vsProviders.GetProviderByName(ProviderName); // VsProviderManagerDic.Add(camId, new VsProviderManager(reader, provider)); //} //coreProvider = provider.CreateVideoSource(provider.LoadConfiguration(reader)); }