Commit 68e94102 authored by 罗超's avatar 罗超

优化部分功能

parent 5d8a0cf6
No preview for this file type
...@@ -32,9 +32,10 @@ ...@@ -32,9 +32,10 @@
// //
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(228, 69); this.ClientSize = new System.Drawing.Size(293, 81);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "Form1"; this.Name = "Form1";
this.Opacity = 0D; this.Opacity = 0D;
this.ShowIcon = false; this.ShowIcon = false;
......
...@@ -103,6 +103,7 @@ namespace robot ...@@ -103,6 +103,7 @@ namespace robot
Thread thread = new Thread(CkeckUploadFailed); Thread thread = new Thread(CkeckUploadFailed);
thread.IsBackground = true; thread.IsBackground = true;
thread.Start(); thread.Start();
//OpenCamera();
} }
public void connectionServer() public void connectionServer()
...@@ -169,6 +170,19 @@ namespace robot ...@@ -169,6 +170,19 @@ namespace robot
//TODO: 启动进程 //TODO: 启动进程
if (websocket.State != WebSocketState.Open && websocket.State != WebSocketState.Connecting) if (websocket.State != WebSocketState.Open && websocket.State != WebSocketState.Connecting)
{ {
keybd_event((byte)Keys.F7, 0, 0, 0);
Thread.Sleep(5000);
Process[] processes = Process.GetProcessesByName("Captura");
foreach (Process p in processes)
{
//执行kill命令
p.Kill();
//等待被杀死的进程退出
p.WaitForExit();
//跳出foreach循环,可有可无
break;
}
System.Environment.Exit(0); System.Environment.Exit(0);
//connectionServer(); //connectionServer();
} }
...@@ -196,7 +210,6 @@ namespace robot ...@@ -196,7 +210,6 @@ namespace robot
Thread.Sleep(5000); Thread.Sleep(5000);
Process[] processes = Process.GetProcessesByName("Captura"); Process[] processes = Process.GetProcessesByName("Captura");
//在进程列表中查找指定的QQ进程
foreach (Process p in processes) foreach (Process p in processes)
{ {
//执行kill命令 //执行kill命令
...@@ -260,6 +273,7 @@ namespace robot ...@@ -260,6 +273,7 @@ namespace robot
File.Delete(uploadTempPath); File.Delete(uploadTempPath);
File.Delete(video.LocalFilePath); File.Delete(video.LocalFilePath);
websocket.Send($"UPLOAD_VIDEO_RESULT:{video.VideoId}");
} }
public static void CkeckUploadFailed() public static void CkeckUploadFailed()
...@@ -505,7 +519,10 @@ namespace robot ...@@ -505,7 +519,10 @@ namespace robot
var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
foreach (FilterInfo device in videoDevices) foreach (FilterInfo device in videoDevices)
{ {
devs.Add(device.Name); if (!device.Name.Equals("OBS Virtual Camera"))
{
devs.Add(device.Name);
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment