Click here to Skip to main content
15,885,365 members
Articles / Programming Languages / C#

Intelligent Screen Saver

Rate me:
Please Sign up or sign in to vote.
3.87/5 (17 votes)
15 Aug 2007CPOL2 min read 183.5K   10.9K   111  
A utility to control screen saver on your computer using computer vision (human face detection), rather than idle timer.
namespace dshow.Core
{
	using System;
	using System.Runtime.InteropServices;

	// IBaseFilter interface
	//
	// The IBaseFilter interface provides methods for controlling a filter
	//
	[ComImport,
	Guid("56A86895-0AD4-11CE-B03A-0020AF0BA770"),
	InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	internal interface IBaseFilter
	{
		// --- IPersist Methods

		// Retrieves the class identifier (CLSID) of an object
		[PreserveSig]
		int GetClassID(
			[Out] out Guid pClassID);

		// --- IMediaFilter Methods

		// Informs the filter to transition to the new state
		[PreserveSig]
		int Stop();

		// Informs the filter to transition to the new (paused) state
		[PreserveSig]
		int Pause();

		// Informs the filter to transition to the new (running) state
		[PreserveSig]
		int Run(
			long tStart);

		// Determines the state of the filter
		[PreserveSig]
		int GetState(
			int dwMilliSecsTimeout,
			[Out] out int filtState);

		// Identifies the reference clock to which the
		// filter should synchronize activity
		[PreserveSig]
//		int SetSyncSource(
//			[In] IReferenceClock pClock);
		int SetSyncSource(
			[In] IntPtr pClock);

		// Retrieves the current reference clock in use by this filter
		[PreserveSig]
//		int GetSyncSource(
//			[Out] out IReferenceClock pClock);
		int GetSyncSource(
			[Out] out IntPtr pClock);

		// --- IBaseFilter Methods

		// Enumerates the pins on this filter
		[PreserveSig]
		int EnumPins(
			[Out] out IEnumPins ppEnum);

		// Retrieves the pin with the specified identifier
		[PreserveSig]
		int FindPin(
			[In, MarshalAs(UnmanagedType.LPWStr)] string Id,
			[Out] out IPin ppPin);

		// Retrieves information about the filter
		[PreserveSig]
		int QueryFilterInfo(
			[Out] FilterInfo pInfo);

		// Notifies the filter that it has joined or left the filter graph
		[PreserveSig]
		int JoinFilterGraph(
			[In] IFilterGraph pGraph,
			[In, MarshalAs(UnmanagedType.LPWStr)] string pName);

		// Retrieves a string containing vendor information
		[PreserveSig]
		int QueryVendorInfo(
			[Out, MarshalAs(UnmanagedType.LPWStr)] out	string pVendorInfo);
	}
}

By viewing downloads associated with this article you agree to the Terms of Service 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 Code Project Open License (CPOL)


Written By
Web Developer
Pakistan Pakistan
BCSE - Software Engineering (2000 - 2004)
Foundation University Institute of Management and Computer Sciences.
Pakistan.

MS - Computer Sciences (2004 - 2005)
Lahore Univeristy of Management Sciences
Pakistan.

Comments and Discussions