From 29a889e9e08f46c2761a73a6653ae32b6ba8ee27 Mon Sep 17 00:00:00 2001
From: lxmou666 <772765102@qq.com>
Date: Thu, 7 Jan 2021 16:03:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E7=BB=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
JianGongYun/TRTC/LiveClassroom.cs | 37 +++++--
.../TRTC/ViewModels/LiveWindowViewModel.cs | 2 +-
JianGongYun/TRTC/Windows/LiveWindow.xaml | 8 +-
JianGongYun/TRTC/Windows/LiveWindow.xaml.cs | 9 +-
.../Windows/LiveWindowRightBottomBlock.xaml | 32 ++++++
.../LiveWindowRightBottomBlock.xaml.cs | 83 ++++++++++++++
.../TRTC/Windows/LiveWindowTopBlock.xaml | 42 +++++++
.../TRTC/Windows/LiveWindowTopBlock.xaml.cs | 103 ++++++++++++++++++
.../TRTC/Windows/SettingWindow.xaml.cs | 1 +
9 files changed, 302 insertions(+), 15 deletions(-)
create mode 100644 JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml
create mode 100644 JianGongYun/TRTC/Windows/LiveWindowRightBottomBlock.xaml.cs
create mode 100644 JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml
create mode 100644 JianGongYun/TRTC/Windows/LiveWindowTopBlock.xaml.cs
diff --git a/JianGongYun/TRTC/LiveClassroom.cs b/JianGongYun/TRTC/LiveClassroom.cs
index 0bcc90d..c88b502 100644
--- a/JianGongYun/TRTC/LiveClassroom.cs
+++ b/JianGongYun/TRTC/LiveClassroom.cs
@@ -82,6 +82,7 @@ namespace JianGongYun.TRTC
CurrentLiveWindow.Closed += CurrentLiveWindow_Closed;
lTRTCCloud = ITRTCCloud.getTRTCShareInstance();//创建TRTC实例
+ lTRTCCloud.addCallback(TRTCCloudCallback);//注册回调
var roomPars = new TRTCParams
{
sdkAppId = SDKAppID,
@@ -116,7 +117,6 @@ namespace JianGongYun.TRTC
//liveWinMode.LoadAllScreen();
_RecoderDir = $"{classroomEntity.ClassHead}_{classroomEntity.ClassSubHead}";
- lTRTCCloud.addCallback(TRTCCloudCallback);//注册回调
callerWindow.Hide();//隐藏调用窗口
CurrentLiveWindow.Show();
@@ -371,7 +371,7 @@ namespace JianGongYun.TRTC
int runFps = 0;//实时帧
Timer timer = new Timer((a) =>
{
- Debug.Print($"runFps {runFps}. leavingsMat {mats.Count}.");
+ //Debug.Print($"runFps {runFps}. leavingsMat {mats.Count}.");
Interlocked.Exchange(ref runFps, 0);
}, null, 0, 1000);
@@ -454,7 +454,7 @@ namespace JianGongYun.TRTC
}
}
- Skip1:
+ Skip1:
if (liveWinMode.CameraRunning)//摄像头分享中
{
@@ -482,7 +482,7 @@ namespace JianGongYun.TRTC
}
}
- Skip2:
+ Skip2:
mats.Enqueue(BackgroundFrame.CvtColor(ColorConversionCodes.BGRA2BGR));
Interlocked.Increment(ref runFps);
@@ -551,14 +551,6 @@ namespace JianGongYun.TRTC
Process prc = new Process { StartInfo = new ProcessStartInfo { FileName = Path.Combine(Environment.CurrentDirectory, "ffmpeg.exe"), Arguments = arguments, CreateNoWindow = true, UseShellExecute = false } };
prc.Start();
prc.WaitForExit();
- if (File.Exists(VideoTempPath))
- {
- File.Delete(VideoTempPath);
- }
- if (File.Exists(AudioTempPath))
- {
- File.Delete(AudioTempPath);
- }
CurrentLiveWindow.Dispatcher.Invoke(new Action(() =>
{
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
@@ -567,6 +559,27 @@ namespace JianGongYun.TRTC
Content = $"成功保存直播视频,路径:{ResultFilePath}。",
NotifiactionType = AduSkin.Controls.EnumPromptType.Success
});
+ var res= AduMessageBox.ShowYesNoCancel("是否删除音视频源文件?", "提醒", "删除", "保留", "浏览");
+ if (res== MessageBoxResult.Cancel)
+ {
+ var process = new Process
+ {
+ StartInfo = new ProcessStartInfo { FileName = "explorer.exe", Arguments = RecoderDir }
+ };
+ process.Start();
+ process.WaitForExit();
+ }
+ else if (res== MessageBoxResult.Yes)
+ {
+ if (File.Exists(VideoTempPath))
+ {
+ File.Delete(VideoTempPath);
+ }
+ if (File.Exists(AudioTempPath))
+ {
+ File.Delete(AudioTempPath);
+ }
+ }
}));
Debug.Print("结束写入视频线程");
}, TaskCreationOptions.LongRunning);
diff --git a/JianGongYun/TRTC/ViewModels/LiveWindowViewModel.cs b/JianGongYun/TRTC/ViewModels/LiveWindowViewModel.cs
index 0340684..5fae0a2 100644
--- a/JianGongYun/TRTC/ViewModels/LiveWindowViewModel.cs
+++ b/JianGongYun/TRTC/ViewModels/LiveWindowViewModel.cs
@@ -27,7 +27,7 @@ namespace JianGongYun.TRTC.ViewModels
///
/// 学生总数
///
- private int _StudentCount = 0;
+ private int _StudentCount = 1;
public int StudentCount
{
set
diff --git a/JianGongYun/TRTC/Windows/LiveWindow.xaml b/JianGongYun/TRTC/Windows/LiveWindow.xaml
index 3c9560b..8467fc9 100644
--- a/JianGongYun/TRTC/Windows/LiveWindow.xaml
+++ b/JianGongYun/TRTC/Windows/LiveWindow.xaml
@@ -37,6 +37,12 @@
+
+
+
+
+
+