Skip to content

Commit

Permalink
Modified test app to show all available camera formats
Browse files Browse the repository at this point in the history
  • Loading branch information
sskodje committed May 24, 2024
1 parent 4c57c3b commit 6612916
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 3 additions & 1 deletion TestApp/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,14 @@

<TextBlock FontFamily="Arial">
<TextBlock.Text>
<MultiBinding StringFormat="{}[Camera] {0} [{1},{2}] {3:0.##}fps ({4} x {5})]">
<MultiBinding StringFormat="{}[Camera] {0} [{1},{2}] [{3}] {4:0.##}fps ({5} x {6})]">
<Binding Path="FriendlyName" />
<Binding Path="Position.Left"
UpdateSourceTrigger="PropertyChanged" />
<Binding Path="Position.Top"
UpdateSourceTrigger="PropertyChanged" />
<Binding Path="CaptureFormat.VideoFormatName"
UpdateSourceTrigger="PropertyChanged" />
<Binding Path="CaptureFormat.Framerate"
UpdateSourceTrigger="PropertyChanged" />
<Binding Path="OutputSize.Width"
Expand Down
9 changes: 2 additions & 7 deletions TestApp/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -959,13 +959,8 @@ private void RefreshSourceComboBox()
foreach (RecordableCamera cam in Recorder.GetSystemVideoCaptureDevices())
{
var availableFormats = Recorder.GetSupportedVideoCaptureFormatsForDevice(cam.DeviceName);
var formatsToDisplay = availableFormats
.GroupBy(x => x.Framerate)
.FirstOrDefault()
.GroupBy(x => x.FrameSize)
.SelectMany(x => new List<VideoCaptureFormat> { x.First() })
.ToList();
foreach (var format in formatsToDisplay)

foreach (var format in availableFormats)
{
RecordingSources.Add(new CheckableRecordableCamera(cam) { CaptureFormat = format });
}
Expand Down

0 comments on commit 6612916

Please sign in to comment.