diff --git a/TestApp/App.config b/TestApp/App.config index 84cc45d..836c7dd 100644 --- a/TestApp/App.config +++ b/TestApp/App.config @@ -1,7 +1,7 @@ - + diff --git a/TestApp/MainWindow.xaml b/TestApp/MainWindow.xaml index e7b5f77..31894b2 100644 --- a/TestApp/MainWindow.xaml +++ b/TestApp/MainWindow.xaml @@ -264,12 +264,14 @@ - + + CreateSelectedRecordingSources() { OutputSize = cam.IsCustomOutputSizeEnabled ? cam.OutputSize : null, SourceRect = cam.IsCustomOutputSourceRectEnabled ? cam.SourceRect : null, - Position = cam.IsCustomPositionEnabled ? cam.Position : null + Position = cam.IsCustomPositionEnabled ? cam.Position : null, + CaptureFormat = cam.CaptureFormat + }; } else if (x is CheckableRecordableImage img) @@ -768,7 +770,7 @@ private void ProgressTimer_Tick(object sender, EventArgs e) AverageFrameRate = CurrentFrameNumber / DateTimeOffset.FromUnixTimeMilliseconds(_recordedFrameTimes.Last()).Subtract(_recordingStartTime.Value).TotalSeconds; _recordedFrameTimes.RemoveRange(0, Math.Max(0, _recordedFrameTimes.Count - 10)); double intervalMillis = (double)(_recordedFrameTimes.Last() - _recordedFrameTimes.First()); - CurrentFrameRate = (_recordedFrameTimes.Count-1) / (double)intervalMillis * 1000; + CurrentFrameRate = (_recordedFrameTimes.Count - 1) / (double)intervalMillis * 1000; } } private void UpdateProgress() @@ -974,7 +976,17 @@ private void RefreshSourceComboBox() foreach (RecordableCamera cam in Recorder.GetSystemVideoCaptureDevices()) { - RecordingSources.Add(new CheckableRecordableCamera(cam)); + var availableFormats = Recorder.GetSupportedVideoCaptureFormatsForDevice(cam.DeviceName); + var formatsToDisplay = availableFormats + .GroupBy(x=>x.Framerate) + .FirstOrDefault() + .GroupBy(x => x.FrameSize) + .SelectMany(x => new List { x.First() }) + .ToList(); + foreach (var format in formatsToDisplay) + { + RecordingSources.Add(new CheckableRecordableCamera(cam) { CaptureFormat = format }); + } } RecordingSources.Add(new CheckableRecordableVideo(@"testmedia\cat.mp4")); diff --git a/TestApp/Properties/Resources.Designer.cs b/TestApp/Properties/Resources.Designer.cs index e3f83c4..ba48c8c 100644 --- a/TestApp/Properties/Resources.Designer.cs +++ b/TestApp/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace TestApp.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/TestApp/Properties/Settings.Designer.cs b/TestApp/Properties/Settings.Designer.cs index 24def4b..30d3cde 100644 --- a/TestApp/Properties/Settings.Designer.cs +++ b/TestApp/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace TestApp.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/TestApp/TestApp.csproj b/TestApp/TestApp.csproj index bfc7fc0..4cbed74 100644 --- a/TestApp/TestApp.csproj +++ b/TestApp/TestApp.csproj @@ -9,7 +9,7 @@ Properties TestApp TestApp - v4.6 + v4.8 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4