// AForge Video Library
// AForge.NET framework
// http://www.aforgenet.com/framework/
//
// Copyright © Andrew Kirillov, 2005-2009
// andrew.kirillov@aforgenet.com
//
namespace AForge.Video
{
using System;
///
/// Video source interface.
///
///
/// The interface describes common methods for different type of video sources.
///
public interface IVideoSource
{
///
/// New frame event.
///
///
/// This event is used to notify clients about new available video frame.
///
/// Since video source may have multiple clients, each client is responsible for
/// making a copy (cloning) of the passed video frame, but video source is responsible for
/// disposing its own original copy after notifying of clients.
///
///
event NewFrameEventHandler NewFrame;
///
/// Video source error event.
///
///
/// This event is used to notify clients about any type of errors occurred in
/// video source object, for example internal exceptions.
///
event VideoSourceErrorEventHandler VideoSourceError;
///
/// Video playing finished event.
///
///
/// This event is used to notify clients that the video playing has finished.
///
///
event PlayingFinishedEventHandler PlayingFinished;
///
/// Video source.
///
///
/// The meaning of the property depends on particular video source.
/// Depending on video source it may be a file name, URL or any other string
/// describing the video source.
///
string Source { get; }
///
/// Received frames count.
///
///
/// Number of frames the video source provided from the moment of the last
/// access to the property.
///
///
int FramesReceived { get; }
///
/// Received bytes count.
///
///
/// Number of bytes the video source provided from the moment of the last
/// access to the property.
///
///
long BytesReceived { get; }
///
/// State of the video source.
///
///
/// Current state of video source object - running or not.
///
bool IsRunning { get; }
///
/// Start video source.
///
///
/// Starts video source and return execution to caller. Video source
/// object creates background thread and notifies about new frames with the
/// help of event.
///
void Start( );
///
/// Signal video source to stop its work.
///
///
/// Signals video source to stop its background thread, stop to
/// provide new frames and free resources.
///
void SignalToStop( );
///
/// Wait for video source has stopped.
///
///
/// Waits for video source stopping after it was signalled to stop using
/// method.
///
void WaitForStop( );
///
/// Stop video source.
///
///
/// Stops video source aborting its thread.
///
void Stop( );
}
}