Browse Source

Some test code for win11 defander bug

Jimmy 2 years ago
parent
commit
1d18f28b87

+ 1 - 0
fis/Managers/FileExporterManager.cs

@@ -18,6 +18,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using Emgu.CV.VideoStab;
 using fis.Win.Dev.Utilities.FFMPEG;
+using FFMpegWrapper;
 
 namespace fis.Win.Dev.Managers
 {

+ 0 - 52
fis/Utilities/FFMPEG/FFmpegService.cs

@@ -1,52 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace fis.Win.Dev.Utilities.FFMPEG
-{
-    public class FFmpegException : Exception
-    {
-        public FFmpegException(int exitCode, Exception innerException = null)
-            : base($"Exit Code: {exitCode}.\nSee FFmpeg Log for more info.", innerException) { }
-    }
-
-    public static class FFmpegService
-    {
-        private static string _ffmpegPath = "ffmpeg";
-
-        public static void SetFFmpegPath(string ffmpegPath)
-        {
-            _ffmpegPath = ffmpegPath;
-        }
-
-        //public static void StartFFmpeg(out Process process, string arguments)
-        //{
-        //    process = new Process
-        //    {
-        //        StartInfo =
-        //        {
-        //            FileName = _ffmpegPath,
-        //            Arguments = arguments,
-        //            UseShellExecute = false,
-        //            Verb = "runas",
-        //            CreateNoWindow = true,
-        //            RedirectStandardError = true,
-        //            RedirectStandardInput = true
-        //        },
-        //        EnableRaisingEvents = true
-        //    };
-        //    process.Start();
-        //    process.BeginErrorReadLine();
-        //}
-        public static void ForceCloseFFmpegIfStillAlive()
-        {
-            //var fmpegProcess = Process.GetProcessesByName("ffmpeg");
-            //foreach (var f in fmpegProcess)
-            //{
-            //    f.Kill();
-            //}
-        }
-    }
-}

+ 3 - 2
fis/Utilities/FFMPEG/Video/FFmpegVideoWriter.cs

@@ -1,4 +1,5 @@
-using fis.Managers;
+using FFMpegWrapper;
+using fis.Managers;
 using fis.Managers.Interfaces;
 using fis.Win.Dev.Utilities.FFMPEG.ArgsBuilder;
 using fis.Win.Dev.Utilities.FFMPEG.Settings;
@@ -61,7 +62,7 @@ namespace fis.Win.Dev.Utilities.FFMPEG.Video
            var exportManager = AppManager.Get<IFileExporterManager>();
             if (!exportManager.IsCancelled)
             {
-               // FFmpegService.StartFFmpeg(out _ffmpeg, argument);
+               FFmpegService.StartFFmpeg(out _ffmpeg, argument);
             }
         }
 

+ 2 - 1
fis/Utilities/FFMPEG/VideoFFmpegHelper.cs

@@ -1,4 +1,5 @@
-using fis.Log;
+using FFMpegWrapper;
+using fis.Log;
 using fis.Managers;
 using fis.Managers.Interfaces;
 using fis.Vid;

+ 16 - 0
fis/fis.Win.Dev.csproj

@@ -30,10 +30,26 @@
     <ProjectReference Include="..\fis.Vid\fis.Vid.csproj" />
   </ItemGroup>
   <ItemGroup>
+    <Reference Include="FFMpegWrapper">
+      <HintPath>..\third_party\SmartPublisher\FFMpegWrapper.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Update="Properties\Resources.Designer.cs">
+      <DesignTime>True</DesignTime>
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
     <Compile Update="SlaveWindow.axaml.cs">
       <DependentUpon>SlaveWindow.axaml</DependentUpon>
     </Compile>
   </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Update="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+  </ItemGroup>
   <Target Name="BuildAppWin" AfterTargets="AfterBuild">
 	  <Exec Command="xcopy $(ProjectDir)..\third_party\SmartPublisherDev\*.*  $(ProjectDir)bin\Debug\net6.0\*.* /Y" />
   </Target>

BIN
third_party/SmartPublisher/FFMpegWrapper.dll


BIN
third_party/SmartPublisherDev/FFMpegWrapper.dll