Click here to Skip to main content
15,885,030 members
Articles / Multimedia / DirectX

Cam Alarm 2.0 - Alarm system run from a web camera

Rate me:
Please Sign up or sign in to vote.
4.86/5 (33 votes)
16 Jun 2010CPOL3 min read 85.7K   9.5K   150  
Simple alarm system for those on a budget..
namespace dshow.Core
{
	using System;
	using System.Runtime.InteropServices;

	// IMediaSeeking interface
	//
	// Contains methods for seeking to a position within a stream,
	// and for setting the playback rate
	//
	[ComImport,
	Guid("36B73880-C2C8-11CF-8B46-00805F6CEF60"),
	InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	public interface IMediaSeeking
	{
		// Retrieves all the seeking capabilities of the stream
		[PreserveSig]
		int GetCapabilities(
			out SeekingCapabilities pCapabilities);

		// Queries whether a stream has specified seeking capabilities
		[PreserveSig]
		int CheckCapabilities(
			[In, Out] ref SeekingCapabilities pCapabilities);

		// Determines whether a specified time format is supported
		[PreserveSig]
		int IsFormatSupported(
			[In] ref Guid pFormat);

		// Retrieves the preferred time format for the stream
		[PreserveSig]
		int QueryPreferredFormat(
			[Out] out Guid pFormat);

		// Retrieves the current time format
		[PreserveSig]
		int GetTimeFormat(
			[Out] out Guid pFormat);

		// Determines whether a specified time format
		// is the format currently in use
		[PreserveSig]
		int IsUsingTimeFormat(
			[In] ref Guid pFormat);

		// Sets the time format
		[PreserveSig]
		int SetTimeFormat(
			[In] ref Guid pFormat);

		// Retrieves the duration of the stream
		[PreserveSig]
		int GetDuration(
			out long pDuration);

		// Retrieves the time at which the playback will stop,
		// relative to the duration of the stream
		[PreserveSig]
		int GetStopPosition(
			out long pStop);

		// Retrieves the current position, relative to the
		// total duration of the stream
		[PreserveSig]
		int GetCurrentPosition(
			out long pCurrent);

		// Converts from one time format to another
		[PreserveSig]
		int ConvertTimeFormat(
			out long pTarget,
			[In] ref Guid pTargetFormat,
			long Source, 
			[In] ref Guid pSourceFormat);

		// Sets the current position and the stop position
		[PreserveSig]
		int SetPositions(
			[In, Out] ref long pCurrent,
			SeekingFlags dwCurrentFlags,
			[In, Out] ref long pStop,
			SeekingFlags dwStopFlags);

		// Retrieves the current position and the stop position,
		// relative to the total duration of the stream
		[PreserveSig]
		int GetPositions(
			out long pCurrent,
			out long pStop);

		// Retrieves the range of times in which seeking is efficient
		[PreserveSig]
		int GetAvailable(
			out long pEarliest,
			out long pLatest);

		// Sets the playback rate
		[PreserveSig]
		int SetRate(
			double dRate);

		// Retrieves the playback rate
		[PreserveSig]
		int GetRate(
			out double pdRate);

		// Retrieves the amount of data that will be queued before
		// the start position
		[PreserveSig]
		int GetPreroll(
			out long pllPreroll);
	}
}

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
Network Administrator vtdev.com
Canada Canada
Network and programming specialist. Started in C, and have learned about 14 languages since then. Cisco programmer, and lately writing a lot of C# and WPF code, (learning Java too). If I can dream it up, I can probably put it to code. My software company, (VTDev), is on the verge of releasing a couple of very cool things.. keep you posted.

Comments and Discussions