AForge.NET
AForge.NET copied to clipboard
DirectShow Media Control Crashes on x86
I'm posting to give more visibility to an issue my colleague posted on the official forums (http://www.aforgenet.com/aforge/forum/viewtopic.php?f=2&t=3552&p=10043#p10043).
Essentially, through a series of tests we've concluded that mediaControl.Run( );
https://github.com/andrewkirillov/AForge.NET/blob/master/Sources/Video.DirectShow/VideoCaptureDevice.cs#L1175
will crash if the videoCapabilities
provided to GetPinCapabilitiesAndConfigureSizeAndRate
https://github.com/andrewkirillov/AForge.NET/blob/master/Sources/Video.DirectShow/VideoCaptureDevice.cs#L1115 is NOT null.
To reproduce this, all you need to do is modify the Two Camera Test's MainForm.cs to include the following in
StartCameras()`
// Start cameras
private void StartCameras( )
{
// create first video source
VideoCaptureDevice videoSource1 = new VideoCaptureDevice( videoDevices[camera1Combo.SelectedIndex].MonikerString );
//videoSource1.DesiredFrameRate = 10;
// here we set a custom video resolution which will crash on x86
var vcs = new List<VideoCapabilities>(videoSource1.VideoCapabilities);
if (vcs.Count > 0) {
var vc = vcs[0];
//VideoSource in an instance of VideoCaptureDevice. Commenting out
//this line prevents the crash on x86 builds.
videoSource1.VideoResolution = vc;
}
Interestingly, this only causes a crash on x86. If it's built for, and run, on x64, everything is fine.
As an aside - is this github repo more maintained than the official page http://www.aforgenet.com? I noticed the last build is 2013 but the forum there is somewhat up to date.
I noticed this repo is being managed by @andrewkirillov who, incidentally, authored the AForge.Video.DirectShow.Internals.IMediaControl
file in question.
Thanks, Travis