// AForge Video Library
// AForge.NET framework
// http://www.aforgenet.com/framework/
//
// Copyright © AForge.NET, 2009-2011
// contacts@aforgenet.com
//
namespace AForge.Video
{
using System;
///
/// Delegate for new frame event handler.
///
///
/// Sender object.
/// Event arguments.
///
public delegate void NewFrameEventHandler( object sender, NewFrameEventArgs eventArgs );
///
/// Delegate for video source error event handler.
///
///
/// Sender object.
/// Event arguments.
///
public delegate void VideoSourceErrorEventHandler( object sender, VideoSourceErrorEventArgs eventArgs );
///
/// Delegate for playing finished event handler.
///
///
/// Sender object.
/// Reason of finishing video playing.
///
public delegate void PlayingFinishedEventHandler( object sender, ReasonToFinishPlaying reason );
///
/// Reason of finishing video playing.
///
///
/// When video source class fire the event, they
/// need to specify reason of finishing video playing. For example, it may be end of stream reached.
///
public enum ReasonToFinishPlaying
{
///
/// Video playing has finished because it end was reached.
///
EndOfStreamReached,
///
/// Video playing has finished because it was stopped by user.
///
StoppedByUser,
///
/// Video playing has finished because the device was lost (unplugged).
///
DeviceLost,
///
/// Video playing has finished because of some error happened the video source (camera, stream, file, etc.).
/// A error reporting event usually is fired to provide error information.
///
VideoSourceError
}
///
/// Arguments for new frame event from video source.
///
///
public class NewFrameEventArgs : EventArgs
{
private System.Drawing.Bitmap frame;
///
/// Initializes a new instance of the class.
///
///
/// New frame.
///
public NewFrameEventArgs( System.Drawing.Bitmap frame )
{
this.frame = frame;
}
///
/// New frame from video source.
///
///
public System.Drawing.Bitmap Frame
{
get { return frame; }
}
}
///
/// Arguments for video source error event from video source.
///
///
public class VideoSourceErrorEventArgs : EventArgs
{
private string description;
///
/// Initializes a new instance of the class.
///
///
/// Error description.
///
public VideoSourceErrorEventArgs( string description )
{
this.description = description;
}
///
/// Video source error description.
///
///
public string Description
{
get { return description; }
}
}
}