Click here to Skip to main content
15,881,852 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.6K   9.5K   150  
Simple alarm system for those on a budget..
namespace dshow.Core
{
	using System;
	using System.Runtime.InteropServices;

	// IPin interface
	//
	// The IPin interface represents a single, unidirectional
	// connection point on a filter
	//
	[ComImport,
	Guid("56A86891-0AD4-11CE-B03A-0020AF0BA770"),
	InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	public interface IPin
	{
		// Connects the pin to another pin
		[PreserveSig]
		int Connect(
			[In] IPin pReceivePin,
			[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType	pmt);

		// Accepts a connection from another pin
		[PreserveSig]
		int ReceiveConnection(
			[In] IPin pReceivePin,
			[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType	pmt);

		// Breaks the current pin connection
		[PreserveSig]
		int Disconnect();

		// Retrieves the pin connected to this pin
		[PreserveSig]
		int ConnectedTo(
			[Out] out IPin ppPin);

		// Retrieves the media type for the current pin connection
		[PreserveSig]
		int ConnectionMediaType(
			[Out, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt);

		// Retrieves information about the pin, such as the name,
		// the owning filter, and the direction
		[PreserveSig]
		int QueryPinInfo(
			[Out, MarshalAs(UnmanagedType.LPStruct)] PinInfo pInfo);

		// Retrieves the direction of the pin (input or output)
		[PreserveSig]
		int QueryDirection(
			out PinDirection pPinDir);

		// Retrieves the pin identifier
		[PreserveSig]
		int QueryId(
			[Out, MarshalAs(UnmanagedType.LPWStr)] out string Id);

		// Determines whether the pin accepts a specified media type
		[PreserveSig]
		int QueryAccept(
			[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType	pmt);

		// Enumerates the pin's preferred media types
		[PreserveSig]
		int EnumMediaTypes(
			IntPtr ppEnum);

		// Retrieves the pins that are connected
		// internally to this pin (within the filter)
		[PreserveSig]
		int QueryInternalConnections(
			IntPtr apPin,
			[In, Out] ref int nPin);

		// Notifies the pin that no additional data is expected
		[PreserveSig]
		int EndOfStream();

		// Begins a flush operation
		[PreserveSig]
		int BeginFlush();

		// Ends a flush operation
		[PreserveSig]
		int EndFlush();

		// Notifies the pin that media samples received after
		// this call are grouped as a segment
		[PreserveSig]
		int NewSegment(
			long tStart,
			long tStop,
			double dRate);
	}
}

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