| | 06-06-2012, 12:45 AM #1
I have two separate code: one for continuous flashlight on and second for video capture. when i run these codes in different project it gives proper output. but the problem occurs when i combine these codes in one project.
In first code which gives continuous flashlight on i have used "_videoCameraVisualizer.SetSource (_videoCamera1);" where _videoCameraVisualizer is object of VideoCameraVisualizer class and _videoCamera1 is object of VideoCamera class. I have use System.Reflection namespace in this project.
in second code which displays video capture i have used "video.SetSource(source);" where video is object of VideoBrush class and source is object of CaptureSource class.
when I combine this codes the flashlight remains on continuously but got error at "source.Start();". The error is "NotSupportedException was unhandled - 0x80131515".
I want coutinuous flashlight on with video capturing. For continuous flashlight I got this link : Locked So I have used this. and for video Capture i have used CaptureSource class and following code on button_click :
if (ispressvideo == false)
ispressvideo = true;
if (source != null)
source = new CaptureSource();
source.VideoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
source.AudioCaptureDevice = CaptureDeviceConfiguration.GetDefaultAudioCaptureDevice();
VideoBrush video = new VideoBrush();
CaptureDisplay.Fill = video;
if (CaptureDeviceConfiguration.AllowedDeviceAccess || CaptureDeviceConfiguration.RequestDeviceAccess())
//_videoCamera1 = null;
source.Start();// Error comes at this place
I am trying to solve this error from last two days but can not understand what is the problem. :(
Thanks in advance.