Click here to Skip to main content
15,896,487 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 184.1K   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;

	// IMediaPosition interface
	//
	// Contains methods for seeking to a position within a stream
	//
	[ComImport,
	Guid("56A868B2-0AD4-11CE-B03A-0020AF0BA770"),
	InterfaceType(ComInterfaceType.InterfaceIsDual)]
	internal interface IMediaPosition
	{
		// Retrieves the duration of the stream
		[PreserveSig]
		int get_Duration(
			out double pLength);

		// Sets the current position, relative to the
		// total duration of the stream
		[PreserveSig]
		int put_CurrentPosition(
			double llTime);
		// Retrieves the current position, relative to the total
		// duration of the stream
		[PreserveSig]
		int get_CurrentPosition(
			out double pllTime);

		// Retrieves the time at which the playback will stop,
		// relative to the duration of the stream
		[PreserveSig]
		int get_StopTime(
			out double pllTime);
		// Sets the time at which the playback will stop,
		// relative to the duration of the stream
		[PreserveSig]
		int put_StopTime(
			double llTime);

		// Retrieves the amount of data that will be queued
		// before the start position
		[PreserveSig]
		int get_PrerollTime(
			out double pllTime);
		// Sets the amount of data that will be queued before
		// the start position
		[PreserveSig]
		int put_PrerollTime(
			double llTime);

		// Sets the playback rate
		[PreserveSig]
		int put_Rate(
			double dRate);
		// Retrieves the playback rate
		[PreserveSig]
		int get_Rate(
			out double pdRate);

		// Determines whether the filter graph can seek forward in the stream
		[PreserveSig]
		int CanSeekForward(
			[Out, MarshalAs(UnmanagedType.Bool)] out bool pCanSeekForward);

		// Determines whether the filter graph can seek backward in the stream
		[PreserveSig]
		int CanSeekBackward(
			[Out, MarshalAs(UnmanagedType.Bool)] out bool pCanSeekBackward);
	}
}

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