Click here to Skip to main content
Click here to Skip to main content
 

Motion Detection Algorithms

By , 27 Mar 2007
 
namespace dshow.Core
{
	using System;
	using System.Runtime.InteropServices;

	// IMediaEvent interface
	//
	// The IMediaEvent interface contains methods for retrieving event
	// notifications and for overriding the filter graph's default
	// handling of events.
	//
	[ComImport,
	Guid("56A868B6-0AD4-11CE-B03A-0020AF0BA770"),
	InterfaceType(ComInterfaceType.InterfaceIsDual)]
	public interface IMediaEvent
	{
		// Retrieves a handle to a manual-reset event that remains
		// signaled while the queue contains event notifications
		[PreserveSig]
		int GetEventHandle(
			out IntPtr hEvent);

		// Retrieves the next event notification from the event queue
		[PreserveSig]
		int GetEvent(
			out int lEventCode,
			out int lParam1,
			out int lParam2,
			int msTimeout);

		// Waits for the filter graph to render all available data
		[PreserveSig]
		int GetEvent(
			int msTimeout,
			out int pEvCode);

		// Cancels the filter graph manager's default handling of
		// a specified event
		[PreserveSig]
		int CancelDefaultHandling(
			int lEvCode);

		// Restores the filter graph manager's default handling of
		// a specified event
		[PreserveSig]
		int RestoreDefaultHandling(
			int lEvCode);

		// Frees resources associated with the parameters of an event
		[PreserveSig]
		int FreeEventParams(
			int lEventCode,
			int lParam1,
			int lParam2);
	}


	// IMediaEventEx interface
	//
	// IMediaEventEx adds methods that enable an application window
	// to receive messages when events occur
	//
	[ComImport,
	Guid("56A868C0-0AD4-11CE-B03A-0020AF0BA770"),
	InterfaceType(ComInterfaceType.InterfaceIsDual)]
	public interface IMediaEventEx
	{
		// Retrieves a handle to a manual-reset event that remains
		// signaled while the queue contains event notifications
		[PreserveSig]
		int GetEventHandle(
			out IntPtr hEvent);

		// Retrieves the next event notification from the event queue
		[PreserveSig]
		int GetEvent(
			out int lEventCode,
			out int lParam1,
			out int lParam2,
			int msTimeout);

		// Waits for the filter graph to render all available data
		[PreserveSig]
		int WaitForCompletion(
			int msTimeout,
			out int pEvCode);

		// Cancels the filter graph manager's default handling of
		// a specified event
		[PreserveSig]
		int CancelDefaultHandling(
			int lEvCode);

		// Restores the filter graph manager's default handling of
		// a specified event
		[PreserveSig]
		int RestoreDefaultHandling(
			int lEvCode);

		// Frees resources associated with the parameters of an event
		[PreserveSig]
		int FreeEventParams(
			int lEventCode,
			int lParam1,
			int lParam2);

		// Registers a window to process event notifications
		[PreserveSig]
		int SetNotifyWindow(
			IntPtr hwnd,
			int lMsg,
			IntPtr lInstanceData);

		// Enables or disables event notifications
		// 0 - ON, 1 - OFF
		[PreserveSig]
		int SetNotifyWindow(
			int lNoNotifyFlags);

		// Determines whether event notifications are enabled
		[PreserveSig]
		int GetNotifyFlags(
			out int lNoNotifyFlags);
	}
}

By viewing downloads associated with this article you agree to the Terms of use and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

About the Author

Andrew Kirillov
Software Developer (Senior)
United Kingdom United Kingdom
Member
Started software development at about 15 years old and it seems like now it lasts most part of my life. Fortunately did not spend too much time with Z80 and BK0010 and switched to 8086 and further. Similar with programming languages – luckily managed to get away from BASIC and Pascal to things like Assembler, C, C++ and then C#. Apart from daily programming for food, do it also for hobby, where mostly enjoy areas like Computer Vision, Robotics and AI. This led to some open source stuff like AForge.NET.
 
Going out of computers I am just a man loving his family, enjoying traveling, a bit of books, a bit of movies and a mixture of everything else. Always wanted to learn playing guitar, but it seems like 6 strings are much harder than few dozens of keyboard’s keys. Will keep progressing ...

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 27 Mar 2007
Article Copyright 2005 by Andrew Kirillov
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid