Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/SIPSorceryMedia.Windows/WindowsVideoEndPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ private async Task<bool> InitialiseDevice(uint width, uint height, uint fps)

if (vidDevice == null)
{
logger.LogWarning($"Could not find video capture device for specified ID {_videoDeviceID}, using default device.");
logger.LogWarning("Could not find video capture device for specified ID {VideoDeviceId}, using default device.", _videoDeviceID);
}
else
{
logger.LogInformation($"Video capture device {vidDevice.Name} selected.");
logger.LogInformation("Video capture device {VideoDeviceName} selected.", vidDevice.Name);
mediaCaptureSettings.VideoDeviceId = vidDevice.Id;
}
}
Expand Down Expand Up @@ -277,7 +277,8 @@ private async Task<bool> InitialiseDevice(uint width, uint height, uint fps)
if (preferredFormat == null)
{
// Still can't get what we want. Log a warning message and take the default.
logger.LogWarning($"The video capture device did not support the requested format (or better) {_width}x{_height} {fps}fps. Using default mode.");
logger.LogWarning("The video capture device did not support the requested format (or better) {Width}x{Height} {Fps}fps. Using default mode.",
_width, _height, fps);

preferredFormat = colorFrameSource.SupportedFormats.First();
}
Expand Down Expand Up @@ -455,7 +456,8 @@ public static async Task ListDevicesAndFormats()
var vidFmt = srcFmt.VideoFormat;
float vidFps = vidFmt.MediaFrameFormat.FrameRate.Numerator / vidFmt.MediaFrameFormat.FrameRate.Denominator;
string pixFmt = vidFmt.MediaFrameFormat.Subtype == MF_I420_PIXEL_FORMAT ? "I420" : vidFmt.MediaFrameFormat.Subtype;
logger.LogDebug($"Video Capture device {vidCapDevice.Name} format {vidFmt.Width}x{vidFmt.Height} {vidFps:0.##}fps {pixFmt}");
logger.LogDebug("Video Capture device {VideoDeviceName} format {Width}x{Height} {Fps:0.##}fps {PixelFormat}",
vidCapDevice.Name, vidFmt.Width, vidFmt.Height, vidFps, pixFmt);
}
}
}
Expand All @@ -478,7 +480,7 @@ public static async Task<List<VideoMediaFrameFormat>> GetDeviceFrameFormats(stri
var vidCapDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
foreach (var vidCapDevice in vidCapDevices)
{
if(vidCapDevice.Name.ToLower() == deviceName.ToLower())
if(string.Equals(vidCapDevice.Name, deviceName, StringComparison.OrdinalIgnoreCase))
{
var mediaCaptureSettings = new MediaCaptureInitializationSettings()
{
Expand Down Expand Up @@ -685,7 +687,8 @@ private void PrintFrameSourceInfo(MediaFrameSource frameSource)
string pixFmt = frameSource.CurrentFormat.Subtype;
string deviceName = frameSource.Info.DeviceInformation.Name;

logger.LogInformation($"Video capture device {deviceName} successfully initialised: {width}x{height} {fps:0.##}fps pixel format {pixFmt}.");
logger.LogInformation("Video capture device {VideoDeviceName} successfully initialised: {Width}x{Height} {Fps:0.##}fps pixel format {PixelFormat}.",
deviceName, width, height, fps, pixFmt);
}

public void Dispose()
Expand Down
Loading