本文整理汇总了C#中IVideoSource类的典型用法代码示例。如果您正苦于以下问题:C# IVideoSource类的具体用法?C# IVideoSource怎么用?C# IVideoSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVideoSource类属于命名空间,在下文中一共展示了IVideoSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Camera
public Camera( IVideoSource source, IMotionDetector detector )
{
this.videoSource = source;
this.motionDetecotor = detector;
videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
videoSource.VideoSourceError += new VideoSourceErrorEventHandler( video_VideoSourceError );
}
示例2: OpenVideoSource
// Open video source
private void OpenVideoSource(IVideoSource source)
{
// set busy cursor
this.Cursor = Cursors.WaitCursor;
// reset glyph processor
lock (_sync)
{
_imageProcessor.Reset();
}
// stop current video source
videoSourcePlayer.SignalToStop();
videoSourcePlayer.WaitForStop();
// start new video source
videoSourcePlayer.VideoSource = new AsyncVideoSource(source);
videoSourcePlayer.Start();
// reset stop watch
//stopWatch = null;
// start timer
//timer.Start();
this.Cursor = Cursors.Default;
}
示例3: Camera
public Camera(string deviceName, IVideoSource videoSource, VideoStore videoStore)
{
this.deviceName = deviceName;
this.lastFrameTime = DateTime.MinValue;
this.video = new Video(videoStore);
this.videoSource = videoSource;
this.videoSource.NewFrame += new NewFrameEventHandler(videoSource_NewFrame);
}
示例4: VideoInput
public VideoInput(IVideoSource source, int frames, int pixels, int verschil)
{
aFrames = frames;
bgFrame = new Background(frames, pixels, verschil);
this.source = source;
this.source.NewFrame += new CameraEventHandler(source_NewFrame);
this.source.Start();
}
示例5: VideoFeed
private VideoFeed(IVideoSource source)
{
videoSource = source;
//videoSource.DesiredFrameRate = 60;
//videoSource.DesiredFrameSize = new Size(640, 480);
videoSource.Start();
}
示例6: SetSource
public void SetSource(IVideoSource videoSource)
{
EditableVideoSource.ErrorsChanged -= RaiseCanExecuteChanged;
videoSourceCache = videoSource;
var path = existingSourcePaths.First(p => p.Id == videoSource.PathId).Path;
var source = EditableVideoSource.FromIVideoSource(videoSource, path);
EditableVideoSource = source;
EditableVideoSource.ErrorsChanged += RaiseCanExecuteChanged;
EditSourceMode = true;
}
示例7: FromIVideoSource
public static EditableVideoSource FromIVideoSource(IVideoSource videoSource, string path)
{
return new EditableVideoSource
{
Path = path,
Name = videoSource.Name,
ContentType = videoSource.ContentType,
InfoSource = videoSource.InfoSource,
NoUpdate = videoSource.NoUpdate
};
}
示例8: RegisterNew
public Camera RegisterNew(string deviceName, IVideoSource videoSource)
{
Camera camera = null;
var dir = CheckAndGetDeviceFolder(deviceName);
if (!cameraMap.TryGetValue(deviceName, out camera))
{
camera = new Camera(deviceName, videoSource, new VideoStore(string.Format(@"{0}\{1}", dir, deviceName)));
cameraMap[deviceName] = camera;
}
return camera;
}
示例9: Camera
public Camera(CameraProfile profile, CameraConfig config, IVideoSource videoSource)
{
if (profile == null)
throw new ArgumentNullException("profile");
if (config == null)
throw new ArgumentNullException("config");
if (videoSource == null)
throw new ArgumentNullException("videoSource");
_profile = profile;
_config = config;
_videoSource = videoSource;
}
示例10: YAMDDetector
public YAMDDetector(IVideoSource source, Magnitude low, Magnitude medium, Magnitude high)
{
detector = new MotionDetector(
new SimpleBackgroundModelingDetector(),
new BlobCountingObjectsProcessing(true));
//async video source processes images in a separate thread and uses the NewFrame event
inputStream = new AsyncVideoSource(source);
inputStream.NewFrame += inputStream_NewFrame;
this.low = low;
this.medium = medium;
this.high = high;
timer = new Stopwatch();
stoptimer = new Stopwatch();
videoRecorder = new VideoFileWriter();
Running = false;
buffer = new FixedSizeQueue<Bitmap>();
buffer.Limit = 50;
magnitudes = new Queue<int>();
}
示例11: AsyncVideoSource
/// <summary>
/// Initializes a new instance of the <see cref="AsyncVideoSource"/> class.
/// </summary>
///
/// <param name="nestedVideoSource">Nested video source which is the target for asynchronous processing.</param>
///
public AsyncVideoSource(IVideoSource nestedVideoSource)
{
this.nestedVideoSource = nestedVideoSource;
}
示例12: YVideoClient
//------------------------------------------------------------------------------------------------------------------------
#endregion
#region Constructor
//------------------------------------------------------------------------------------------------------------------------
public YVideoClient(IVideoSource videosource)
{
this.videosource = videosource;
this.videosource.OnFrameCaptured += Videosource_OnFrameCaptured;
}
示例13: CloneStream
public CloneStream(IVideoSource source)
{
_source = source;
}
示例14: Camera
public Camera(IVideoSource source)
{
VideoSource = source;
_motionDetector = null;
VideoSource.NewFrame += VideoNewFrame;
}
示例15: OpenVideoSource
private void OpenVideoSource(IVideoSource source, bool @override)
{
if ([email protected] && Camera != null && Camera.VideoSource != null && Camera.VideoSource.Source == source.Source)
{
return;
}
if (Camera != null && Camera.IsRunning)
{
Disable();
}
if (source is VlcStream)
{
((VlcStream) source).FormatWidth = Camobject.settings.desktopresizewidth;
((VlcStream) source).FormatHeight = Camobject.settings.desktopresizeheight;
}
if (source is FFMPEGStream)
{
((FFMPEGStream)source).HasAudioStream += VideoSourceHasAudioStream;
}
if (source is VlcStream)
{
((VlcStream)source).HasAudioStream += VideoSourceHasAudioStream;
}
if (source is KinectStream)
{
((KinectStream)source).HasAudioStream += VideoSourceHasAudioStream;
((KinectStream)source).InitTripWires(Camobject.alerts.pluginconfig);
((KinectStream)source).TripWire += CameraAlarm;
}
if (source is KinectNetworkStream)
{
((KinectNetworkStream)source).HasAudioStream += VideoSourceHasAudioStream;
((KinectNetworkStream)source).AlertHandler += CameraWindow_AlertHandler;
}
source.PlayingFinished += SourcePlayingFinished;
source.VideoSourceError += SourceVideoSourceError;
Camera = new Camera(source);
}