mirror of
https://github.com/bdnugget/Magic-Vision.git
synced 2026-11-07 09:17:36 +00:00
First commit
This commit is contained in:
commit
2c386a7d0d
125 files changed
+63570
No files matched your search
@@ -0,0 +1,54 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicVision", "MagicVision\MagicVision.csproj", "{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DirectX.Capture", "MagicVision\DirectX.Capture\DirectX.Capture.csproj", "{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DShowNET", "MagicVision\DShowNET\DShowNET.csproj", "{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Debug|x86.Build.0 = Debug|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Release|x86.ActiveCfg = Release|x86
|
||||
{6E246F05-9296-492B-B7F9-DCC99ED6FD4B}.Release|x86.Build.0 = Release|x86
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,576 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>AForge.Imaging.Formats</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:AForge.Imaging.Formats.ImageDecoder">
|
||||
<summary>
|
||||
Image decoder to decode different custom image file formats.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The class represent a help class, which simplifies decoding of image
|
||||
files finding appropriate image decoder automatically (using list of registered
|
||||
image decoders). Instead of using required image decoder directly, users may use this
|
||||
class, which will find required decoder by file's extension.</para>
|
||||
|
||||
<para>By default the class registers on its own all decoders, which are available in
|
||||
AForge.Imaging.Formats library. If user has implementation of his own image decoders, he
|
||||
needs to register them using <see cref="M:AForge.Imaging.Formats.ImageDecoder.RegisterDecoder(System.String,AForge.Imaging.Formats.IImageDecoder)"/> method to be able to use them through
|
||||
the <see cref="T:AForge.Imaging.Formats.ImageDecoder"/> class.</para>
|
||||
|
||||
<para><note>If the class can not find appropriate decode in the list of registered
|
||||
decoders, it passes file to .NET's image decoder for decoding.</note></para>
|
||||
|
||||
<para>Sample usage:</para>
|
||||
<code>
|
||||
// sample file name
|
||||
string fileName = "myFile.pnm";
|
||||
// decode image file
|
||||
Bitmap = ImageDecoder.DecodeFromFile( fileName );
|
||||
</code>
|
||||
</remarks>
|
||||
|
||||
<seealso cref="T:AForge.Imaging.Formats.PNMCodec"/>
|
||||
<seealso cref="T:AForge.Imaging.Formats.FITSCodec"/>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.ImageDecoder.RegisterDecoder(System.String,AForge.Imaging.Formats.IImageDecoder)">
|
||||
<summary>
|
||||
Register image decoder for a specified file extension.
|
||||
</summary>
|
||||
|
||||
<param name="fileExtension">File extension to register decoder for ("bmp", for example).</param>
|
||||
<param name="decoder">Image decoder to use for the specified file extension.</param>
|
||||
|
||||
<remarks><para>The method allows to register image decoder object, which should be used
|
||||
to decode images from files with the specified extension.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.ImageDecoder.DecodeFromFile(System.String)">
|
||||
<summary>
|
||||
Decode first frame for the specified file.
|
||||
</summary>
|
||||
|
||||
<param name="fileName">File name to read image from.</param>
|
||||
|
||||
<returns>Return decoded image. In the case if file format support multiple
|
||||
frames, the method return the first frame.</returns>
|
||||
|
||||
<remarks><para>The method uses table of registered image decoders to find the one,
|
||||
which should be used for the specified file. If there is not appropriate decoder
|
||||
found, the method uses default .NET's image decoding routine (see
|
||||
<see cref="M:System.Drawing.Image.FromFile(System.String)"/>).</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.ImageDecoder.DecodeFromFile(System.String,AForge.Imaging.Formats.ImageInfo@)">
|
||||
<summary>
|
||||
Decode first frame for the specified file.
|
||||
</summary>
|
||||
|
||||
<param name="fileName">File name to read image from.</param>
|
||||
<param name="imageInfo">Information about the decoded image.</param>
|
||||
|
||||
<returns>Return decoded image. In the case if file format support multiple
|
||||
frames, the method return the first frame.</returns>
|
||||
|
||||
<remarks><para>The method uses table of registered image decoders to find the one,
|
||||
which should be used for the specified file. If there is not appropriate decoder
|
||||
found, the method uses default .NET's image decoding routine (see
|
||||
<see cref="M:System.Drawing.Image.FromFile(System.String)"/>).</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Imaging.Formats.PNMImageInfo">
|
||||
<summary>
|
||||
Information about PNM image's frame.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:AForge.Imaging.Formats.ImageInfo">
|
||||
<summary>
|
||||
Information about image's frame.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This is a base class, which keeps basic information about image, like its width,
|
||||
height, etc. Classes, which inherit from this, may define more properties describing certain
|
||||
image formats.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="F:AForge.Imaging.Formats.ImageInfo.width">
|
||||
<summary>
|
||||
Image's width.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Imaging.Formats.ImageInfo.height">
|
||||
<summary>
|
||||
Image's height.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Imaging.Formats.ImageInfo.bitsPerPixel">
|
||||
<summary>
|
||||
Number of bits per image's pixel.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Imaging.Formats.ImageInfo.frameIndex">
|
||||
<summary>
|
||||
Frame's index.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Imaging.Formats.ImageInfo.totalFrames">
|
||||
<summary>
|
||||
Total frames in the image.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.ImageInfo.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Imaging.Formats.ImageInfo"/> class.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.ImageInfo.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Imaging.Formats.ImageInfo"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="width">Image's width.</param>
|
||||
<param name="height">Image's height.</param>
|
||||
<param name="bitsPerPixel">Number of bits per image's pixel.</param>
|
||||
<param name="frameIndex">Frame's index.</param>
|
||||
<param name="totalFrames">Total frames in the image.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.ImageInfo.Clone">
|
||||
<summary>
|
||||
Creates a new object that is a copy of the current instance.
|
||||
</summary>
|
||||
|
||||
<returns>A new object that is a copy of this instance.</returns>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.ImageInfo.Width">
|
||||
<summary>
|
||||
Image's width.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.ImageInfo.Height">
|
||||
<summary>
|
||||
Image's height.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.ImageInfo.BitsPerPixel">
|
||||
<summary>
|
||||
Number of bits per image's pixel.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.ImageInfo.FrameIndex">
|
||||
<summary>
|
||||
Frame's index.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Some image formats support storing multiple frames in one image file.
|
||||
The property specifies index of a particular frame.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.ImageInfo.TotalFrames">
|
||||
<summary>
|
||||
Total frames in the image.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Some image formats support storing multiple frames in one image file.
|
||||
The property specifies total number of frames in image file.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.PNMImageInfo.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Imaging.Formats.PNMImageInfo"/> class.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.PNMImageInfo.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Imaging.Formats.PNMImageInfo"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="width">Image's width.</param>
|
||||
<param name="height">Image's height.</param>
|
||||
<param name="bitsPerPixel">Number of bits per image's pixel.</param>
|
||||
<param name="frameIndex">Frame's index.</param>
|
||||
<param name="totalFrames">Total frames in the image.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.PNMImageInfo.Clone">
|
||||
<summary>
|
||||
Creates a new object that is a copy of the current instance.
|
||||
</summary>
|
||||
|
||||
<returns>A new object that is a copy of this instance.</returns>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.PNMImageInfo.Version">
|
||||
<summary>
|
||||
PNM file version (format), [1, 6].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.PNMImageInfo.MaxDataValue">
|
||||
<summary>
|
||||
Maximum pixel's value in source PNM image.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The value is used to scale image's data converting them
|
||||
from original data range to the range of
|
||||
<see cref="P:AForge.Imaging.Formats.ImageInfo.BitsPerPixel">supported bits per pixel</see> format.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Imaging.Formats.PNMCodec">
|
||||
<summary>
|
||||
PNM image format decoder.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The PNM (an acronym derived from "Portable Any Map") format is an
|
||||
abstraction of the PBM, PGM and PPM formats. I.e. the name "PNM" refers collectively
|
||||
to PBM (binary images), PGM (grayscale images) and PPM (color image) image formats.</para>
|
||||
|
||||
<para>Image in PNM format can be found in different scientific databases and laboratories,
|
||||
for example <i>Yale Face Database</i> and <i>AT&T Face Database</i>.</para>
|
||||
|
||||
<para><note>Only PNM images of P5 (binary encoded PGM) and P6 (binary encoded PPM) formats
|
||||
are supported at this point.</note></para>
|
||||
|
||||
<para><note>The maximum supported pixel value is 255 at this point.</note></para>
|
||||
|
||||
<para><note>The class supports only one-frame PNM images. As it is specified in format
|
||||
specification, the multi-frame PNM images has appeared starting from 2000.</note></para>
|
||||
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Imaging.Formats.IImageDecoder">
|
||||
<summary>
|
||||
Image decoder interface, which specifies set of methods, which should be
|
||||
implemented by image decoders for different file formats.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The interface specifies set of methods, which are suitable not
|
||||
only for simple one-frame image formats. The interface also defines methods
|
||||
to work with image formats designed to store multiple frames and image formats
|
||||
which provide different type of image description (like acquisition
|
||||
parameters, etc).
|
||||
</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.IImageDecoder.DecodeSingleFrame(System.IO.Stream)">
|
||||
<summary>
|
||||
Decode first frame of image from the specified stream.
|
||||
</summary>
|
||||
|
||||
<param name="stream">Source stream, which contains encoded image.</param>
|
||||
|
||||
<returns>Returns decoded image frame.</returns>
|
||||
|
||||
<remarks>
|
||||
<para>For one-frame image formats the method is supposed to decode single
|
||||
available frame. For multi-frame image formats the first frame should be
|
||||
decoded.</para>
|
||||
|
||||
<para>Implementations of this method may throw
|
||||
<see cref="T:System.FormatException"/> exception to report about unrecognized image
|
||||
format, <see cref="T:System.ArgumentException"/> exception to report about incorrectly
|
||||
formatted image or <see cref="T:System.NotSupportedException"/> exception to report if
|
||||
certain formats are not supported.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.IImageDecoder.Open(System.IO.Stream)">
|
||||
<summary>
|
||||
Open specified stream.
|
||||
</summary>
|
||||
|
||||
<param name="stream">Stream to open.</param>
|
||||
|
||||
<returns>Returns number of images found in the specified stream.</returns>
|
||||
|
||||
<remarks><para>Implementation of this method is supposed to read image's header,
|
||||
checking for correct image format and reading its atributes.</para>
|
||||
|
||||
<para>Implementations of this method may throw
|
||||
<see cref="T:System.FormatException"/> exception to report about unrecognized image
|
||||
format, <see cref="T:System.ArgumentException"/> exception to report about incorrectly
|
||||
formatted image or <see cref="T:System.NotSupportedException"/> exception to report if
|
||||
certain formats are not supported.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.IImageDecoder.DecodeFrame(System.Int32,AForge.Imaging.Formats.ImageInfo@)">
|
||||
<summary>
|
||||
Decode specified frame.
|
||||
</summary>
|
||||
|
||||
<param name="frameIndex">Image frame to decode.</param>
|
||||
<param name="imageInfo">Receives information about decoded frame.</param>
|
||||
|
||||
<returns>Returns decoded frame.</returns>
|
||||
|
||||
<remarks>Implementations of this method may throw
|
||||
<see cref="T:System.NullReferenceException"/> exception in the case if no image
|
||||
stream was opened previously, <see cref="T:System.ArgumentOutOfRangeException"/> in the
|
||||
case if stream does not contain frame with specified index or <see cref="T:System.ArgumentException"/>
|
||||
exception to report about incorrectly formatted image.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.IImageDecoder.Close">
|
||||
<summary>
|
||||
Close decoding of previously opened stream.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Implementations of this method don't close stream itself, but just close
|
||||
decoding cleaning all associated data with it.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.PNMCodec.DecodeSingleFrame(System.IO.Stream)">
|
||||
<summary>
|
||||
Decode first frame of PNM image.
|
||||
</summary>
|
||||
|
||||
<param name="stream">Source stream, which contains encoded image.</param>
|
||||
|
||||
<returns>Returns decoded image frame.</returns>
|
||||
|
||||
<exception cref="T:System.FormatException">Not a PNM image format.</exception>
|
||||
<exception cref="T:System.NotSupportedException">Format of the PNM image is not supported.</exception>
|
||||
<exception cref="T:System.ArgumentException">The stream contains invalid (broken) PNM image.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.PNMCodec.Open(System.IO.Stream)">
|
||||
<summary>
|
||||
Open specified stream.
|
||||
</summary>
|
||||
|
||||
<param name="stream">Stream to open.</param>
|
||||
|
||||
<returns>Returns number of images found in the specified stream.</returns>
|
||||
|
||||
<exception cref="T:System.FormatException">Not a PNM image format.</exception>
|
||||
<exception cref="T:System.NotSupportedException">Format of the PNM image is not supported.</exception>
|
||||
<exception cref="T:System.ArgumentException">The stream contains invalid (broken) PNM image.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.PNMCodec.DecodeFrame(System.Int32,AForge.Imaging.Formats.ImageInfo@)">
|
||||
<summary>
|
||||
Decode specified frame.
|
||||
</summary>
|
||||
|
||||
<param name="frameIndex">Image frame to decode.</param>
|
||||
<param name="imageInfo">Receives information about decoded frame.</param>
|
||||
|
||||
<returns>Returns decoded frame.</returns>
|
||||
|
||||
<exception cref="T:System.NullReferenceException">No image stream was opened previously.</exception>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">Stream does not contain frame with specified index.</exception>
|
||||
<exception cref="T:System.ArgumentException">The stream contains invalid (broken) PNM image.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.PNMCodec.Close">
|
||||
<summary>
|
||||
Close decoding of previously opened stream.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The method does not close stream itself, but just closes
|
||||
decoding cleaning all associated data with it.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Imaging.Formats.FITSImageInfo">
|
||||
<summary>
|
||||
Information about FITS image's frame.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.FITSImageInfo.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Imaging.Formats.FITSImageInfo"/> class.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.FITSImageInfo.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Imaging.Formats.FITSImageInfo"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="width">Image's width.</param>
|
||||
<param name="height">Image's height.</param>
|
||||
<param name="bitsPerPixel">Number of bits per image's pixel.</param>
|
||||
<param name="frameIndex">Frame's index.</param>
|
||||
<param name="totalFrames">Total frames in the image.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.FITSImageInfo.Clone">
|
||||
<summary>
|
||||
Creates a new object that is a copy of the current instance.
|
||||
</summary>
|
||||
|
||||
<returns>A new object that is a copy of this instance.</returns>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.FITSImageInfo.OriginalBitsPerPixl">
|
||||
<summary>
|
||||
Original bits per pixel.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The property specifies original number of bits per image's pixel. For
|
||||
FITS images the value may be equal to 8, 16, 32, -32 (32 bit image with float data
|
||||
type for pixel encoding), -64 (64 bit image with double data type for pixel encoding).
|
||||
</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.FITSImageInfo.MinDataValue">
|
||||
<summary>
|
||||
Minimum data value found during parsing FITS image.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Minimum and maximum data values are used to scale image's data converting
|
||||
them from <see cref="P:AForge.Imaging.Formats.FITSImageInfo.OriginalBitsPerPixl">original bits per pixel</see> format to
|
||||
<see cref="P:AForge.Imaging.Formats.ImageInfo.BitsPerPixel">supported bits per pixel</see> format.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.FITSImageInfo.MaxDataValue">
|
||||
<summary>
|
||||
Maximum data value found during parsing FITS image.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Minimum and maximum data values are used to scale image's data converting
|
||||
them from <see cref="P:AForge.Imaging.Formats.FITSImageInfo.OriginalBitsPerPixl">original bits per pixel</see> format to
|
||||
<see cref="P:AForge.Imaging.Formats.ImageInfo.BitsPerPixel">supported bits per pixel</see> format.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.FITSImageInfo.Telescope">
|
||||
<summary>
|
||||
Telescope used for object's observation.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.FITSImageInfo.Object">
|
||||
<summary>
|
||||
Object acquired during observation.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.FITSImageInfo.Observer">
|
||||
<summary>
|
||||
Observer doing object's acquiring.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AForge.Imaging.Formats.FITSImageInfo.Instrument">
|
||||
<summary>
|
||||
Instrument used for observation.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:AForge.Imaging.Formats.FITSCodec">
|
||||
<summary>
|
||||
FITS image format decoder.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The FITS (an acronym derived from "Flexible Image Transport System") format
|
||||
is an astronomical image and table format created and supported by NASA. FITS is the most
|
||||
commonly used in astronomy and is designed specifically for scientific data. Different astronomical
|
||||
organizations keep their images acquired using telescopes and other equipment in FITS format.</para>
|
||||
|
||||
<para><note>The class extracts image frames only from the main data section of FITS file.
|
||||
2D (single frame) and 3D (series of frames) data structures are supported.</note></para>
|
||||
|
||||
<para><note>During image reading/parsing, its data are scaled using minimum and maximum values of
|
||||
the source image data. FITS tags are not used for this purpose - data are scaled from the
|
||||
[min, max] range found to the range of supported image format ([0, 255] for 8 bpp grayscale
|
||||
or [0, 65535] for 16 bpp grayscale image).</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.FITSCodec.DecodeSingleFrame(System.IO.Stream)">
|
||||
<summary>
|
||||
Decode first frame of FITS image.
|
||||
</summary>
|
||||
|
||||
<param name="stream">Source stream, which contains encoded image.</param>
|
||||
|
||||
<returns>Returns decoded image frame.</returns>
|
||||
|
||||
<exception cref="T:System.FormatException">Not a FITS image format.</exception>
|
||||
<exception cref="T:System.NotSupportedException">Format of the FITS image is not supported.</exception>
|
||||
<exception cref="T:System.ArgumentException">The stream contains invalid (broken) FITS image.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.FITSCodec.Open(System.IO.Stream)">
|
||||
<summary>
|
||||
Open specified stream.
|
||||
</summary>
|
||||
|
||||
<param name="stream">Stream to open.</param>
|
||||
|
||||
<returns>Returns number of images found in the specified stream.</returns>
|
||||
|
||||
<exception cref="T:System.FormatException">Not a FITS image format.</exception>
|
||||
<exception cref="T:System.NotSupportedException">Format of the FITS image is not supported.</exception>
|
||||
<exception cref="T:System.ArgumentException">The stream contains invalid (broken) FITS image.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.FITSCodec.DecodeFrame(System.Int32,AForge.Imaging.Formats.ImageInfo@)">
|
||||
<summary>
|
||||
Decode specified frame.
|
||||
</summary>
|
||||
|
||||
<param name="frameIndex">Image frame to decode.</param>
|
||||
<param name="imageInfo">Receives information about decoded frame.</param>
|
||||
|
||||
<returns>Returns decoded frame.</returns>
|
||||
|
||||
<exception cref="T:System.NullReferenceException">No image stream was opened previously.</exception>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">Stream does not contain frame with specified index.</exception>
|
||||
<exception cref="T:System.ArgumentException">The stream contains invalid (broken) FITS image.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.FITSCodec.Close">
|
||||
<summary>
|
||||
Close decoding of previously opened stream.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The method does not close stream itself, but just closes
|
||||
decoding cleaning all associated data with it.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Imaging.Formats.Tools">
|
||||
<summary>
|
||||
Set of tools used internally in AForge.Imaging.Formats library.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.Tools.CreateGrayscaleImage(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Create and initialize new grayscale image.
|
||||
</summary>
|
||||
|
||||
<param name="width">Image width.</param>
|
||||
<param name="height">Image height.</param>
|
||||
|
||||
<returns>Returns new created grayscale image.</returns>
|
||||
|
||||
<remarks><para>AForge.Imaging.Image.CreateGrayscaleImage() function
|
||||
could be used instead, which does the some. But it was not used to get
|
||||
rid of dependency on AForge.Imaing library.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Imaging.Formats.Tools.ReadStream(System.IO.Stream,System.Byte[],System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Read specified amount of bytes from the specified stream.
|
||||
</summary>
|
||||
|
||||
<param name="stream">Source sream to read data from.</param>
|
||||
<param name="buffer">Buffer to read data into.</param>
|
||||
<param name="offset">Offset in buffer to put data into.</param>
|
||||
<param name="count">Number of bytes to read.</param>
|
||||
|
||||
<returns>Returns total number of bytes read. It may be smaller than requested amount only
|
||||
in the case if end of stream was reached.</returns>
|
||||
|
||||
<remarks><para>This tool function guarantees that requested number of bytes
|
||||
was read from the source stream (.NET streams don't guarantee this and may return less bytes
|
||||
than it was requested). Only in the case if end of stream was reached, the function
|
||||
may return with less bytes read.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,472 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>AForge.MachineLearning</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:AForge.MachineLearning.Sarsa">
|
||||
<summary>
|
||||
Sarsa learning algorithm.
|
||||
</summary>
|
||||
|
||||
<remarks>The class provides implementation of Sarse algorithm, known as
|
||||
on-policy Temporal Difference control.</remarks>
|
||||
|
||||
<seealso cref="T:AForge.MachineLearning.QLearning"/>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.Sarsa.#ctor(System.Int32,System.Int32,AForge.MachineLearning.IExplorationPolicy)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.MachineLearning.Sarsa"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="states">Amount of possible states.</param>
|
||||
<param name="actions">Amount of possible actions.</param>
|
||||
<param name="explorationPolicy">Exploration policy.</param>
|
||||
|
||||
<remarks>Action estimates are randomized in the case of this constructor
|
||||
is used.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.Sarsa.#ctor(System.Int32,System.Int32,AForge.MachineLearning.IExplorationPolicy,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.MachineLearning.Sarsa"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="states">Amount of possible states.</param>
|
||||
<param name="actions">Amount of possible actions.</param>
|
||||
<param name="explorationPolicy">Exploration policy.</param>
|
||||
<param name="randomize">Randomize action estimates or not.</param>
|
||||
|
||||
<remarks>The <b>randomize</b> parameter specifies if initial action estimates should be randomized
|
||||
with small values or not. Randomization of action values may be useful, when greedy exploration
|
||||
policies are used. In this case randomization ensures that actions of the same type are not chosen always.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.Sarsa.GetAction(System.Int32)">
|
||||
<summary>
|
||||
Get next action from the specified state.
|
||||
</summary>
|
||||
|
||||
<param name="state">Current state to get an action for.</param>
|
||||
|
||||
<returns>Returns the action for the state.</returns>
|
||||
|
||||
<remarks>The method returns an action according to current
|
||||
<see cref="P:AForge.MachineLearning.Sarsa.ExplorationPolicy">exploration policy</see>.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.Sarsa.UpdateState(System.Int32,System.Int32,System.Double,System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Update Q-function's value for the previous state-action pair.
|
||||
</summary>
|
||||
|
||||
<param name="previousState">Curren state.</param>
|
||||
<param name="previousAction">Action, which lead from previous to the next state.</param>
|
||||
<param name="reward">Reward value, received by taking specified action from previous state.</param>
|
||||
<param name="nextState">Next state.</param>
|
||||
<param name="nextAction">Next action.</param>
|
||||
|
||||
<remarks>Updates Q-function's value for the previous state-action pair in
|
||||
the case if the next state is non terminal.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.Sarsa.UpdateState(System.Int32,System.Int32,System.Double)">
|
||||
<summary>
|
||||
Update Q-function's value for the previous state-action pair.
|
||||
</summary>
|
||||
|
||||
<param name="previousState">Curren state.</param>
|
||||
<param name="previousAction">Action, which lead from previous to the next state.</param>
|
||||
<param name="reward">Reward value, received by taking specified action from previous state.</param>
|
||||
|
||||
<remarks>Updates Q-function's value for the previous state-action pair in
|
||||
the case if the next state is terminal.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.Sarsa.StatesCount">
|
||||
<summary>
|
||||
Amount of possible states.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.Sarsa.ActionsCount">
|
||||
<summary>
|
||||
Amount of possible actions.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.Sarsa.ExplorationPolicy">
|
||||
<summary>
|
||||
Exploration policy.
|
||||
</summary>
|
||||
|
||||
<remarks>Policy, which is used to select actions.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.Sarsa.LearningRate">
|
||||
<summary>
|
||||
Learning rate, [0, 1].
|
||||
</summary>
|
||||
|
||||
<remarks>The value determines the amount of updates Q-function receives
|
||||
during learning. The greater the value, the more updates the function receives.
|
||||
The lower the value, the less updates it receives.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.Sarsa.DiscountFactor">
|
||||
<summary>
|
||||
Discount factor, [0, 1].
|
||||
</summary>
|
||||
|
||||
<remarks>Discount factor for the expected summary reward. The value serves as
|
||||
multiplier for the expected reward. So if the value is set to 1,
|
||||
then the expected summary reward is not discounted. If the value is getting
|
||||
smaller, then smaller amount of the expected reward is used for actions'
|
||||
estimates update.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.MachineLearning.RouletteWheelExploration">
|
||||
<summary>
|
||||
Roulette wheel exploration policy.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The class implements roulette whell exploration policy. Acording to the policy,
|
||||
action <b>a</b> at state <b>s</b> is selected with the next probability:</para>
|
||||
<code lang="none">
|
||||
Q( s, a )
|
||||
p( s, a ) = ------------------
|
||||
SUM( Q( s, b ) )
|
||||
b
|
||||
</code>
|
||||
<para>where <b>Q(s, a)</b> is action's <b>a</b> estimation (usefulness) at state <b>s</b>.</para>
|
||||
|
||||
<para><note>The exploration policy may be applied only in cases, when action estimates (usefulness)
|
||||
are represented with positive value greater then 0.</note></para>
|
||||
</remarks>
|
||||
|
||||
<seealso cref="T:AForge.MachineLearning.BoltzmannExploration"/>
|
||||
<seealso cref="T:AForge.MachineLearning.EpsilonGreedyExploration"/>
|
||||
<seealso cref="T:AForge.MachineLearning.TabuSearchExploration"/>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.MachineLearning.IExplorationPolicy">
|
||||
<summary>
|
||||
Exploration policy interface.
|
||||
</summary>
|
||||
|
||||
<remarks>The interface describes exploration policies, which are used in Reinforcement
|
||||
Learning to explore state space.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.IExplorationPolicy.ChooseAction(System.Double[])">
|
||||
<summary>
|
||||
Choose an action.
|
||||
</summary>
|
||||
|
||||
<param name="actionEstimates">Action estimates.</param>
|
||||
|
||||
<returns>Returns selected action.</returns>
|
||||
|
||||
<remarks>The method chooses an action depending on the provided estimates. The
|
||||
estimates can be any sort of estimate, which values usefulness of the action
|
||||
(expected summary reward, discounted reward, etc).</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.RouletteWheelExploration.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.MachineLearning.RouletteWheelExploration"/> class.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.RouletteWheelExploration.ChooseAction(System.Double[])">
|
||||
<summary>
|
||||
Choose an action.
|
||||
</summary>
|
||||
|
||||
<param name="actionEstimates">Action estimates.</param>
|
||||
|
||||
<returns>Returns selected action.</returns>
|
||||
|
||||
<remarks>The method chooses an action depending on the provided estimates. The
|
||||
estimates can be any sort of estimate, which values usefulness of the action
|
||||
(expected summary reward, discounted reward, etc).</remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.MachineLearning.EpsilonGreedyExploration">
|
||||
<summary>
|
||||
Epsilon greedy exploration policy.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The class implements epsilon greedy exploration policy. Acording to the policy,
|
||||
the best action is chosen with probability <b>1-epsilon</b>. Otherwise,
|
||||
with probability <b>epsilon</b>, any other action, except the best one, is
|
||||
chosen randomly.</para>
|
||||
|
||||
<para>According to the policy, the epsilon value is known also as exploration rate.</para>
|
||||
</remarks>
|
||||
|
||||
<seealso cref="T:AForge.MachineLearning.RouletteWheelExploration"/>
|
||||
<seealso cref="T:AForge.MachineLearning.BoltzmannExploration"/>
|
||||
<seealso cref="T:AForge.MachineLearning.TabuSearchExploration"/>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.EpsilonGreedyExploration.#ctor(System.Double)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.MachineLearning.EpsilonGreedyExploration"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="epsilon">Epsilon value (exploration rate).</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.EpsilonGreedyExploration.ChooseAction(System.Double[])">
|
||||
<summary>
|
||||
Choose an action.
|
||||
</summary>
|
||||
|
||||
<param name="actionEstimates">Action estimates.</param>
|
||||
|
||||
<returns>Returns selected action.</returns>
|
||||
|
||||
<remarks>The method chooses an action depending on the provided estimates. The
|
||||
estimates can be any sort of estimate, which values usefulness of the action
|
||||
(expected summary reward, discounted reward, etc).</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.EpsilonGreedyExploration.Epsilon">
|
||||
<summary>
|
||||
Epsilon value (exploration rate), [0, 1].
|
||||
</summary>
|
||||
|
||||
<remarks><para>The value determines the amount of exploration driven by the policy.
|
||||
If the value is high, then the policy drives more to exploration - choosing random
|
||||
action, which excludes the best one. If the value is low, then the policy is more
|
||||
greedy - choosing the beat so far action.
|
||||
</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.MachineLearning.TabuSearchExploration">
|
||||
<summary>
|
||||
Tabu search exploration policy.
|
||||
</summary>
|
||||
|
||||
<remarks>The class implements simple tabu search exploration policy,
|
||||
allowing to set certain actions as tabu for a specified amount of
|
||||
iterations. The actual exploration and choosing from non-tabu actions
|
||||
is done by <see cref="P:AForge.MachineLearning.TabuSearchExploration.BasePolicy">base exploration policy</see>.</remarks>
|
||||
|
||||
<seealso cref="T:AForge.MachineLearning.BoltzmannExploration"/>
|
||||
<seealso cref="T:AForge.MachineLearning.EpsilonGreedyExploration"/>
|
||||
<seealso cref="T:AForge.MachineLearning.RouletteWheelExploration"/>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.TabuSearchExploration.#ctor(System.Int32,AForge.MachineLearning.IExplorationPolicy)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.MachineLearning.TabuSearchExploration"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="actions">Total actions count.</param>
|
||||
<param name="basePolicy">Base exploration policy.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.TabuSearchExploration.ChooseAction(System.Double[])">
|
||||
<summary>
|
||||
Choose an action.
|
||||
</summary>
|
||||
|
||||
<param name="actionEstimates">Action estimates.</param>
|
||||
|
||||
<returns>Returns selected action.</returns>
|
||||
|
||||
<remarks>The method chooses an action depending on the provided estimates. The
|
||||
estimates can be any sort of estimate, which values usefulness of the action
|
||||
(expected summary reward, discounted reward, etc). The action is choosed from
|
||||
non-tabu actions only.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.TabuSearchExploration.ResetTabuList">
|
||||
<summary>
|
||||
Reset tabu list.
|
||||
</summary>
|
||||
|
||||
<remarks>Clears tabu list making all actions allowed.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.TabuSearchExploration.SetTabuAction(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Set tabu action.
|
||||
</summary>
|
||||
|
||||
<param name="action">Action to set tabu for.</param>
|
||||
<param name="tabuTime">Tabu time in iterations.</param>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.TabuSearchExploration.BasePolicy">
|
||||
<summary>
|
||||
Base exploration policy.
|
||||
</summary>
|
||||
|
||||
<remarks>Base exploration policy is the policy, which is used
|
||||
to choose from non-tabu actions.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.MachineLearning.BoltzmannExploration">
|
||||
<summary>
|
||||
Boltzmann distribution exploration policy.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The class implements exploration policy base on Boltzmann distribution.
|
||||
Acording to the policy, action <b>a</b> at state <b>s</b> is selected with the next probability:</para>
|
||||
<code lang="none">
|
||||
exp( Q( s, a ) / t )
|
||||
p( s, a ) = -----------------------------
|
||||
SUM( exp( Q( s, b ) / t ) )
|
||||
b
|
||||
</code>
|
||||
<para>where <b>Q(s, a)</b> is action's <b>a</b> estimation (usefulness) at state <b>s</b> and
|
||||
<b>t</b> is <see cref="P:AForge.MachineLearning.BoltzmannExploration.Temperature"/>.</para>
|
||||
</remarks>
|
||||
|
||||
<seealso cref="T:AForge.MachineLearning.RouletteWheelExploration"/>
|
||||
<seealso cref="T:AForge.MachineLearning.EpsilonGreedyExploration"/>
|
||||
<seealso cref="T:AForge.MachineLearning.TabuSearchExploration"/>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.BoltzmannExploration.#ctor(System.Double)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.MachineLearning.BoltzmannExploration"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="temperature">Termperature parameter of Boltzmann distribution.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.BoltzmannExploration.ChooseAction(System.Double[])">
|
||||
<summary>
|
||||
Choose an action.
|
||||
</summary>
|
||||
|
||||
<param name="actionEstimates">Action estimates.</param>
|
||||
|
||||
<returns>Returns selected action.</returns>
|
||||
|
||||
<remarks>The method chooses an action depending on the provided estimates. The
|
||||
estimates can be any sort of estimate, which values usefulness of the action
|
||||
(expected summary reward, discounted reward, etc).</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.BoltzmannExploration.Temperature">
|
||||
<summary>
|
||||
Termperature parameter of Boltzmann distribution, >0.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The property sets the balance between exploration and greedy actions.
|
||||
If temperature is low, then the policy tends to be more greedy.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.MachineLearning.QLearning">
|
||||
<summary>
|
||||
QLearning learning algorithm.
|
||||
</summary>
|
||||
|
||||
<remarks>The class provides implementation of Q-Learning algorithm, known as
|
||||
off-policy Temporal Difference control.</remarks>
|
||||
|
||||
<seealso cref="T:AForge.MachineLearning.Sarsa"/>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.QLearning.#ctor(System.Int32,System.Int32,AForge.MachineLearning.IExplorationPolicy)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.MachineLearning.QLearning"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="states">Amount of possible states.</param>
|
||||
<param name="actions">Amount of possible actions.</param>
|
||||
<param name="explorationPolicy">Exploration policy.</param>
|
||||
|
||||
<remarks>Action estimates are randomized in the case of this constructor
|
||||
is used.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.QLearning.#ctor(System.Int32,System.Int32,AForge.MachineLearning.IExplorationPolicy,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.MachineLearning.QLearning"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="states">Amount of possible states.</param>
|
||||
<param name="actions">Amount of possible actions.</param>
|
||||
<param name="explorationPolicy">Exploration policy.</param>
|
||||
<param name="randomize">Randomize action estimates or not.</param>
|
||||
|
||||
<remarks>The <b>randomize</b> parameter specifies if initial action estimates should be randomized
|
||||
with small values or not. Randomization of action values may be useful, when greedy exploration
|
||||
policies are used. In this case randomization ensures that actions of the same type are not chosen always.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.QLearning.GetAction(System.Int32)">
|
||||
<summary>
|
||||
Get next action from the specified state.
|
||||
</summary>
|
||||
|
||||
<param name="state">Current state to get an action for.</param>
|
||||
|
||||
<returns>Returns the action for the state.</returns>
|
||||
|
||||
<remarks>The method returns an action according to current
|
||||
<see cref="P:AForge.MachineLearning.QLearning.ExplorationPolicy">exploration policy</see>.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.MachineLearning.QLearning.UpdateState(System.Int32,System.Int32,System.Double,System.Int32)">
|
||||
<summary>
|
||||
Update Q-function's value for the previous state-action pair.
|
||||
</summary>
|
||||
|
||||
<param name="previousState">Previous state.</param>
|
||||
<param name="action">Action, which leads from previous to the next state.</param>
|
||||
<param name="reward">Reward value, received by taking specified action from previous state.</param>
|
||||
<param name="nextState">Next state.</param>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.QLearning.StatesCount">
|
||||
<summary>
|
||||
Amount of possible states.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.QLearning.ActionsCount">
|
||||
<summary>
|
||||
Amount of possible actions.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.QLearning.ExplorationPolicy">
|
||||
<summary>
|
||||
Exploration policy.
|
||||
</summary>
|
||||
|
||||
<remarks>Policy, which is used to select actions.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.QLearning.LearningRate">
|
||||
<summary>
|
||||
Learning rate, [0, 1].
|
||||
</summary>
|
||||
|
||||
<remarks>The value determines the amount of updates Q-function receives
|
||||
during learning. The greater the value, the more updates the function receives.
|
||||
The lower the value, the less updates it receives.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.MachineLearning.QLearning.DiscountFactor">
|
||||
<summary>
|
||||
Discount factor, [0, 1].
|
||||
</summary>
|
||||
|
||||
<remarks>Discount factor for the expected summary reward. The value serves as
|
||||
multiplier for the expected reward. So if the value is set to 1,
|
||||
then the expected summary reward is not discounted. If the value is getting
|
||||
smaller, then smaller amount of the expected reward is used for actions'
|
||||
estimates update.</remarks>
|
||||
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,604 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>AForge.Video.Kinect</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:AForge.Video.Kinect.LedColorOption">
|
||||
<summary>
|
||||
Kinect's LED color options.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.LedColorOption.Off">
|
||||
<summary>
|
||||
The LED is off.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.LedColorOption.Green">
|
||||
<summary>
|
||||
The LED is on and has green color.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.LedColorOption.Red">
|
||||
<summary>
|
||||
The LED is on and has red color.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.LedColorOption.Yellow">
|
||||
<summary>
|
||||
The LED is on and has yellow color.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.LedColorOption.BlinkGreen">
|
||||
<summary>
|
||||
The LED is blinking with green color.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.LedColorOption.BlinkRedYellow">
|
||||
<summary>
|
||||
The LED is blinking from red to yellow color.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:AForge.Video.Kinect.CameraResolution">
|
||||
<summary>
|
||||
Kinect's resolutions of video and depth cameras.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.CameraResolution.Low">
|
||||
<summary>
|
||||
Low resolution.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.CameraResolution.Medium">
|
||||
<summary>
|
||||
Medium resolution.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.CameraResolution.High">
|
||||
<summary>
|
||||
Hight resolution.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:AForge.Video.Kinect.KinectDepthCamera">
|
||||
<summary>
|
||||
Video source for Microsoft Kinect's depth sensor.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The video source captures depth data from Microsoft <a href="http://en.wikipedia.org/wiki/Kinect">Kinect</a>
|
||||
depth sensor, which is aimed originally as a gaming device for XBox 360 platform.</para>
|
||||
|
||||
<para><note>Prior to using the class, make sure you've installed Kinect's drivers
|
||||
as described on <a href="http://openkinect.org/wiki/Getting_Started#Windows">Open Kinect</a>
|
||||
project's page.</note></para>
|
||||
|
||||
<para><note>In order to run correctly the class requires <i>freenect.dll</i> library
|
||||
to be put into solution's output folder. This can be found within the AForge.NET framework's
|
||||
distribution in Externals folder.</note></para>
|
||||
|
||||
<para>Sample usage:</para>
|
||||
<code>
|
||||
// create video source
|
||||
KinectDepthCamera videoSource = new KinectDepthCamera( 0 );
|
||||
// set NewFrame event handler
|
||||
videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
|
||||
// start the video source
|
||||
videoSource.Start( );
|
||||
// ...
|
||||
|
||||
private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
|
||||
{
|
||||
// get new frame
|
||||
Bitmap bitmap = eventArgs.Frame;
|
||||
// process the frame
|
||||
}
|
||||
</code>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectDepthCamera.#ctor(System.Int32)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.Kinect.KinectDepthCamera"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="deviceID">Kinect's device ID (index) to connect to.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectDepthCamera.#ctor(System.Int32,AForge.Video.Kinect.CameraResolution)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.Kinect.KinectDepthCamera"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="deviceID">Kinect's device ID (index) to connect to.</param>
|
||||
<param name="resolution">Resolution of depth sensor to set.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectDepthCamera.#ctor(System.Int32,AForge.Video.Kinect.CameraResolution,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.Kinect.KinectDepthCamera"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="deviceID">Kinect's device ID (index) to connect to.</param>
|
||||
<param name="resolution">Resolution of depth sensor to set.</param>
|
||||
<param name="provideOriginalDepthImage">Provide original depth image or colored depth map
|
||||
(see <see cref="P:AForge.Video.Kinect.KinectDepthCamera.ProvideOriginalDepthImage"/> property).</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectDepthCamera.Start">
|
||||
<summary>
|
||||
Start video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Starts video source and returns execution to caller. Video camera will be started
|
||||
and will provide new video frames through the <see cref="E:AForge.Video.Kinect.KinectDepthCamera.NewFrame"/> event.</remarks>
|
||||
|
||||
<exception cref="T:System.ArgumentException">The specified resolution is not supported for the selected
|
||||
mode of the Kinect depth sensor.</exception>
|
||||
<exception cref="T:AForge.ConnectionFailedException">Could not connect to Kinect's depth sensor.</exception>
|
||||
<exception cref="T:AForge.DeviceBusyException">Another connection to the specified depth sensor is already running.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectDepthCamera.SignalToStop">
|
||||
<summary>
|
||||
Signal video source to stop its work.
|
||||
</summary>
|
||||
|
||||
<remarks><para><note>Calling this method is equivalent to calling <see cref="M:AForge.Video.Kinect.KinectDepthCamera.Stop"/>
|
||||
for Kinect video camera.</note></para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectDepthCamera.WaitForStop">
|
||||
<summary>
|
||||
Wait for video source has stopped.
|
||||
</summary>
|
||||
|
||||
<remarks><para><note>Calling this method is equivalent to calling <see cref="M:AForge.Video.Kinect.KinectDepthCamera.Stop"/>
|
||||
for Kinect video camera.</note></para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectDepthCamera.Stop">
|
||||
<summary>
|
||||
Stop video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The method stop the video source, so it no longer provides new video frames
|
||||
and does not consume any resources.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.Kinect.KinectDepthCamera.NewFrame">
|
||||
<summary>
|
||||
New frame event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Notifies clients about new available frames from the video source.</para>
|
||||
|
||||
<para><note>Since video source may have multiple clients, each client is responsible for
|
||||
making a copy (cloning) of the passed video frame, because the video source disposes its
|
||||
own original copy after notifying of clients.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.Kinect.KinectDepthCamera.VideoSourceError">
|
||||
<summary>
|
||||
Video source error event.
|
||||
</summary>
|
||||
|
||||
<remarks>This event is used to notify clients about any type of errors occurred in
|
||||
video source object, for example internal exceptions.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.Kinect.KinectDepthCamera.PlayingFinished">
|
||||
<summary>
|
||||
Video playing finished event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This event is used to notify clients that the video playing has finished.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectDepthCamera.ProvideOriginalDepthImage">
|
||||
<summary>
|
||||
Provide original depth image or colored depth map.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The property specifies if the video source should provide original data
|
||||
provided by Kinect's depth sensor or provide colored depth map. If the property is set to
|
||||
<see langword="true"/>, then the video source will provide 16 bpp grayscale images, where
|
||||
11 least significant bits represent data provided by the sensor. If the property is
|
||||
set to <see langword="false"/>, then the video source will provide 24 bpp color images,
|
||||
which represents depth map. In this case depth is encoded by color gradient:
|
||||
white->red->yellow->green->cyan->blue->black. So colors which are closer to white represent
|
||||
objects which are closer to the Kinect sensor, but colors which are closer to black represent
|
||||
objects which are further away from Kinect.</para>
|
||||
|
||||
<para><note>The property must be set before running the video source to take effect.</note></para>
|
||||
|
||||
<para>Default value is set to <see langword="false"/>.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectDepthCamera.Resolution">
|
||||
<summary>
|
||||
Resolution of depth sensor to set.
|
||||
</summary>
|
||||
|
||||
<remarks><para><note>The property must be set before running the video source to take effect.</note></para>
|
||||
|
||||
<para>Default value of the property is set to <see cref="F:AForge.Video.Kinect.CameraResolution.Medium"/>.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectDepthCamera.Source">
|
||||
<summary>
|
||||
A string identifying the video source.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectDepthCamera.IsRunning">
|
||||
<summary>
|
||||
State of the video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Current state of video source object - running or not.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectDepthCamera.BytesReceived">
|
||||
<summary>
|
||||
Received bytes count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of bytes the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectDepthCamera.FramesReceived">
|
||||
<summary>
|
||||
Received frames count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of frames the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.Kinect.Kinect">
|
||||
<summary>
|
||||
The class provides access to Microsoft's Xbox <a href="http://en.wikipedia.org/wiki/Kinect">Kinect</a>
|
||||
controller.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The class allows to manipulate Kinec device by changing its LED color, setting motor's
|
||||
tilt value and accessing its camera. See <see cref="T:AForge.Video.Kinect.KinectVideoCamera"/> and <see cref="T:AForge.Video.Kinect.KinectDepthCamera"/>
|
||||
classes, which provide access to actual video.</para>
|
||||
|
||||
<para><img src="img/video/kinect.jpg" width="320" height="140"/></para>
|
||||
|
||||
<para><note>In order to run correctly the class requires <i>freenect.dll</i> library
|
||||
to be put into solution's output folder. This can be found within the AForge.NET framework's
|
||||
distribution in Externals folder.</note></para>
|
||||
|
||||
<para>Sample usage:</para>
|
||||
<code>
|
||||
// get Kinect device
|
||||
Kinect kinectDevice = Kinect.GetDevice( 0 );
|
||||
// change LED color
|
||||
kinectDevice.LedColor = LedColorOption.Yellow;
|
||||
// set motor tilt angle to -10 degrees
|
||||
kinectDevice.SetMotorTilt( -10 );
|
||||
// get video camera
|
||||
KinectVideoCamera videoCamera = kinectDevice.GetVideoCamera( );
|
||||
|
||||
// see example for video camera also
|
||||
</code>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.Kinect.GetDevice(System.Int32)">
|
||||
<summary>
|
||||
Get initialized instance of the Kinect device.
|
||||
</summary>
|
||||
|
||||
<param name="deviceID">ID of the Kinect device to get instance of, [0, <see cref="P:AForge.Video.Kinect.Kinect.DeviceCount"/>),</param>
|
||||
|
||||
<returns>Returns initialized Kinect device. Use <see cref="M:AForge.Video.Kinect.Kinect.Dispose"/> method
|
||||
when the device is no longer required.</returns>
|
||||
|
||||
<exception cref="T:System.ArgumentException">There is no Kinect device with specified ID connected to the system.</exception>
|
||||
<exception cref="T:AForge.ConnectionFailedException">Failed connecting to the Kinect device specified ID.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.Kinect.Finalize">
|
||||
<summary>
|
||||
Object finalizer/destructor makes sure unmanaged resource are freed if user did not call <see cref="M:AForge.Video.Kinect.Kinect.Dispose"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.Kinect.Dispose">
|
||||
<summary>
|
||||
Dispose device freeing all associated unmanaged resources.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.Kinect.SetLedColor(AForge.Video.Kinect.LedColorOption)">
|
||||
<summary>
|
||||
Set color of Kinect's LED.
|
||||
</summary>
|
||||
|
||||
<param name="ledColor">LED color to set.</param>
|
||||
|
||||
<exception cref="T:AForge.DeviceErrorException">Some error occurred with the device. Check error message.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.Kinect.SetMotorTilt(System.Int32)">
|
||||
<summary>
|
||||
Set motor's tilt value.
|
||||
</summary>
|
||||
|
||||
<param name="angle">Tilt value to set, [-31, 30] degrees.</param>
|
||||
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">Motor tilt has to be in the [-31, 31] range.</exception>
|
||||
<exception cref="T:AForge.DeviceErrorException">Some error occurred with the device. Check error message.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.Kinect.GetAccelerometerValues(System.Double@,System.Double@,System.Double@)">
|
||||
<summary>
|
||||
Get accelerometer values for 3 axes.
|
||||
</summary>
|
||||
|
||||
<param name="x">X axis value on the accelerometer.</param>
|
||||
<param name="y">Y axis value on the accelerometer.</param>
|
||||
<param name="z">Z axis value on the accelerometer.</param>
|
||||
|
||||
<remarks><para>Units of all 3 values are m/s<sup>2</sup>. The <b>g</b> value used
|
||||
for calculations is taken as 9.80665 m/s<sup>2</sup>.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.Kinect.GetVideoCamera">
|
||||
<summary>
|
||||
Get Kinect's video camera.
|
||||
</summary>
|
||||
|
||||
<returns>Returns Kinect's video camera.</returns>
|
||||
|
||||
<remarks><para>The method simply creates instance of the <see cref="T:AForge.Video.Kinect.KinectVideoCamera"/> class
|
||||
by calling its appropriate constructor. Use <see cref="M:AForge.Video.Kinect.KinectVideoCamera.Start"/> method
|
||||
to start the video then.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.Kinect.GetDepthCamera">
|
||||
<summary>
|
||||
Get Kinect's depth camera.
|
||||
</summary>
|
||||
|
||||
<returns>Returns Kinect's depth camera.</returns>
|
||||
|
||||
<remarks><para>The method simply creates instance of the <see cref="T:AForge.Video.Kinect.KinectDepthCamera"/> class
|
||||
by calling its appropriate constructor. Use <see cref="M:AForge.Video.Kinect.KinectDepthCamera.Start"/> method
|
||||
to start the video then.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.Kinect.DeviceID">
|
||||
<summary>
|
||||
ID of the opened Kinect device.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.Kinect.DeviceCount">
|
||||
<summary>
|
||||
Number of Kinect devices available in the system.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:AForge.Video.Kinect.VideoCameraMode">
|
||||
<summary>
|
||||
Enumeration of video camera modes for the <see cref="T:AForge.Video.Kinect.KinectVideoCamera"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.VideoCameraMode.Color">
|
||||
<summary>
|
||||
24 bit per pixel RGB mode.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.VideoCameraMode.Bayer">
|
||||
<summary>
|
||||
8 bit per pixel Bayer mode.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.Kinect.VideoCameraMode.InfraRed">
|
||||
<summary>
|
||||
8 bit per pixel Infra Red mode.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:AForge.Video.Kinect.KinectVideoCamera">
|
||||
<summary>
|
||||
Video source for Microsoft Kinect's video camera.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The video source captures video data from Microsoft <a href="http://en.wikipedia.org/wiki/Kinect">Kinect</a>
|
||||
video camera, which is aimed originally as a gaming device for XBox 360 platform.</para>
|
||||
|
||||
<para><note>Prior to using the class, make sure you've installed Kinect's drivers
|
||||
as described on <a href="http://openkinect.org/wiki/Getting_Started#Windows">Open Kinect</a>
|
||||
project's page.</note></para>
|
||||
|
||||
<para><note>In order to run correctly the class requires <i>freenect.dll</i> library
|
||||
to be put into solution's output folder. This can be found within the AForge.NET framework's
|
||||
distribution in Externals folder.</note></para>
|
||||
|
||||
<para>Sample usage:</para>
|
||||
<code>
|
||||
// create video source
|
||||
KinectVideoCamera videoSource = new KinectVideoCamera( 0 );
|
||||
// set NewFrame event handler
|
||||
videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
|
||||
// start the video source
|
||||
videoSource.Start( );
|
||||
// ...
|
||||
|
||||
private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
|
||||
{
|
||||
// get new frame
|
||||
Bitmap bitmap = eventArgs.Frame;
|
||||
// process the frame
|
||||
}
|
||||
</code>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectVideoCamera.#ctor(System.Int32)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.Kinect.KinectVideoCamera"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="deviceID">Kinect's device ID (index) to connect to.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectVideoCamera.#ctor(System.Int32,AForge.Video.Kinect.CameraResolution)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.Kinect.KinectVideoCamera"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="deviceID">Kinect's device ID (index) to connect to.</param>
|
||||
<param name="resolution">Resolution of video camera to set.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectVideoCamera.#ctor(System.Int32,AForge.Video.Kinect.CameraResolution,AForge.Video.Kinect.VideoCameraMode)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.Kinect.KinectVideoCamera"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="deviceID">Kinect's device ID (index) to connect to.</param>
|
||||
<param name="resolution">Resolution of video camera to set.</param>
|
||||
<param name="cameraMode">Sets video camera mode.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectVideoCamera.Start">
|
||||
<summary>
|
||||
Start video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Starts video source and returns execution to caller. Video camera will be started
|
||||
and will provide new video frames through the <see cref="E:AForge.Video.Kinect.KinectVideoCamera.NewFrame"/> event.</remarks>
|
||||
|
||||
<exception cref="T:System.ArgumentException">The specified resolution is not supported for the selected
|
||||
mode of the Kinect video camera.</exception>
|
||||
<exception cref="T:AForge.ConnectionFailedException">Could not connect to Kinect's video camera.</exception>
|
||||
<exception cref="T:AForge.DeviceBusyException">Another connection to the specified video camera is already running.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectVideoCamera.SignalToStop">
|
||||
<summary>
|
||||
Signal video source to stop its work.
|
||||
</summary>
|
||||
|
||||
<remarks><para><note>Calling this method is equivalent to calling <see cref="M:AForge.Video.Kinect.KinectVideoCamera.Stop"/>
|
||||
for Kinect video camera.</note></para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectVideoCamera.WaitForStop">
|
||||
<summary>
|
||||
Wait for video source has stopped.
|
||||
</summary>
|
||||
|
||||
<remarks><para><note>Calling this method is equivalent to calling <see cref="M:AForge.Video.Kinect.KinectVideoCamera.Stop"/>
|
||||
for Kinect video camera.</note></para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.Kinect.KinectVideoCamera.Stop">
|
||||
<summary>
|
||||
Stop video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The method stops the video source, so it no longer provides new video frames
|
||||
and does not consume any resources.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.Kinect.KinectVideoCamera.NewFrame">
|
||||
<summary>
|
||||
New frame event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Notifies clients about new available frames from the video source.</para>
|
||||
|
||||
<para><note>Since video source may have multiple clients, each client is responsible for
|
||||
making a copy (cloning) of the passed video frame, because the video source disposes its
|
||||
own original copy after notifying of clients.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.Kinect.KinectVideoCamera.VideoSourceError">
|
||||
<summary>
|
||||
Video source error event.
|
||||
</summary>
|
||||
|
||||
<remarks>This event is used to notify clients about any type of errors occurred in
|
||||
video source object, for example internal exceptions.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.Kinect.KinectVideoCamera.PlayingFinished">
|
||||
<summary>
|
||||
Video playing finished event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This event is used to notify clients that the video playing has finished.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectVideoCamera.CameraMode">
|
||||
<summary>
|
||||
Specifies video mode for the camera.
|
||||
</summary>
|
||||
|
||||
<remarks>
|
||||
<para><note>The property must be set before running the video source to take effect.</note></para>
|
||||
|
||||
<para>Default value of the property is set to <see cref="F:AForge.Video.Kinect.VideoCameraMode.Color"/>.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectVideoCamera.Resolution">
|
||||
<summary>
|
||||
Resolution of video camera to set.
|
||||
</summary>
|
||||
|
||||
<remarks><para><note>The property must be set before running the video source to take effect.</note></para>
|
||||
|
||||
<para>Default value of the property is set to <see cref="F:AForge.Video.Kinect.CameraResolution.Medium"/>.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectVideoCamera.Source">
|
||||
<summary>
|
||||
A string identifying the video source.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectVideoCamera.IsRunning">
|
||||
<summary>
|
||||
State of the video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Current state of video source object - running or not.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectVideoCamera.BytesReceived">
|
||||
<summary>
|
||||
Received bytes count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of bytes the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.Kinect.KinectVideoCamera.FramesReceived">
|
||||
<summary>
|
||||
Received frames count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of frames the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,964 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>AForge.Video</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:AForge.Video.AsyncVideoSource">
|
||||
<summary>
|
||||
Proxy video source for asynchronous processing of another nested video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The class represents a simple proxy, which wraps the specified <see cref="P:AForge.Video.AsyncVideoSource.NestedVideoSource"/>
|
||||
with the aim of asynchronous processing of received video frames. The class intercepts <see cref="E:AForge.Video.AsyncVideoSource.NewFrame"/>
|
||||
event from the nested video source and fires it to clients from its own thread, which is different from the thread
|
||||
used by nested video source for video acquisition. This allows clients to perform processing of video frames
|
||||
without blocking video acquisition thread, which continue to run and acquire next video frame while current is still
|
||||
processed.</para>
|
||||
|
||||
<para>For example, let’s suppose that it takes 100 ms for the nested video source to acquire single frame, so the original
|
||||
frame rate is 10 frames per second. Also let’s assume that we have an image processing routine, which also takes
|
||||
100 ms to process a single frame. If the acquisition and processing are done sequentially, then resulting
|
||||
frame rate will drop to 5 frames per second. However, if doing both in parallel, then there is a good chance to
|
||||
keep resulting frame rate equal (or close) to the original frame rate.</para>
|
||||
|
||||
<para>The class provides a bonus side effect - easer debugging of image processing routines, which are put into
|
||||
<see cref="E:AForge.Video.AsyncVideoSource.NewFrame"/> event handler. In many cases video source classes fire their <see cref="E:AForge.Video.IVideoSource.NewFrame"/>
|
||||
event from a try/catch block, which makes it very hard to spot error made in user's code - the catch block simply
|
||||
hides exception raised in user’s code. The <see cref="T:AForge.Video.AsyncVideoSource"/> does not have any try/catch blocks around
|
||||
firing of <see cref="E:AForge.Video.AsyncVideoSource.NewFrame"/> event, so always user gets exception in the case it comes from his code. At the same time
|
||||
nested video source is not affected by the user's exception, since it runs in different thread.</para>
|
||||
|
||||
<para>Sample usage:</para>
|
||||
<code>
|
||||
// usage of AsyncVideoSource is the same as usage of any
|
||||
// other video source class, so code change is very little
|
||||
|
||||
// create nested video source, for example JPEGStream
|
||||
JPEGStream stream = new JPEGStream( "some url" );
|
||||
// create async video source
|
||||
AsyncVideoSource asyncSource = new AsyncVideoSource( stream );
|
||||
// set NewFrame event handler
|
||||
asyncSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
|
||||
// start the video source
|
||||
asyncSource.Start( );
|
||||
// ...
|
||||
|
||||
private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
|
||||
{
|
||||
// get new frame
|
||||
Bitmap bitmap = eventArgs.Frame;
|
||||
// process the frame
|
||||
}
|
||||
</code>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.IVideoSource">
|
||||
<summary>
|
||||
Video source interface.
|
||||
</summary>
|
||||
|
||||
<remarks>The interface describes common methods for different type of video sources.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.IVideoSource.Start">
|
||||
<summary>
|
||||
Start video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Starts video source and return execution to caller. Video source
|
||||
object creates background thread and notifies about new frames with the
|
||||
help of <see cref="E:AForge.Video.IVideoSource.NewFrame"/> event.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.IVideoSource.SignalToStop">
|
||||
<summary>
|
||||
Signal video source to stop its work.
|
||||
</summary>
|
||||
|
||||
<remarks>Signals video source to stop its background thread, stop to
|
||||
provide new frames and free resources.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.IVideoSource.WaitForStop">
|
||||
<summary>
|
||||
Wait for video source has stopped.
|
||||
</summary>
|
||||
|
||||
<remarks>Waits for video source stopping after it was signalled to stop using
|
||||
<see cref="M:AForge.Video.IVideoSource.SignalToStop"/> method.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.IVideoSource.Stop">
|
||||
<summary>
|
||||
Stop video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Stops video source aborting its thread.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.IVideoSource.NewFrame">
|
||||
<summary>
|
||||
New frame event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This event is used to notify clients about new available video frame.</para>
|
||||
|
||||
<para><note>Since video source may have multiple clients, each client is responsible for
|
||||
making a copy (cloning) of the passed video frame, but video source is responsible for
|
||||
disposing its own original copy after notifying of clients.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.IVideoSource.VideoSourceError">
|
||||
<summary>
|
||||
Video source error event.
|
||||
</summary>
|
||||
|
||||
<remarks>This event is used to notify clients about any type of errors occurred in
|
||||
video source object, for example internal exceptions.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.IVideoSource.PlayingFinished">
|
||||
<summary>
|
||||
Video playing finished event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This event is used to notify clients that the video playing has finished.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.IVideoSource.Source">
|
||||
<summary>
|
||||
Video source.
|
||||
</summary>
|
||||
|
||||
<remarks>The meaning of the property depends on particular video source.
|
||||
Depending on video source it may be a file name, URL or any other string
|
||||
describing the video source.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.IVideoSource.FramesReceived">
|
||||
<summary>
|
||||
Received frames count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of frames the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.IVideoSource.BytesReceived">
|
||||
<summary>
|
||||
Received bytes count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of bytes the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.IVideoSource.IsRunning">
|
||||
<summary>
|
||||
State of the video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Current state of video source object - running or not.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.AsyncVideoSource.#ctor(AForge.Video.IVideoSource)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.AsyncVideoSource"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="nestedVideoSource">Nested video source which is the target for asynchronous processing.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.AsyncVideoSource.#ctor(AForge.Video.IVideoSource,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.AsyncVideoSource"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="nestedVideoSource">Nested video source which is the target for asynchronous processing.</param>
|
||||
<param name="skipFramesIfBusy">Specifies if the object should skip frames from the nested video source
|
||||
in the case if it is still busy processing the previous video frame.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.AsyncVideoSource.Start">
|
||||
<summary>
|
||||
Start video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Starts the nested video source and returns execution to caller. This object creates
|
||||
an extra thread which is used to fire <see cref="E:AForge.Video.AsyncVideoSource.NewFrame"/> events, so the image processing could be
|
||||
done on another thread without blocking video acquisition thread.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.AsyncVideoSource.SignalToStop">
|
||||
<summary>
|
||||
Signal video source to stop its work.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Signals video source to stop its background thread, stop to
|
||||
provide new frames and free resources.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.AsyncVideoSource.WaitForStop">
|
||||
<summary>
|
||||
Wait for video source has stopped.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Waits for video source stopping after it was signalled to stop using
|
||||
<see cref="M:AForge.Video.AsyncVideoSource.SignalToStop"/> method.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.AsyncVideoSource.Stop">
|
||||
<summary>
|
||||
Stop video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Stops nested video source by calling its <see cref="M:AForge.Video.IVideoSource.Stop"/> method.
|
||||
See documentation of the particular video source for additional details.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.AsyncVideoSource.NewFrame">
|
||||
<summary>
|
||||
New frame event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Notifies clients about new available frame from video source.</para>
|
||||
|
||||
<para><note>This event is fired from a different thread other than the video acquisition thread created
|
||||
by <see cref="P:AForge.Video.AsyncVideoSource.NestedVideoSource"/>. This allows nested video frame to continue acquisition of the next
|
||||
video frame while clients perform processing of the current video frame.</note></para>
|
||||
|
||||
<para><note>Since video source may have multiple clients, each client is responsible for
|
||||
making a copy (cloning) of the passed video frame, because the video source disposes its
|
||||
own original copy after notifying of clients.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.AsyncVideoSource.VideoSourceError">
|
||||
<summary>
|
||||
Video source error event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This event is used to notify clients about any type of errors occurred in
|
||||
video source object, for example internal exceptions.</para>
|
||||
|
||||
<para><note>Unlike <see cref="E:AForge.Video.AsyncVideoSource.NewFrame"/> event, this event is simply redirected to the corresponding
|
||||
event of the <see cref="P:AForge.Video.AsyncVideoSource.NestedVideoSource"/>, so it is fired from the thread of the nested video source.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.AsyncVideoSource.PlayingFinished">
|
||||
<summary>
|
||||
Video playing finished event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This event is used to notify clients that the video playing has finished.</para>
|
||||
|
||||
<para><note>Unlike <see cref="E:AForge.Video.AsyncVideoSource.NewFrame"/> event, this event is simply redirected to the corresponding
|
||||
event of the <see cref="P:AForge.Video.AsyncVideoSource.NestedVideoSource"/>, so it is fired from the thread of the nested video source.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.AsyncVideoSource.NestedVideoSource">
|
||||
<summary>
|
||||
Nested video source which is the target for asynchronous processing.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The property is set through the class constructor.</para>
|
||||
|
||||
<para>All calls to this object are actually redirected to the nested video source. The only
|
||||
exception is the <see cref="E:AForge.Video.AsyncVideoSource.NewFrame"/> event, which is handled differently. This object gets
|
||||
<see cref="E:AForge.Video.IVideoSource.NewFrame"/> event from the nested class and then fires another
|
||||
<see cref="E:AForge.Video.AsyncVideoSource.NewFrame"/> event, but from a different thread.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.AsyncVideoSource.SkipFramesIfBusy">
|
||||
<summary>
|
||||
Specifies if the object should skip frames from the nested video source when it is busy.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Specifies if the object should skip frames from the nested video source
|
||||
in the case if it is still busy processing the previous video frame in its own thread.</para>
|
||||
|
||||
<para>Default value is set to <see langword="false"/>.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.AsyncVideoSource.Source">
|
||||
<summary>
|
||||
Video source string.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The property is redirected to the corresponding property of <see cref="P:AForge.Video.AsyncVideoSource.NestedVideoSource"/>,
|
||||
so check its documentation to find what it means.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.AsyncVideoSource.FramesReceived">
|
||||
<summary>
|
||||
Received frames count.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Number of frames the <see cref="P:AForge.Video.AsyncVideoSource.NestedVideoSource">nested video source</see> received from
|
||||
the moment of the last access to the property.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.AsyncVideoSource.BytesReceived">
|
||||
<summary>
|
||||
Received bytes count.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Number of bytes the <see cref="P:AForge.Video.AsyncVideoSource.NestedVideoSource">nested video source</see> received from
|
||||
the moment of the last access to the property.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.AsyncVideoSource.FramesProcessed">
|
||||
<summary>
|
||||
Processed frames count.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The property keeps the number of processed video frames since the last access to this property.
|
||||
</para>
|
||||
|
||||
<para>The value of this property equals to <see cref="P:AForge.Video.AsyncVideoSource.FramesReceived"/> in most cases if the
|
||||
<see cref="P:AForge.Video.AsyncVideoSource.SkipFramesIfBusy"/> property is set to <see langword="false"/> - every received frame gets processed
|
||||
sooner or later. However, if the <see cref="P:AForge.Video.AsyncVideoSource.SkipFramesIfBusy"/> property is set to <see langword="true"/>,
|
||||
then value of this property may be lower than the value of the <see cref="P:AForge.Video.AsyncVideoSource.FramesReceived"/> property, which
|
||||
means that nested video source performs acquisition faster than client perform processing of the received frame
|
||||
and some frame are skipped from processing.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.AsyncVideoSource.IsRunning">
|
||||
<summary>
|
||||
State of the video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Current state of the video source object - running or not.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.MJPEGStream">
|
||||
<summary>
|
||||
MJPEG video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The video source downloads JPEG images from the specified URL, which represents
|
||||
MJPEG stream.</para>
|
||||
|
||||
<para>Sample usage:</para>
|
||||
<code>
|
||||
// create MJPEG video source
|
||||
MJPEGStream stream = new MJPEGStream( "some url" );
|
||||
// set event handlers
|
||||
stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
|
||||
// start the video source
|
||||
stream.Start( );
|
||||
// ...
|
||||
</code>
|
||||
|
||||
<para><note>Some cameras produce HTTP header, which does not conform strictly to
|
||||
standard, what leads to .NET exception. To avoid this exception the <b>useUnsafeHeaderParsing</b>
|
||||
configuration option of <b>httpWebRequest</b> should be set, what may be done using application
|
||||
configuration file.</note></para>
|
||||
<code>
|
||||
<configuration>
|
||||
<system.net>
|
||||
<settings>
|
||||
<httpWebRequest useUnsafeHeaderParsing="true" />
|
||||
</settings>
|
||||
</system.net>
|
||||
</configuration>
|
||||
</code>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.MJPEGStream.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.MJPEGStream"/> class.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.MJPEGStream.#ctor(System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.MJPEGStream"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="source">URL, which provides MJPEG stream.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.MJPEGStream.Start">
|
||||
<summary>
|
||||
Start video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Starts video source and return execution to caller. Video source
|
||||
object creates background thread and notifies about new frames with the
|
||||
help of <see cref="E:AForge.Video.MJPEGStream.NewFrame"/> event.</remarks>
|
||||
|
||||
<exception cref="T:System.ArgumentException">Video source is not specified.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.MJPEGStream.SignalToStop">
|
||||
<summary>
|
||||
Signal video source to stop its work.
|
||||
</summary>
|
||||
|
||||
<remarks>Signals video source to stop its background thread, stop to
|
||||
provide new frames and free resources.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.MJPEGStream.WaitForStop">
|
||||
<summary>
|
||||
Wait for video source has stopped.
|
||||
</summary>
|
||||
|
||||
<remarks>Waits for source stopping after it was signalled to stop using
|
||||
<see cref="M:AForge.Video.MJPEGStream.SignalToStop"/> method.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.MJPEGStream.Stop">
|
||||
<summary>
|
||||
Stop video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Stops video source aborting its thread.</para>
|
||||
|
||||
<para><note>Since the method aborts background thread, its usage is highly not preferred
|
||||
and should be done only if there are no other options. The correct way of stopping camera
|
||||
is <see cref="M:AForge.Video.MJPEGStream.SignalToStop">signaling it stop</see> and then
|
||||
<see cref="M:AForge.Video.MJPEGStream.WaitForStop">waiting</see> for background thread's completion.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.MJPEGStream.Free">
|
||||
<summary>
|
||||
Free resource.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.MJPEGStream.NewFrame">
|
||||
<summary>
|
||||
New frame event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Notifies clients about new available frame from video source.</para>
|
||||
|
||||
<para><note>Since video source may have multiple clients, each client is responsible for
|
||||
making a copy (cloning) of the passed video frame, because the video source disposes its
|
||||
own original copy after notifying of clients.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.MJPEGStream.VideoSourceError">
|
||||
<summary>
|
||||
Video source error event.
|
||||
</summary>
|
||||
|
||||
<remarks>This event is used to notify clients about any type of errors occurred in
|
||||
video source object, for example internal exceptions.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.MJPEGStream.PlayingFinished">
|
||||
<summary>
|
||||
Video playing finished event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This event is used to notify clients that the video playing has finished.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.SeparateConnectionGroup">
|
||||
<summary>
|
||||
Use or not separate connection group.
|
||||
</summary>
|
||||
|
||||
<remarks>The property indicates to open web request in separate connection group.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.Source">
|
||||
<summary>
|
||||
Video source.
|
||||
</summary>
|
||||
|
||||
<remarks>URL, which provides MJPEG stream.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.Login">
|
||||
<summary>
|
||||
Login value.
|
||||
</summary>
|
||||
|
||||
<remarks>Login required to access video source.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.Password">
|
||||
<summary>
|
||||
Password value.
|
||||
</summary>
|
||||
|
||||
<remarks>Password required to access video source.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.Proxy">
|
||||
<summary>
|
||||
Gets or sets proxy information for the request.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The local computer or application config file may specify that a default
|
||||
proxy to be used. If the Proxy property is specified, then the proxy settings from the Proxy
|
||||
property overridea the local computer or application config file and the instance will use
|
||||
the proxy settings specified. If no proxy is specified in a config file
|
||||
and the Proxy property is unspecified, the request uses the proxy settings
|
||||
inherited from Internet Explorer on the local computer. If there are no proxy settings
|
||||
in Internet Explorer, the request is sent directly to the server.
|
||||
</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.HttpUserAgent">
|
||||
<summary>
|
||||
User agent to specify in HTTP request header.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Some IP cameras check what is the requesting user agent and depending
|
||||
on it they provide video in different formats or do not provide it at all. The property
|
||||
sets the value of user agent string, which is sent to camera in request header.
|
||||
</para>
|
||||
|
||||
<para>Default value is set to "Mozilla/5.0". If the value is set to <see langword="null"/>,
|
||||
the user agent string is not sent in request header.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.FramesReceived">
|
||||
<summary>
|
||||
Received frames count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of frames the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.BytesReceived">
|
||||
<summary>
|
||||
Received bytes count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of bytes the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.RequestTimeout">
|
||||
<summary>
|
||||
Request timeout value.
|
||||
</summary>
|
||||
|
||||
<remarks>The property sets timeout value in milliseconds for web requests.
|
||||
Default value is 10000 milliseconds.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.MJPEGStream.IsRunning">
|
||||
<summary>
|
||||
State of the video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Current state of video source object - running or not.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.VideoException">
|
||||
<summary>
|
||||
Video related exception.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The exception is thrown in the case of some video related issues, like
|
||||
failure of initializing codec, compression, etc.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.VideoException.#ctor(System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.VideoException"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="message">Exception's message.</param>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.NewFrameEventHandler">
|
||||
<summary>
|
||||
Delegate for new frame event handler.
|
||||
</summary>
|
||||
|
||||
<param name="sender">Sender object.</param>
|
||||
<param name="eventArgs">Event arguments.</param>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.VideoSourceErrorEventHandler">
|
||||
<summary>
|
||||
Delegate for video source error event handler.
|
||||
</summary>
|
||||
|
||||
<param name="sender">Sender object.</param>
|
||||
<param name="eventArgs">Event arguments.</param>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.PlayingFinishedEventHandler">
|
||||
<summary>
|
||||
Delegate for playing finished event handler.
|
||||
</summary>
|
||||
|
||||
<param name="sender">Sender object.</param>
|
||||
<param name="reason">Reason of finishing video playing.</param>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.ReasonToFinishPlaying">
|
||||
<summary>
|
||||
Reason of finishing video playing.
|
||||
</summary>
|
||||
|
||||
<remarks><para>When video source class fire the <see cref="E:AForge.Video.IVideoSource.PlayingFinished"/> event, they
|
||||
need to specify reason of finishing video playing. For example, it may be end of stream reached.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="F:AForge.Video.ReasonToFinishPlaying.EndOfStreamReached">
|
||||
<summary>
|
||||
Video playing has finished because it end was reached.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.ReasonToFinishPlaying.StoppedByUser">
|
||||
<summary>
|
||||
Video playing has finished because it was stopped by user.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.ReasonToFinishPlaying.DeviceLost">
|
||||
<summary>
|
||||
Video playing has finished because the device was lost (unplugged).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AForge.Video.ReasonToFinishPlaying.VideoSourceError">
|
||||
<summary>
|
||||
Video playing has finished because of some error happened the video source (camera, stream, file, etc.).
|
||||
A error reporting event usually is fired to provide error information.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:AForge.Video.NewFrameEventArgs">
|
||||
<summary>
|
||||
Arguments for new frame event from video source.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.NewFrameEventArgs.#ctor(System.Drawing.Bitmap)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.NewFrameEventArgs"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="frame">New frame.</param>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.NewFrameEventArgs.Frame">
|
||||
<summary>
|
||||
New frame from video source.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.VideoSourceErrorEventArgs">
|
||||
<summary>
|
||||
Arguments for video source error event from video source.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.VideoSourceErrorEventArgs.#ctor(System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.VideoSourceErrorEventArgs"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="description">Error description.</param>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.VideoSourceErrorEventArgs.Description">
|
||||
<summary>
|
||||
Video source error description.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.JPEGStream">
|
||||
<summary>
|
||||
JPEG video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The video source constantly downloads JPEG files from the specified URL.</para>
|
||||
|
||||
<para>Sample usage:</para>
|
||||
<code>
|
||||
// create JPEG video source
|
||||
JPEGStream stream = new JPEGStream( "some url" );
|
||||
// set NewFrame event handler
|
||||
stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
|
||||
// start the video source
|
||||
stream.Start( );
|
||||
// ...
|
||||
// signal to stop
|
||||
stream.SignalToStop( );
|
||||
// ...
|
||||
|
||||
private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
|
||||
{
|
||||
// get new frame
|
||||
Bitmap bitmap = eventArgs.Frame;
|
||||
// process the frame
|
||||
}
|
||||
</code>
|
||||
|
||||
<para><note>Some cameras produce HTTP header, which does not conform strictly to
|
||||
standard, what leads to .NET exception. To avoid this exception the <b>useUnsafeHeaderParsing</b>
|
||||
configuration option of <b>httpWebRequest</b> should be set, what may be done using application
|
||||
configuration file.</note></para>
|
||||
<code>
|
||||
<configuration>
|
||||
<system.net>
|
||||
<settings>
|
||||
<httpWebRequest useUnsafeHeaderParsing="true" />
|
||||
</settings>
|
||||
</system.net>
|
||||
</configuration>
|
||||
</code>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.JPEGStream.#ctor">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.JPEGStream"/> class.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.JPEGStream.#ctor(System.String)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:AForge.Video.JPEGStream"/> class.
|
||||
</summary>
|
||||
|
||||
<param name="source">URL, which provides JPEG files.</param>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.JPEGStream.Start">
|
||||
<summary>
|
||||
Start video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Starts video source and return execution to caller. Video source
|
||||
object creates background thread and notifies about new frames with the
|
||||
help of <see cref="E:AForge.Video.JPEGStream.NewFrame"/> event.</remarks>
|
||||
|
||||
<exception cref="T:System.ArgumentException">Video source is not specified.</exception>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.JPEGStream.SignalToStop">
|
||||
<summary>
|
||||
Signal video source to stop its work.
|
||||
</summary>
|
||||
|
||||
<remarks>Signals video source to stop its background thread, stop to
|
||||
provide new frames and free resources.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.JPEGStream.WaitForStop">
|
||||
<summary>
|
||||
Wait for video source has stopped.
|
||||
</summary>
|
||||
|
||||
<remarks>Waits for source stopping after it was signalled to stop using
|
||||
<see cref="M:AForge.Video.JPEGStream.SignalToStop"/> method.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.JPEGStream.Stop">
|
||||
<summary>
|
||||
Stop video source.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Stops video source aborting its thread.</para>
|
||||
|
||||
<para><note>Since the method aborts background thread, its usage is highly not preferred
|
||||
and should be done only if there are no other options. The correct way of stopping camera
|
||||
is <see cref="M:AForge.Video.JPEGStream.SignalToStop">signaling it stop</see> and then
|
||||
<see cref="M:AForge.Video.JPEGStream.WaitForStop">waiting</see> for background thread's completion.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.JPEGStream.Free">
|
||||
<summary>
|
||||
Free resource.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.JPEGStream.NewFrame">
|
||||
<summary>
|
||||
New frame event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>Notifies clients about new available frame from video source.</para>
|
||||
|
||||
<para><note>Since video source may have multiple clients, each client is responsible for
|
||||
making a copy (cloning) of the passed video frame, because the video source disposes its
|
||||
own original copy after notifying of clients.</note></para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.JPEGStream.VideoSourceError">
|
||||
<summary>
|
||||
Video source error event.
|
||||
</summary>
|
||||
|
||||
<remarks>This event is used to notify clients about any type of errors occurred in
|
||||
video source object, for example internal exceptions.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="E:AForge.Video.JPEGStream.PlayingFinished">
|
||||
<summary>
|
||||
Video playing finished event.
|
||||
</summary>
|
||||
|
||||
<remarks><para>This event is used to notify clients that the video playing has finished.</para>
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.SeparateConnectionGroup">
|
||||
<summary>
|
||||
Use or not separate connection group.
|
||||
</summary>
|
||||
|
||||
<remarks>The property indicates to open web request in separate connection group.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.PreventCaching">
|
||||
<summary>
|
||||
Use or not caching.
|
||||
</summary>
|
||||
|
||||
<remarks>If the property is set to <b>true</b>, then a fake random parameter will be added
|
||||
to URL to prevent caching. It's required for clients, who are behind proxy server.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.FrameInterval">
|
||||
<summary>
|
||||
Frame interval.
|
||||
</summary>
|
||||
|
||||
<remarks>The property sets the interval in milliseconds betwen frames. If the property is
|
||||
set to 100, then the desired frame rate will be 10 frames per second. Default value is 0 -
|
||||
get new frames as fast as possible.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.Source">
|
||||
<summary>
|
||||
Video source.
|
||||
</summary>
|
||||
|
||||
<remarks>URL, which provides JPEG files.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.Login">
|
||||
<summary>
|
||||
Login value.
|
||||
</summary>
|
||||
|
||||
<remarks>Login required to access video source.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.Password">
|
||||
<summary>
|
||||
Password value.
|
||||
</summary>
|
||||
|
||||
<remarks>Password required to access video source.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.Proxy">
|
||||
<summary>
|
||||
Gets or sets proxy information for the request.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The local computer or application config file may specify that a default
|
||||
proxy to be used. If the Proxy property is specified, then the proxy settings from the Proxy
|
||||
property overridea the local computer or application config file and the instance will use
|
||||
the proxy settings specified. If no proxy is specified in a config file
|
||||
and the Proxy property is unspecified, the request uses the proxy settings
|
||||
inherited from Internet Explorer on the local computer. If there are no proxy settings
|
||||
in Internet Explorer, the request is sent directly to the server.
|
||||
</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.FramesReceived">
|
||||
<summary>
|
||||
Received frames count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of frames the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.BytesReceived">
|
||||
<summary>
|
||||
Received bytes count.
|
||||
</summary>
|
||||
|
||||
<remarks>Number of bytes the video source provided from the moment of the last
|
||||
access to the property.
|
||||
</remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.RequestTimeout">
|
||||
<summary>
|
||||
Request timeout value.
|
||||
</summary>
|
||||
|
||||
<remarks><para>The property sets timeout value in milliseconds for web requests.</para>
|
||||
|
||||
<para>Default value is set <b>10000</b> milliseconds.</para></remarks>
|
||||
|
||||
</member>
|
||||
<member name="P:AForge.Video.JPEGStream.IsRunning">
|
||||
<summary>
|
||||
State of the video source.
|
||||
</summary>
|
||||
|
||||
<remarks>Current state of video source object - running or not.</remarks>
|
||||
|
||||
</member>
|
||||
<member name="T:AForge.Video.ByteArrayUtils">
|
||||
<summary>
|
||||
Some internal utilities for handling arrays.
|
||||
</summary>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.ByteArrayUtils.Compare(System.Byte[],System.Byte[],System.Int32)">
|
||||
<summary>
|
||||
Check if the array contains needle at specified position.
|
||||
</summary>
|
||||
|
||||
<param name="array">Source array to check for needle.</param>
|
||||
<param name="needle">Needle we are searching for.</param>
|
||||
<param name="startIndex">Start index in source array.</param>
|
||||
|
||||
<returns>Returns <b>true</b> if the source array contains the needle at
|
||||
the specified index. Otherwise it returns <b>false</b>.</returns>
|
||||
|
||||
</member>
|
||||
<member name="M:AForge.Video.ByteArrayUtils.Find(System.Byte[],System.Byte[],System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Find subarray in the source array.
|
||||
</summary>
|
||||
|
||||
<param name="array">Source array to search for needle.</param>
|
||||
<param name="needle">Needle we are searching for.</param>
|
||||
<param name="startIndex">Start index in source array.</param>
|
||||
<param name="sourceLength">Number of bytes in source array, where the needle is searched for.</param>
|
||||
|
||||
<returns>Returns starting position of the needle if it was found or <b>-1</b> otherwise.</returns>
|
||||
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,58 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("DShowNET")]
|
||||
[assembly: AssemblyDescription("DirectShow for .NET")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("netmaster@swissonline.ch")]
|
||||
[assembly: AssemblyProduct("DirectShow.NET")]
|
||||
[assembly: AssemblyCopyright("everybody")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.1")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.30319</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon />
|
||||
<AssemblyKeyContainerName />
|
||||
<AssemblyName>DShowNET</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile />
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DShowNET</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject />
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>0.0</OldToolsVersion>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile />
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile />
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn />
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile />
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile />
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn />
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>none</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing">
|
||||
<Name>System.Drawing</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsBugWO.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsControl.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsCore.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsDevice.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsDVD.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsExtend.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsUtils.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsUuids.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsVmr9.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DsVmRender.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="QEdit.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent />
|
||||
<PostBuildEvent />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<LastOpenVersion>7.10.3077</LastOpenVersion>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath />
|
||||
<CopyProjectDestinationFolder />
|
||||
<CopyProjectUncPath />
|
||||
<CopyProjectOption>0</CopyProjectOption>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
<PublishUrlHistory />
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<BootstrapperUrlHistory />
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<EnableASPDebugging>false</EnableASPDebugging>
|
||||
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||
<RemoteDebugMachine />
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments />
|
||||
<StartPage />
|
||||
<StartProgram />
|
||||
<StartURL />
|
||||
<StartWorkingDirectory />
|
||||
<StartWithIE>false</StartWithIE>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<EnableASPDebugging>false</EnableASPDebugging>
|
||||
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||
<RemoteDebugMachine />
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments />
|
||||
<StartPage />
|
||||
<StartProgram />
|
||||
<StartURL />
|
||||
<StartWorkingDirectory />
|
||||
<StartWithIE>true</StartWithIE>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,21 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 7.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DShowNET", "DShowNET.csproj", "{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
ConfigName.0 = Debug
|
||||
ConfigName.1 = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Debug.ActiveCfg = Debug|.NET
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Debug.Build.0 = Debug|.NET
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Release.ActiveCfg = Release|.NET
|
||||
{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}.Release.Build.0 = Release|.NET
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,53 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// WORKAROUND FOR DS BUGs
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
|
||||
public class DsBugWO
|
||||
{
|
||||
/*
|
||||
works:
|
||||
CoCreateInstance( CLSID_CaptureGraphBuilder2, ..., IID_ICaptureGraphBuilder2, ...);
|
||||
doesn't (E_NOTIMPL):
|
||||
CoCreateInstance( CLSID_CaptureGraphBuilder2, ..., IID_IUnknown, ...);
|
||||
thus .NET 'Activator.CreateInstance' fails
|
||||
*/
|
||||
|
||||
public static object CreateDsInstance( ref Guid clsid, ref Guid riid )
|
||||
{
|
||||
IntPtr ptrIf;
|
||||
int hr = CoCreateInstance( ref clsid, IntPtr.Zero, CLSCTX.Inproc, ref riid, out ptrIf );
|
||||
if( (hr != 0) || (ptrIf == IntPtr.Zero) )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
Guid iu = new Guid( "00000000-0000-0000-C000-000000000046" );
|
||||
IntPtr ptrXX;
|
||||
hr = Marshal.QueryInterface( ptrIf, ref iu, out ptrXX );
|
||||
|
||||
object ooo = System.Runtime.Remoting.Services.EnterpriseServicesHelper.WrapIUnknownWithComObject( ptrIf );
|
||||
int ct = Marshal.Release( ptrIf );
|
||||
return ooo;
|
||||
}
|
||||
|
||||
[DllImport("ole32.dll") ]
|
||||
private static extern int CoCreateInstance( ref Guid clsid, IntPtr pUnkOuter, CLSCTX dwClsContext, ref Guid iid, out IntPtr ptrIf );
|
||||
}
|
||||
|
||||
[Flags]
|
||||
internal enum CLSCTX
|
||||
{
|
||||
Inproc = 0x03,
|
||||
Server = 0x15,
|
||||
All = 0x17,
|
||||
}
|
||||
|
||||
|
||||
} // namespace DShowNET
|
||||
@@ -0,0 +1,500 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// DsControl
|
||||
// basic Quartz control interfaces, ported from control.odl
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868b1-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsDual)]
|
||||
public interface IMediaControl
|
||||
{
|
||||
[PreserveSig]
|
||||
int Run();
|
||||
|
||||
[PreserveSig]
|
||||
int Pause();
|
||||
|
||||
[PreserveSig]
|
||||
int Stop();
|
||||
|
||||
[PreserveSig]
|
||||
int GetState( int msTimeout, out int pfs );
|
||||
|
||||
[PreserveSig]
|
||||
int RenderFile( string strFilename );
|
||||
|
||||
[PreserveSig]
|
||||
int AddSourceFilter(
|
||||
[In] string strFilename,
|
||||
[Out, MarshalAs(UnmanagedType.IDispatch)] out object ppUnk );
|
||||
|
||||
[PreserveSig]
|
||||
int get_FilterCollection(
|
||||
[Out, MarshalAs(UnmanagedType.IDispatch)] out object ppUnk );
|
||||
|
||||
[PreserveSig]
|
||||
int get_RegFilterCollection(
|
||||
[Out, MarshalAs(UnmanagedType.IDispatch)] out object ppUnk );
|
||||
|
||||
[PreserveSig]
|
||||
int StopWhenReady();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868b6-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsDual)]
|
||||
public interface IMediaEvent
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetEventHandle( out IntPtr hEvent );
|
||||
|
||||
[PreserveSig]
|
||||
int GetEvent( out DsEvCode lEventCode, out int lParam1, out int lParam2, int msTimeout );
|
||||
|
||||
[PreserveSig]
|
||||
int WaitForCompletion( int msTimeout, out int pEvCode );
|
||||
|
||||
[PreserveSig]
|
||||
int CancelDefaultHandling( int lEvCode );
|
||||
|
||||
[PreserveSig]
|
||||
int RestoreDefaultHandling( int lEvCode );
|
||||
|
||||
[PreserveSig]
|
||||
int FreeEventParams( DsEvCode lEvCode, int lParam1, int lParam2 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868c0-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsDual)]
|
||||
public interface IMediaEventEx
|
||||
{
|
||||
#region "IMediaEvent Methods"
|
||||
[PreserveSig]
|
||||
int GetEventHandle( out IntPtr hEvent );
|
||||
|
||||
[PreserveSig]
|
||||
int GetEvent( out DsEvCode lEventCode, out int lParam1, out int lParam2, int msTimeout );
|
||||
|
||||
[PreserveSig]
|
||||
int WaitForCompletion( int msTimeout, [Out] out int pEvCode );
|
||||
|
||||
[PreserveSig]
|
||||
int CancelDefaultHandling( int lEvCode );
|
||||
|
||||
[PreserveSig]
|
||||
int RestoreDefaultHandling( int lEvCode );
|
||||
|
||||
[PreserveSig]
|
||||
int FreeEventParams( DsEvCode lEvCode, int lParam1, int lParam2 );
|
||||
#endregion
|
||||
|
||||
|
||||
[PreserveSig]
|
||||
int SetNotifyWindow( IntPtr hwnd, int lMsg, IntPtr lInstanceData );
|
||||
|
||||
[PreserveSig]
|
||||
int SetNotifyFlags( int lNoNotifyFlags );
|
||||
|
||||
[PreserveSig]
|
||||
int GetNotifyFlags( out int lplNoNotifyFlags );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("329bb360-f6ea-11d1-9038-00a0c9697298"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsDual)]
|
||||
public interface IBasicVideo2
|
||||
{
|
||||
[PreserveSig]
|
||||
int AvgTimePerFrame( out double pAvgTimePerFrame );
|
||||
|
||||
[PreserveSig]
|
||||
int BitRate( out int pBitRate );
|
||||
|
||||
[PreserveSig]
|
||||
int BitErrorRate( out int pBitRate );
|
||||
|
||||
[PreserveSig]
|
||||
int VideoWidth( out int pVideoWidth );
|
||||
|
||||
[PreserveSig]
|
||||
int VideoHeight( out int pVideoHeight );
|
||||
|
||||
|
||||
[PreserveSig]
|
||||
int put_SourceLeft( int SourceLeft );
|
||||
[PreserveSig]
|
||||
int get_SourceLeft( out int pSourceLeft );
|
||||
|
||||
[PreserveSig]
|
||||
int put_SourceWidth( int SourceWidth );
|
||||
[PreserveSig]
|
||||
int get_SourceWidth( out int pSourceWidth );
|
||||
|
||||
[PreserveSig]
|
||||
int put_SourceTop( int SourceTop );
|
||||
[PreserveSig]
|
||||
int get_SourceTop( out int pSourceTop );
|
||||
|
||||
[PreserveSig]
|
||||
int put_SourceHeight( int SourceHeight );
|
||||
[PreserveSig]
|
||||
int get_SourceHeight( out int pSourceHeight );
|
||||
|
||||
|
||||
|
||||
[PreserveSig]
|
||||
int put_DestinationLeft( int DestinationLeft );
|
||||
[PreserveSig]
|
||||
int get_DestinationLeft( out int pDestinationLeft );
|
||||
|
||||
[PreserveSig]
|
||||
int put_DestinationWidth( int DestinationWidth );
|
||||
[PreserveSig]
|
||||
int get_DestinationWidth( out int pDestinationWidth );
|
||||
|
||||
[PreserveSig]
|
||||
int put_DestinationTop( int DestinationTop );
|
||||
[PreserveSig]
|
||||
int get_DestinationTop( out int pDestinationTop );
|
||||
|
||||
[PreserveSig]
|
||||
int put_DestinationHeight( int DestinationHeight );
|
||||
[PreserveSig]
|
||||
int get_DestinationHeight( out int pDestinationHeight );
|
||||
|
||||
[PreserveSig]
|
||||
int SetSourcePosition( int left, int top, int width, int height );
|
||||
[PreserveSig]
|
||||
int GetSourcePosition( out int left, out int top, out int width, out int height );
|
||||
[PreserveSig]
|
||||
int SetDefaultSourcePosition();
|
||||
|
||||
|
||||
[PreserveSig]
|
||||
int SetDestinationPosition( int left, int top, int width, int height );
|
||||
[PreserveSig]
|
||||
int GetDestinationPosition( out int left, out int top, out int width, out int height );
|
||||
[PreserveSig]
|
||||
int SetDefaultDestinationPosition();
|
||||
|
||||
|
||||
[PreserveSig]
|
||||
int GetVideoSize( out int pWidth, out int pHeight );
|
||||
|
||||
[PreserveSig]
|
||||
int GetVideoPaletteEntries( int StartIndex, int Entries, out int pRetrieved, IntPtr pPalette );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentImage( ref int pBufferSize, IntPtr pDIBImage );
|
||||
|
||||
[PreserveSig]
|
||||
int IsUsingDefaultSource();
|
||||
[PreserveSig]
|
||||
int IsUsingDefaultDestination();
|
||||
|
||||
[PreserveSig]
|
||||
int GetPreferredAspectRatio( out int plAspectX, out int plAspectY );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868b4-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsDual )]
|
||||
public interface IVideoWindow
|
||||
{
|
||||
[PreserveSig]
|
||||
int put_Caption( string caption );
|
||||
[PreserveSig]
|
||||
int get_Caption( [Out] out string caption );
|
||||
|
||||
[PreserveSig]
|
||||
int put_WindowStyle( int windowStyle );
|
||||
[PreserveSig]
|
||||
int get_WindowStyle( out int windowStyle );
|
||||
|
||||
[PreserveSig]
|
||||
int put_WindowStyleEx( int windowStyleEx );
|
||||
[PreserveSig]
|
||||
int get_WindowStyleEx( out int windowStyleEx );
|
||||
|
||||
[PreserveSig]
|
||||
int put_AutoShow( int autoShow );
|
||||
[PreserveSig]
|
||||
int get_AutoShow( out int autoShow );
|
||||
|
||||
[PreserveSig]
|
||||
int put_WindowState( int windowState );
|
||||
[PreserveSig]
|
||||
int get_WindowState( out int windowState );
|
||||
|
||||
[PreserveSig]
|
||||
int put_BackgroundPalette( int backgroundPalette );
|
||||
[PreserveSig]
|
||||
int get_BackgroundPalette( out int backgroundPalette );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Visible( int visible );
|
||||
[PreserveSig]
|
||||
int get_Visible( out int visible );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Left( int left );
|
||||
[PreserveSig]
|
||||
int get_Left( out int left );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Width( int width );
|
||||
[PreserveSig]
|
||||
int get_Width( out int width );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Top( int top );
|
||||
[PreserveSig]
|
||||
int get_Top( out int top );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Height( int height );
|
||||
[PreserveSig]
|
||||
int get_Height( out int height );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Owner( IntPtr owner );
|
||||
[PreserveSig]
|
||||
int get_Owner( out IntPtr owner );
|
||||
|
||||
[PreserveSig]
|
||||
int put_MessageDrain( IntPtr drain );
|
||||
[PreserveSig]
|
||||
int get_MessageDrain( out IntPtr drain );
|
||||
|
||||
[PreserveSig]
|
||||
int get_BorderColor( out int color );
|
||||
[PreserveSig]
|
||||
int put_BorderColor( int color );
|
||||
|
||||
[PreserveSig]
|
||||
int get_FullScreenMode( out int fullScreenMode );
|
||||
[PreserveSig]
|
||||
int put_FullScreenMode( int fullScreenMode );
|
||||
|
||||
[PreserveSig]
|
||||
int SetWindowForeground( int focus );
|
||||
|
||||
[PreserveSig]
|
||||
int NotifyOwnerMessage( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam );
|
||||
|
||||
[PreserveSig]
|
||||
int SetWindowPosition( int left, int top, int width, int height );
|
||||
|
||||
[PreserveSig]
|
||||
int GetWindowPosition( out int left, out int top, out int width, out int height );
|
||||
|
||||
[PreserveSig]
|
||||
int GetMinIdealImageSize( out int width, out int height );
|
||||
|
||||
[PreserveSig]
|
||||
int GetMaxIdealImageSize( out int width, out int height );
|
||||
|
||||
[PreserveSig]
|
||||
int GetRestorePosition( out int left, out int top, out int width, out int height );
|
||||
|
||||
[PreserveSig]
|
||||
int HideCursor( int hideCursor );
|
||||
|
||||
[PreserveSig]
|
||||
int IsCursorHidden( out int hideCursor );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868b2-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsDual )]
|
||||
public interface IMediaPosition
|
||||
{
|
||||
[PreserveSig]
|
||||
int get_Duration( out double pLength );
|
||||
|
||||
[PreserveSig]
|
||||
int put_CurrentPosition( double llTime );
|
||||
[PreserveSig]
|
||||
int get_CurrentPosition( out double pllTime );
|
||||
|
||||
[PreserveSig]
|
||||
int get_StopTime( out double pllTime );
|
||||
[PreserveSig]
|
||||
int put_StopTime( double llTime );
|
||||
|
||||
[PreserveSig]
|
||||
int get_PrerollTime( out double pllTime );
|
||||
[PreserveSig]
|
||||
int put_PrerollTime( double llTime );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Rate( double dRate );
|
||||
[PreserveSig]
|
||||
int get_Rate( out double pdRate );
|
||||
|
||||
[PreserveSig]
|
||||
int CanSeekForward( out int pCanSeekForward );
|
||||
[PreserveSig]
|
||||
int CanSeekBackward( out int pCanSeekBackward );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868b3-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsDual )]
|
||||
public interface IBasicAudio
|
||||
{
|
||||
[PreserveSig]
|
||||
int put_Volume( int lVolume );
|
||||
[PreserveSig]
|
||||
int get_Volume( out int plVolume );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Balance( int lBalance );
|
||||
[PreserveSig]
|
||||
int get_Balance( out int plBalance );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868b9-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsDual )]
|
||||
public interface IAMCollection
|
||||
{
|
||||
[PreserveSig]
|
||||
int get_Count( out int plCount );
|
||||
|
||||
[PreserveSig]
|
||||
int Item( int lItem,
|
||||
[Out, MarshalAs(UnmanagedType.IUnknown) ] out object ppUnk );
|
||||
|
||||
[PreserveSig]
|
||||
int get_NewEnum(
|
||||
[Out, MarshalAs(UnmanagedType.IUnknown) ] out object ppUnk );
|
||||
}
|
||||
|
||||
|
||||
public enum DsEvCode
|
||||
{
|
||||
None,
|
||||
Complete = 0x01, // EC_COMPLETE
|
||||
UserAbort = 0x02, // EC_USERABORT
|
||||
ErrorAbort = 0x03, // EC_ERRORABORT
|
||||
Time = 0x04, // EC_TIME
|
||||
Repaint = 0x05, // EC_REPAINT
|
||||
StErrStopped = 0x06, // EC_STREAM_ERROR_STOPPED
|
||||
StErrStPlaying = 0x07, // EC_STREAM_ERROR_STILLPLAYING
|
||||
ErrorStPlaying = 0x08, // EC_ERROR_STILLPLAYING
|
||||
PaletteChanged = 0x09, // EC_PALETTE_CHANGED
|
||||
VideoSizeChanged = 0x0a, // EC_VIDEO_SIZE_CHANGED
|
||||
QualityChange = 0x0b, // EC_QUALITY_CHANGE
|
||||
ShuttingDown = 0x0c, // EC_SHUTTING_DOWN
|
||||
ClockChanged = 0x0d, // EC_CLOCK_CHANGED
|
||||
Paused = 0x0e, // EC_PAUSED
|
||||
OpeningFile = 0x10, // EC_OPENING_FILE
|
||||
BufferingData = 0x11, // EC_BUFFERING_DATA
|
||||
FullScreenLost = 0x12, // EC_FULLSCREEN_LOST
|
||||
Activate = 0x13, // EC_ACTIVATE
|
||||
NeedRestart = 0x14, // EC_NEED_RESTART
|
||||
WindowDestroyed = 0x15, // EC_WINDOW_DESTROYED
|
||||
DisplayChanged = 0x16, // EC_DISPLAY_CHANGED
|
||||
Starvation = 0x17, // EC_STARVATION
|
||||
OleEvent = 0x18, // EC_OLE_EVENT
|
||||
NotifyWindow = 0x19, // EC_NOTIFY_WINDOW
|
||||
// EC_ ....
|
||||
|
||||
// DVDevCod.h
|
||||
DvdDomChange = 0x101, // EC_DVD_DOMAIN_CHANGE
|
||||
DvdTitleChange = 0x102, // EC_DVD_TITLE_CHANGE
|
||||
DvdChaptStart = 0x103, // EC_DVD_CHAPTER_START
|
||||
DvdAudioStChange = 0x104, // EC_DVD_AUDIO_STREAM_CHANGE
|
||||
|
||||
DvdSubPicStChange = 0x105, // EC_DVD_SUBPICTURE_STREAM_CHANGE
|
||||
DvdAngleChange = 0x106, // EC_DVD_ANGLE_CHANGE
|
||||
DvdButtonChange = 0x107, // EC_DVD_BUTTON_CHANGE
|
||||
DvdValidUopsChange = 0x108, // EC_DVD_VALID_UOPS_CHANGE
|
||||
DvdStillOn = 0x109, // EC_DVD_STILL_ON
|
||||
DvdStillOff = 0x10a, // EC_DVD_STILL_OFF
|
||||
DvdCurrentTime = 0x10b, // EC_DVD_CURRENT_TIME
|
||||
DvdError = 0x10c, // EC_DVD_ERROR
|
||||
DvdWarning = 0x10d, // EC_DVD_WARNING
|
||||
DvdChaptAutoStop = 0x10e, // EC_DVD_CHAPTER_AUTOSTOP
|
||||
DvdNoFpPgc = 0x10f, // EC_DVD_NO_FP_PGC
|
||||
DvdPlaybRateChange = 0x110, // EC_DVD_PLAYBACK_RATE_CHANGE
|
||||
DvdParentalLChange = 0x111, // EC_DVD_PARENTAL_LEVEL_CHANGE
|
||||
DvdPlaybStopped = 0x112, // EC_DVD_PLAYBACK_STOPPED
|
||||
DvdAnglesAvail = 0x113, // EC_DVD_ANGLES_AVAILABLE
|
||||
DvdPeriodAStop = 0x114, // EC_DVD_PLAYPERIOD_AUTOSTOP
|
||||
DvdButtonAActivated = 0x115, // EC_DVD_BUTTON_AUTO_ACTIVATED
|
||||
DvdCmdStart = 0x116, // EC_DVD_CMD_START
|
||||
DvdCmdEnd = 0x117, // EC_DVD_CMD_END
|
||||
DvdDiscEjected = 0x118, // EC_DVD_DISC_EJECTED
|
||||
DvdDiscInserted = 0x119, // EC_DVD_DISC_INSERTED
|
||||
DvdCurrentHmsfTime = 0x11a, // EC_DVD_CURRENT_HMSF_TIME
|
||||
DvdKaraokeMode = 0x11b // EC_DVD_KARAOKE_MODE
|
||||
}
|
||||
|
||||
|
||||
} // namespace DShowNET
|
||||
@@ -0,0 +1,567 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// DsCore
|
||||
// Core streaming interfaces, ported from axcore.idl
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
|
||||
[ComVisible(false)]
|
||||
public enum PinDirection // PIN_DIRECTION
|
||||
{
|
||||
Input, // PINDIR_INPUT
|
||||
Output // PINDIR_OUTPUT
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
public enum PhysicalConnectorType
|
||||
{
|
||||
Video_Tuner = 1,
|
||||
Video_Composite,
|
||||
Video_SVideo,
|
||||
Video_RGB,
|
||||
Video_YRYBY,
|
||||
Video_SerialDigital,
|
||||
Video_ParallelDigital,
|
||||
Video_SCSI,
|
||||
Video_AUX,
|
||||
Video_1394,
|
||||
Video_USB,
|
||||
Video_VideoDecoder,
|
||||
Video_VideoEncoder,
|
||||
Video_SCART,
|
||||
|
||||
Audio_Tuner = 4096,
|
||||
Audio_Line,
|
||||
Audio_Mic,
|
||||
Audio_AESDigital,
|
||||
Audio_SPDIFDigital,
|
||||
Audio_SCSI,
|
||||
Audio_AUX,
|
||||
Audio_1394,
|
||||
Audio_USB,
|
||||
Audio_AudioDecoder,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
[ComVisible(false)]
|
||||
public class DsHlp
|
||||
{
|
||||
public const int OATRUE = -1;
|
||||
public const int OAFALSE = 0;
|
||||
|
||||
[DllImport( "quartz.dll", CharSet=CharSet.Auto)]
|
||||
public static extern int AMGetErrorText( int hr, StringBuilder buf, int max );
|
||||
}
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a86891-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IPin
|
||||
{
|
||||
[PreserveSig]
|
||||
int Connect(
|
||||
[In] IPin pReceivePin,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int ReceiveConnection(
|
||||
[In] IPin pReceivePin,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int Disconnect();
|
||||
|
||||
[PreserveSig]
|
||||
int ConnectedTo( [Out] out IPin ppPin );
|
||||
|
||||
[PreserveSig]
|
||||
int ConnectionMediaType(
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int QueryPinInfo( [Out] out PinInfo pInfo );
|
||||
|
||||
[PreserveSig]
|
||||
int QueryDirection( out PinDirection pPinDir );
|
||||
|
||||
[PreserveSig]
|
||||
int QueryId(
|
||||
[Out, MarshalAs(UnmanagedType.LPWStr) ] out string Id );
|
||||
|
||||
[PreserveSig]
|
||||
int QueryAccept(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int EnumMediaTypes( IntPtr ppEnum );
|
||||
|
||||
[PreserveSig]
|
||||
int QueryInternalConnections( IntPtr apPin, [In, Out] ref int nPin );
|
||||
|
||||
[PreserveSig]
|
||||
int EndOfStream();
|
||||
|
||||
[PreserveSig]
|
||||
int BeginFlush();
|
||||
|
||||
[PreserveSig]
|
||||
int EndFlush();
|
||||
|
||||
[PreserveSig]
|
||||
int NewSegment( long tStart, long tStop, double dRate );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a8689f-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IFilterGraph
|
||||
{
|
||||
[PreserveSig]
|
||||
int AddFilter(
|
||||
[In] IBaseFilter pFilter,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pName );
|
||||
|
||||
[PreserveSig]
|
||||
int RemoveFilter( [In] IBaseFilter pFilter );
|
||||
|
||||
[PreserveSig]
|
||||
int EnumFilters( [Out] out IEnumFilters ppEnum );
|
||||
|
||||
[PreserveSig]
|
||||
int FindFilterByName(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pName,
|
||||
[Out] out IBaseFilter ppFilter );
|
||||
|
||||
[PreserveSig]
|
||||
int ConnectDirect( [In] IPin ppinOut, [In] IPin ppinIn,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int Reconnect( [In] IPin ppin );
|
||||
|
||||
[PreserveSig]
|
||||
int Disconnect( [In] IPin ppin );
|
||||
|
||||
[PreserveSig]
|
||||
int SetDefaultSyncSource();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("0000010c-0000-0000-C000-000000000046"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IPersist
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetClassID(
|
||||
[Out] out Guid pClassID );
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("0000010c-0000-0000-C000-000000000046"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IPersistStream
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetClassID(
|
||||
[Out] out Guid pClassID );
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a86899-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IMediaFilter
|
||||
{
|
||||
#region "IPersist Methods"
|
||||
[PreserveSig]
|
||||
int GetClassID(
|
||||
[Out] out Guid pClassID );
|
||||
#endregion
|
||||
|
||||
[PreserveSig]
|
||||
int Stop();
|
||||
|
||||
[PreserveSig]
|
||||
int Pause();
|
||||
|
||||
[PreserveSig]
|
||||
int Run( long tStart );
|
||||
|
||||
[PreserveSig]
|
||||
int GetState( int dwMilliSecsTimeout, out int filtState );
|
||||
|
||||
[PreserveSig]
|
||||
int SetSyncSource( [In] IReferenceClock pClock );
|
||||
|
||||
[PreserveSig]
|
||||
int GetSyncSource( [Out] out IReferenceClock pClock );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a86895-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IBaseFilter
|
||||
{
|
||||
#region "IPersist Methods"
|
||||
[PreserveSig]
|
||||
int GetClassID(
|
||||
[Out] out Guid pClassID );
|
||||
#endregion
|
||||
|
||||
#region "IMediaFilter Methods"
|
||||
[PreserveSig]
|
||||
int Stop();
|
||||
|
||||
[PreserveSig]
|
||||
int Pause();
|
||||
|
||||
[PreserveSig]
|
||||
int Run( long tStart );
|
||||
|
||||
[PreserveSig]
|
||||
int GetState( int dwMilliSecsTimeout, [Out] out int filtState );
|
||||
|
||||
[PreserveSig]
|
||||
int SetSyncSource( [In] IReferenceClock pClock );
|
||||
|
||||
[PreserveSig]
|
||||
int GetSyncSource( [Out] out IReferenceClock pClock );
|
||||
#endregion
|
||||
|
||||
[PreserveSig]
|
||||
int EnumPins(
|
||||
[Out] out IEnumPins ppEnum );
|
||||
|
||||
[PreserveSig]
|
||||
int FindPin(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string Id,
|
||||
[Out] out IPin ppPin );
|
||||
|
||||
[PreserveSig]
|
||||
int QueryFilterInfo(
|
||||
[Out] FilterInfo pInfo );
|
||||
|
||||
[PreserveSig]
|
||||
int JoinFilterGraph(
|
||||
[In] IFilterGraph pGraph,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pName );
|
||||
|
||||
[PreserveSig]
|
||||
int QueryVendorInfo(
|
||||
[Out, MarshalAs(UnmanagedType.LPWStr) ] out string pVendorInfo );
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode), ComVisible(false)]
|
||||
public class FilterInfo // FILTER_INFO
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]
|
||||
public string achName;
|
||||
[MarshalAs(UnmanagedType.IUnknown)]
|
||||
public object pUnk;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("36b73880-c2c8-11cf-8b46-00805f6cef60"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IMediaSeeking
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetCapabilities( out SeekingCapabilities pCapabilities );
|
||||
|
||||
[PreserveSig]
|
||||
int CheckCapabilities( [In, Out] ref SeekingCapabilities pCapabilities );
|
||||
|
||||
[PreserveSig]
|
||||
int IsFormatSupported( [In] ref Guid pFormat );
|
||||
[PreserveSig]
|
||||
int QueryPreferredFormat( [Out] out Guid pFormat );
|
||||
|
||||
[PreserveSig]
|
||||
int GetTimeFormat( [Out] out Guid pFormat );
|
||||
[PreserveSig]
|
||||
int IsUsingTimeFormat( [In] ref Guid pFormat );
|
||||
[PreserveSig]
|
||||
int SetTimeFormat( [In] ref Guid pFormat );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDuration( out long pDuration );
|
||||
[PreserveSig]
|
||||
int GetStopPosition( out long pStop );
|
||||
[PreserveSig]
|
||||
int GetCurrentPosition( out long pCurrent );
|
||||
|
||||
[PreserveSig]
|
||||
int ConvertTimeFormat( out long pTarget, [In] ref Guid pTargetFormat,
|
||||
long Source, [In] ref Guid pSourceFormat );
|
||||
|
||||
[PreserveSig]
|
||||
int SetPositions(
|
||||
[In, Out, MarshalAs(UnmanagedType.LPStruct)] DsOptInt64 pCurrent,
|
||||
SeekingFlags dwCurrentFlags,
|
||||
[In, Out, MarshalAs(UnmanagedType.LPStruct)] DsOptInt64 pStop,
|
||||
SeekingFlags dwStopFlags );
|
||||
|
||||
[PreserveSig]
|
||||
int GetPositions( out long pCurrent, out long pStop );
|
||||
|
||||
[PreserveSig]
|
||||
int GetAvailable( out long pEarliest, out long pLatest );
|
||||
|
||||
[PreserveSig]
|
||||
int SetRate( double dRate );
|
||||
[PreserveSig]
|
||||
int GetRate( out double pdRate );
|
||||
|
||||
[PreserveSig]
|
||||
int GetPreroll( out long pllPreroll );
|
||||
}
|
||||
|
||||
|
||||
[Flags, ComVisible(false)]
|
||||
public enum SeekingCapabilities // AM_SEEKING_SeekingCapabilities AM_SEEKING_SEEKING_CAPABILITIES
|
||||
{
|
||||
CanSeekAbsolute = 0x001,
|
||||
CanSeekForwards = 0x002,
|
||||
CanSeekBackwards = 0x004,
|
||||
CanGetCurrentPos = 0x008,
|
||||
CanGetStopPos = 0x010,
|
||||
CanGetDuration = 0x020,
|
||||
CanPlayBackwards = 0x040,
|
||||
CanDoSegments = 0x080,
|
||||
Source = 0x100 // Doesn't pass thru used to count segment ends
|
||||
}
|
||||
|
||||
|
||||
[Flags, ComVisible(false)]
|
||||
public enum SeekingFlags // AM_SEEKING_SeekingFlags AM_SEEKING_SEEKING_FLAGS
|
||||
{
|
||||
NoPositioning = 0x00, // No change
|
||||
AbsolutePositioning = 0x01, // Position is supplied and is absolute
|
||||
RelativePositioning = 0x02, // Position is supplied and is relative
|
||||
IncrementalPositioning = 0x03, // (Stop) position relative to current, useful for seeking when paused (use +1)
|
||||
PositioningBitsMask = 0x03, // Useful mask
|
||||
SeekToKeyFrame = 0x04, // Just seek to key frame (performance gain)
|
||||
ReturnTime = 0x08, // Plug the media time equivalents back into the supplied LONGLONGs
|
||||
Segment = 0x10, // At end just do EC_ENDOFSEGMENT, don't do EndOfStream
|
||||
NoFlush = 0x20 // Don't flush
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a86897-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IReferenceClock
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetTime( out long pTime );
|
||||
|
||||
[PreserveSig]
|
||||
int AdviseTime( long baseTime, long streamTime, IntPtr hEvent, out int pdwAdviseCookie);
|
||||
|
||||
[PreserveSig]
|
||||
int AdvisePeriodic( long startTime, long periodTime, IntPtr hSemaphore, out int pdwAdviseCookie);
|
||||
|
||||
[PreserveSig]
|
||||
int Unadvise( int dwAdviseCookie );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a86893-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IEnumFilters
|
||||
{
|
||||
/*
|
||||
[PreserveSig]
|
||||
int Next(
|
||||
[In] int cFilters,
|
||||
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] IBaseFilter[] ppFilter,
|
||||
[Out] out int pcFetched );
|
||||
*/
|
||||
|
||||
[PreserveSig]
|
||||
int Next(
|
||||
[In] uint cFilters,
|
||||
out IBaseFilter x,
|
||||
[Out] out uint pcFetched );
|
||||
|
||||
[PreserveSig]
|
||||
int Skip( [In] int cFilters );
|
||||
void Reset();
|
||||
void Clone( [Out] out IEnumFilters ppEnum );
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a86892-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IEnumPins
|
||||
{
|
||||
[PreserveSig]
|
||||
int Next(
|
||||
[In] int cPins,
|
||||
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] IPin[] ppPins,
|
||||
[Out] out int pcFetched );
|
||||
|
||||
[PreserveSig]
|
||||
int Skip( [In] int cPins );
|
||||
void Reset();
|
||||
void Clone( [Out] out IEnumPins ppEnum );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class AMMediaType // AM_MEDIA_TYPE
|
||||
{
|
||||
public Guid majorType;
|
||||
public Guid subType;
|
||||
[MarshalAs(UnmanagedType.Bool)]
|
||||
public bool fixedSizeSamples;
|
||||
[MarshalAs(UnmanagedType.Bool)]
|
||||
public bool temporalCompression;
|
||||
public int sampleSize;
|
||||
public Guid formatType;
|
||||
public IntPtr unkPtr;
|
||||
public int formatSize;
|
||||
public IntPtr formatPtr;
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Unicode), ComVisible(false)]
|
||||
public struct PinInfo // PIN_INFO
|
||||
{
|
||||
public IBaseFilter filter;
|
||||
public PinDirection dir;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a8689a-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IMediaSample
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetPointer( out IntPtr ppBuffer );
|
||||
[PreserveSig]
|
||||
int GetSize();
|
||||
|
||||
[PreserveSig]
|
||||
int GetTime( out long pTimeStart, out long pTimeEnd );
|
||||
|
||||
[PreserveSig]
|
||||
int SetTime(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] DsOptInt64 pTimeStart,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] DsOptInt64 pTimeEnd );
|
||||
|
||||
[PreserveSig]
|
||||
int IsSyncPoint();
|
||||
[PreserveSig]
|
||||
int SetSyncPoint(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool bIsSyncPoint );
|
||||
|
||||
[PreserveSig]
|
||||
int IsPreroll();
|
||||
[PreserveSig]
|
||||
int SetPreroll(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool bIsPreroll );
|
||||
|
||||
[PreserveSig]
|
||||
int GetActualDataLength();
|
||||
[PreserveSig]
|
||||
int SetActualDataLength( int len );
|
||||
|
||||
[PreserveSig]
|
||||
int GetMediaType(
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)] out AMMediaType ppMediaType );
|
||||
|
||||
[PreserveSig]
|
||||
int SetMediaType(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pMediaType );
|
||||
|
||||
[PreserveSig]
|
||||
int IsDiscontinuity();
|
||||
[PreserveSig]
|
||||
int SetDiscontinuity(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool bDiscontinuity );
|
||||
|
||||
[PreserveSig]
|
||||
int GetMediaTime( out long pTimeStart, out long pTimeEnd );
|
||||
|
||||
[PreserveSig]
|
||||
int SetMediaTime(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] DsOptInt64 pTimeStart,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] DsOptInt64 pTimeEnd );
|
||||
}
|
||||
|
||||
|
||||
} // namespace DShowNET
|
||||
@@ -0,0 +1,752 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// DsDVD
|
||||
// DVD interfaces, ported from dvdif.idl
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET.Dvd
|
||||
{
|
||||
|
||||
|
||||
// =================================================================================================
|
||||
// DVD GRAPH
|
||||
// =================================================================================================
|
||||
|
||||
[Flags]
|
||||
public enum DvdGraphFlags // AM_DVD_GRAPH_FLAGS
|
||||
{
|
||||
Default = 0x00000000,
|
||||
HwDecPrefer = 0x00000001, // AM_DVD_HWDEC_PREFER
|
||||
HwDecOnly = 0x00000002, // AM_DVD_HWDEC_ONLY
|
||||
SwDecPrefer = 0x00000004, // AM_DVD_SWDEC_PREFER
|
||||
SwDecOnly = 0x00000008, // AM_DVD_SWDEC_ONLY
|
||||
NoVpe = 0x00000100 // AM_DVD_NOVPE
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum DvdStreamFlags // AM_DVD_STREAM_FLAGS
|
||||
{
|
||||
None = 0x00000000,
|
||||
Video = 0x00000001, // AM_DVD_STREAM_VIDEO
|
||||
Audio = 0x00000002, // AM_DVD_STREAM_AUDIO
|
||||
SubPic = 0x00000004 // AM_DVD_STREAM_SUBPIC
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdRenderStatus // AM_DVD_RENDERSTATUS
|
||||
{
|
||||
public int vpeStatus;
|
||||
public bool volInvalid;
|
||||
public bool volUnknown;
|
||||
public bool noLine21In;
|
||||
public bool noLine21Out;
|
||||
public int numStreams;
|
||||
public int numStreamsFailed;
|
||||
public DvdStreamFlags failedStreams;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("FCC152B6-F372-11d0-8E00-00C04FD7C08B"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IDvdGraphBuilder
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetFiltergraph(
|
||||
[Out] out IGraphBuilder ppGB );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDvdInterface(
|
||||
[In] ref Guid riid,
|
||||
[Out, MarshalAs(UnmanagedType.IUnknown) ] out object ppvIF );
|
||||
|
||||
[PreserveSig]
|
||||
int RenderDvdVideoVolume(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpcwszPathName,
|
||||
DvdGraphFlags dwFlags,
|
||||
[Out] out DvdRenderStatus pStatus );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// =================================================================================================
|
||||
// DVD CONTROL
|
||||
// =================================================================================================
|
||||
|
||||
[Flags]
|
||||
public enum DvdCmdFlags // DVD_CMD_FLAGS
|
||||
{
|
||||
None = 0x00000000, // DVD_CMD_FLAG_None
|
||||
Flush = 0x00000001, // DVD_CMD_FLAG_Flush
|
||||
SendEvt = 0x00000002, // DVD_CMD_FLAG_SendEvents
|
||||
Block = 0x00000004, // DVD_CMD_FLAG_Block
|
||||
StartWRendered = 0x00000008, // DVD_CMD_FLAG_StartWhenRendered
|
||||
EndARendered = 0x00000010 // DVD_CMD_FLAG_EndAfterRendered
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdTimeCode // DVD_HMSF_TIMECODE
|
||||
{
|
||||
public byte bHours;
|
||||
public byte bMinutes;
|
||||
public byte bSeconds;
|
||||
public byte bFrames;
|
||||
}
|
||||
|
||||
public enum DvdMenuID // DVD_MENU_ID
|
||||
{
|
||||
Title = 2, // DVD_MENU_Title
|
||||
Root = 3, // DVD_MENU_Root
|
||||
Subpicture = 4, // DVD_MENU_Subpicture
|
||||
Audio = 5, // DVD_MENU_Audio
|
||||
Angle = 6, // DVD_MENU_Angle
|
||||
Chapter = 7 // DVD_MENU_Chapter
|
||||
}
|
||||
|
||||
|
||||
public enum DvdRelButton // DVD_RELATIVE_BUTTON
|
||||
{
|
||||
Upper = 1, // DVD_Relative_Upper
|
||||
Lower = 2, // DVD_Relative_Lower
|
||||
Left = 3, // DVD_Relative_Left
|
||||
Right = 4 // DVD_Relative_Right
|
||||
}
|
||||
|
||||
|
||||
public enum DvdOptionFlag // DVD_OPTION_FLAG
|
||||
{
|
||||
ResetOnStop = 1, // DVD_ResetOnStop
|
||||
NotifyParentalLevelChange = 2, // DVD_NotifyParentalLevelChange
|
||||
HmsfTimeCodeEvt = 3 // DVD_HMSF_TimeCodeEvents
|
||||
}
|
||||
|
||||
|
||||
public enum DvdAudioLangExt // DVD_AUDIO_LANG_EXT
|
||||
{
|
||||
NotSpecified = 0, // DVD_AUD_EXT_NotSpecified
|
||||
Captions = 1, // DVD_AUD_EXT_Captions
|
||||
VisuallyImpaired = 2, // DVD_AUD_EXT_VisuallyImpaired
|
||||
DirectorComments1 = 3, // DVD_AUD_EXT_DirectorComments1
|
||||
DirectorComments2 = 4 // DVD_AUD_EXT_DirectorComments2
|
||||
}
|
||||
|
||||
public enum DvdSubPicLangExt // DVD_SUBPICTURE_LANG_EXT
|
||||
{
|
||||
NotSpecified = 0, // DVD_SP_EXT_NotSpecified
|
||||
CaptionNormal = 1, // DVD_SP_EXT_Caption_Normal
|
||||
CaptionBig = 2, // DVD_SP_EXT_Caption_Big
|
||||
CaptionChildren = 3, // DVD_SP_EXT_Caption_Children
|
||||
ClosedNormal = 5, // DVD_SP_EXT_CC_Normal
|
||||
ClosedBig = 6, // DVD_SP_EXT_CC_Big
|
||||
ClosedChildren = 7, // DVD_SP_EXT_CC_Children
|
||||
Forced = 9, // DVD_SP_EXT_Forced
|
||||
DirectorCmtNormal = 13, // DVD_SP_EXT_DirectorComments_Normal
|
||||
DirectorCmtBig = 14, // DVD_SP_EXT_DirectorComments_Big
|
||||
DirectorCmtChildren = 15, // DVD_SP_EXT_DirectorComments_Children
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("33BC7430-EEC0-11D2-8201-00A0C9D74842"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IDvdControl2
|
||||
{
|
||||
[PreserveSig]
|
||||
int PlayTitle( int ulTitle, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayChapterInTitle( int ulTitle, int ulChapter, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayAtTimeInTitle( int ulTitle, [In] ref DvdTimeCode pStartTime, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int Stop();
|
||||
|
||||
[PreserveSig]
|
||||
int ReturnFromSubmenu( DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayAtTime( [In] ref DvdTimeCode pTime, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayChapter( int ulChapter, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayPrevChapter( DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int ReplayChapter( DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayNextChapter( DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayForwards( double dSpeed, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayBackwards( double dSpeed, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int ShowMenu( DvdMenuID MenuID, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int Resume( DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectRelativeButton( DvdRelButton buttonDir );
|
||||
|
||||
[PreserveSig]
|
||||
int ActivateButton();
|
||||
|
||||
[PreserveSig]
|
||||
int SelectButton( int ulButton );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectAndActivateButton( int ulButton );
|
||||
|
||||
[PreserveSig]
|
||||
int StillOff();
|
||||
|
||||
[PreserveSig]
|
||||
int Pause(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool bState );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectAudioStream( int ulAudio, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectSubpictureStream( int ulSubPicture, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int SetSubpictureState(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool bState,
|
||||
DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectAngle( int ulAngle, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectParentalLevel( int ulParentalLevel );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectParentalCountry( byte[] bCountry );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectKaraokeAudioPresentationMode( int ulMode );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectVideoModePreference( int ulPreferredDisplayMode );
|
||||
|
||||
[PreserveSig]
|
||||
int SetDVDDirectory(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pszwPath );
|
||||
|
||||
[PreserveSig]
|
||||
int ActivateAtPosition( DsPOINT point );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectAtPosition( DsPOINT point );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayChaptersAutoStop( int ulTitle, int ulChapter, int ulChaptersToPlay, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int AcceptParentalLevelChange(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool bAccept );
|
||||
|
||||
[PreserveSig]
|
||||
int SetOption( DvdOptionFlag flag,
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool fState );
|
||||
|
||||
[PreserveSig]
|
||||
int SetState( IDvdState pState, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int PlayPeriodInTitleAutoStop( int ulTitle,
|
||||
[In] ref DvdTimeCode pStartTime,
|
||||
[In] ref DvdTimeCode pEndTime,
|
||||
DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int SetGPRM( int ulIndex, short wValue, DvdCmdFlags dwFlags,
|
||||
[Out] OptIDvdCmd ppCmd );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectDefaultMenuLanguage( int Language );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectDefaultAudioLanguage( int Language, DvdAudioLangExt audioExtension );
|
||||
|
||||
[PreserveSig]
|
||||
int SelectDefaultSubpictureLanguage( int Language, DvdSubPicLangExt subpictureExtension );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("5a4a97e4-94ee-4a55-9751-74b5643aa27d"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IDvdCmd
|
||||
{
|
||||
[PreserveSig]
|
||||
int WaitForStart();
|
||||
[PreserveSig]
|
||||
int WaitForEnd();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("86303d6d-1c4a-4087-ab42-f711167048ef"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IDvdState
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetDiscID( [Out] out long pullUniqueID );
|
||||
[PreserveSig]
|
||||
int GetParentalLevel( [Out] out int pulParentalLevel );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// =================================================================================================
|
||||
// DVD INFO
|
||||
// =================================================================================================
|
||||
|
||||
|
||||
public enum DvdDomain // DVD_DOMAIN
|
||||
{
|
||||
FirstPlay = 1, // DVD_DOMAIN_FirstPlay
|
||||
VideoManagerMenu = 2, // DVD_DOMAIN_VideoManagerMenu
|
||||
VideoTitleSetMenu = 3, // DVD_DOMAIN_VideoTitleSetMenu
|
||||
Title = 4, // DVD_DOMAIN_Title
|
||||
Stop = 5 // DVD_DOMAIN_Stop
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
public enum DvdVideoCompress // DVD_VIDEO_COMPRESSION
|
||||
{
|
||||
Other = 0, // DVD_VideoCompression_Other
|
||||
Mpeg1 = 1, // DVD_VideoCompression_MPEG1
|
||||
Mpeg2 = 2 // DVD_VideoCompression_MPEG2
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdPlayLocation // DVD_PLAYBACK_LOCATION2
|
||||
{
|
||||
public int TitleNum;
|
||||
public int ChapterNum;
|
||||
public DvdTimeCode timeCode;
|
||||
public int TimeCodeFlags;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdMenuAttr // DVD_MenuAttributes
|
||||
{
|
||||
[MarshalAs( UnmanagedType.ByValArray, SizeConst=8 )]
|
||||
public bool[] compatibleRegion;
|
||||
public DvdVideoAttr videoAt; // DVD_VideoAttributes
|
||||
|
||||
public bool audioPresent;
|
||||
public DvdAudioAttr audioAt; // DVD_AudioAttributes
|
||||
|
||||
public bool subPicPresent;
|
||||
public DvdSubPicAttr subPicAt; // DVD_SubpictureAttributes
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdVideoAttr // DVD_VideoAttributes
|
||||
{
|
||||
public bool panscanPermitted;
|
||||
public bool letterboxPermitted;
|
||||
public int aspectX;
|
||||
public int aspectY;
|
||||
public int frameRate;
|
||||
public int frameHeight;
|
||||
public DvdVideoCompress compression;
|
||||
public bool line21Field1InGOP;
|
||||
public bool line21Field2InGOP;
|
||||
public int sourceResolutionX;
|
||||
public int sourceResolutionY;
|
||||
public bool isSourceLetterboxed;
|
||||
public bool isFilmMode;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
public enum DvdAudioAppMode // DVD_AUDIO_APPMODE
|
||||
{
|
||||
None = 0, // DVD_AudioMode_None
|
||||
Karaoke = 1, // DVD_AudioMode_Karaoke
|
||||
Surround = 2, // DVD_AudioMode_Surround
|
||||
Other = 3 // DVD_AudioMode_Other
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
public enum DvdAudioFormat // DVD_AUDIO_FORMAT
|
||||
{
|
||||
Ac3 = 0, // DVD_AudioFormat_AC3
|
||||
Mpeg1 = 1, // DVD_AudioFormat_MPEG1
|
||||
Mpeg1Drc = 2, // DVD_AudioFormat_MPEG1_DRC
|
||||
Mpeg2 = 3, // DVD_AudioFormat_MPEG2
|
||||
Mpeg2Drc = 4, // DVD_AudioFormat_MPEG2_DRC
|
||||
Lpcm = 5, // DVD_AudioFormat_LPCM
|
||||
Dts = 6, // DVD_AudioFormat_DTS
|
||||
Sdds = 7, // DVD_AudioFormat_SDDS
|
||||
Other = 8 // DVD_AudioFormat_Other
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdAudioAttr // DVD_AudioAttributes
|
||||
{
|
||||
public DvdAudioAppMode appMode;
|
||||
public int appModeData;
|
||||
public DvdAudioFormat audioFormat;
|
||||
public int language;
|
||||
public DvdAudioLangExt languageExtension;
|
||||
public bool hasMultichannelInfo;
|
||||
public int frequency;
|
||||
public byte quantization;
|
||||
public byte numberOfChannels;
|
||||
public short dummy;
|
||||
public int res1;
|
||||
public int res2;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
public enum DvdSubPicType // DVD_SUBPICTURE_TYPE
|
||||
{
|
||||
NotSpecified = 0, // DVD_SPType_NotSpecified
|
||||
Language = 1, // DVD_SPType_Language
|
||||
Other = 2 // DVD_SPType_Other
|
||||
}
|
||||
|
||||
public enum DvdSubPicCoding // DVD_SUBPICTURE_CODING
|
||||
{
|
||||
RunLength = 0, // DVD_SPCoding_RunLength
|
||||
Extended = 1, // DVD_SPCoding_Extended
|
||||
Other = 2 // DVD_SPCoding_Other
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdSubPicAttr // DVD_SubpictureAttributes
|
||||
{
|
||||
public DvdSubPicType type;
|
||||
public DvdSubPicCoding coding;
|
||||
public int language;
|
||||
public DvdSubPicLangExt languageExt;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
public enum DvdTitleAppMode // DVD_TITLE_APPMODE
|
||||
{
|
||||
NotSpecified = 0, // DVD_AppMode_Not_Specified
|
||||
Karaoke = 1, // DVD_AppMode_Karaoke
|
||||
Other = 3 // DVD_AppMode_Other
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdTitleAttr // DVD_TitleAttributes
|
||||
{
|
||||
public DvdTitleAppMode appMode; // DVD_TITLE_APPMODE
|
||||
public DvdVideoAttr videoAt; // DVD_VideoAttributes
|
||||
public int numberOfAudioStreams;
|
||||
// WARNING: incomplete
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
public enum DvdDiscSide // DVD_DISC_SIDE
|
||||
{
|
||||
A = 1, // DVD_SIDE_A
|
||||
B = 2 // DVD_SIDE_B
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
public enum DvdCharSet // DVD_TextCharSet
|
||||
{
|
||||
Unicode = 0, // DVD_CharSet_Unicode
|
||||
Iso646 = 1, // DVD_CharSet_ISO646
|
||||
Jis = 2, // DVD_CharSet_JIS_Roman_Kanji
|
||||
Iso8859 = 3, // DVD_CharSet_ISO8859_1
|
||||
SiftJis = 4 // DVD_CharSet_ShiftJIS_Kanji_Roman_Katakana
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[Flags]
|
||||
public enum DvdAudioCaps // DVD_AUDIO_CAPS_xx
|
||||
{
|
||||
Ac3 = 0x00000001, // DVD_AUDIO_CAPS_AC3
|
||||
Mpeg2 = 0x00000002, // DVD_AUDIO_CAPS_MPEG2
|
||||
Lpcm = 0x00000004, // DVD_AUDIO_CAPS_LPCM
|
||||
Dts = 0x00000008, // DVD_AUDIO_CAPS_DTS
|
||||
Sdds = 0x00000010 // DVD_AUDIO_CAPS_SDDS
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=1), ComVisible(false)]
|
||||
public struct DvdDecoderCaps // DVD_DECODER_CAPS
|
||||
{
|
||||
public int size; // size of this struct
|
||||
public DvdAudioCaps audioCaps;
|
||||
public double fwdMaxRateVideo;
|
||||
public double fwdMaxRateAudio;
|
||||
public double fwdMaxRateSP;
|
||||
public double bwdMaxRateVideo;
|
||||
public double bwdMaxRateAudio;
|
||||
public double bwdMaxRateSP;
|
||||
public int res1;
|
||||
public int res2;
|
||||
public int res3;
|
||||
public int res4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("34151510-EEC0-11D2-8201-00A0C9D74842"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IDvdInfo2
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetCurrentDomain( [Out] out DvdDomain pDomain );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentLocation( [Out] out DvdPlayLocation pLocation );
|
||||
|
||||
[PreserveSig]
|
||||
int GetTotalTitleTime( [Out] out DvdTimeCode pTotalTime, out int ulTimeCodeFlags );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentButton( out int pulButtonsAvailable, out int pulCurrentButton );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentAngle( out int pulAnglesAvailable, out int pulCurrentAngle );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentAudio( out int pulStreamsAvailable, out int pulCurrentStream );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentSubpicture( out int pulStreamsAvailable, out int pulCurrentStream,
|
||||
[Out, MarshalAs(UnmanagedType.Bool)] out bool pbIsDisabled );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentUOPS( out int pulUOPs );
|
||||
|
||||
[PreserveSig]
|
||||
int GetAllSPRMs( out IntPtr pRegisterArray );
|
||||
|
||||
[PreserveSig]
|
||||
int GetAllGPRMs( out IntPtr pRegisterArray );
|
||||
|
||||
[PreserveSig]
|
||||
int GetAudioLanguage( int ulStream, out int pLanguage );
|
||||
|
||||
[PreserveSig]
|
||||
int GetSubpictureLanguage( int ulStream, out int pLanguage );
|
||||
|
||||
[PreserveSig]
|
||||
int GetTitleAttributes( int ulTitle,
|
||||
[Out] out DvdMenuAttr pMenu, IntPtr pTitle ); // incomplete
|
||||
|
||||
[PreserveSig]
|
||||
int GetVMGAttributes( [Out] out DvdMenuAttr pATR );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentVideoAttributes( [Out] out DvdVideoAttr pATR );
|
||||
|
||||
[PreserveSig]
|
||||
int GetAudioAttributes( int ulStream, [Out] out DvdAudioAttr pATR );
|
||||
|
||||
[PreserveSig]
|
||||
int GetKaraokeAttributes( int ulStream, IntPtr pATR );
|
||||
|
||||
[PreserveSig]
|
||||
int GetSubpictureAttributes( int ulStream, [Out] out DvdSubPicAttr pATR );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDVDVolumeInfo( out int pulNumOfVolumes, out int pulVolume,
|
||||
out DvdDiscSide pSide, out int pulNumOfTitles );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDVDTextNumberOfLanguages( out int pulNumOfLangs );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDVDTextLanguageInfo( int ulLangIndex,
|
||||
out int pulNumOfStrings, out int pLangCode, out DvdCharSet pbCharacterSet );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDVDTextStringAsNative( int ulLangIndex, int ulStringIndex,
|
||||
IntPtr pbBuffer, int ulMaxBufferSize, out int pulActualSize, out int pType );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDVDTextStringAsUnicode( int ulLangIndex, int ulStringIndex,
|
||||
IntPtr pchwBuffer, int ulMaxBufferSize, out int pulActualSize, out int pType );
|
||||
|
||||
[PreserveSig]
|
||||
int GetPlayerParentalLevel( out int pulParentalLevel, [Out] byte[] pbCountryCode );
|
||||
|
||||
[PreserveSig]
|
||||
int GetNumberOfChapters( int ulTitle, out int pulNumOfChapters );
|
||||
|
||||
[PreserveSig]
|
||||
int GetTitleParentalLevels( int ulTitle, out int pulParentalLevels );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDVDDirectory( IntPtr pszwPath, int ulMaxSize, out int pulActualSize );
|
||||
|
||||
[PreserveSig]
|
||||
int IsAudioStreamEnabled( int ulStreamNum,
|
||||
[Out, MarshalAs(UnmanagedType.Bool)] out bool pbEnabled );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDiscID(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pszwPath,
|
||||
out long pullDiscID );
|
||||
[PreserveSig]
|
||||
int GetState(
|
||||
[Out] out IDvdState pStateData );
|
||||
|
||||
[PreserveSig]
|
||||
int GetMenuLanguages( [Out] int[] pLanguages, int ulMaxLanguages, out int pulActualLanguages );
|
||||
|
||||
[PreserveSig]
|
||||
int GetButtonAtPosition( DsPOINT point, out int pulButtonIndex );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCmdFromEvent( int lParam1,
|
||||
[Out] out IDvdCmd pCmdObj );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDefaultMenuLanguage( out int pLanguage );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDefaultAudioLanguage( out int pLanguage, out DvdAudioLangExt pAudioExtension );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDefaultSubpictureLanguage( out int pLanguage, out DvdSubPicLangExt pSubpictureExtension );
|
||||
|
||||
[PreserveSig]
|
||||
int GetDecoderCaps( ref DvdDecoderCaps pCaps );
|
||||
|
||||
[PreserveSig]
|
||||
int GetButtonRect( int ulButton, out DsRECT pRect );
|
||||
|
||||
[PreserveSig]
|
||||
int IsSubpictureStreamEnabled( int ulStreamNum,
|
||||
[Out, MarshalAs(UnmanagedType.Bool)] out bool pbEnabled );
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class OptIDvdCmd
|
||||
{
|
||||
public IDvdCmd dvdCmd;
|
||||
}
|
||||
|
||||
|
||||
} // namespace DShowNET.Dvd
|
||||
@@ -0,0 +1,166 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// DsDevice
|
||||
// enumerate directshow devices and moniker handling
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET.Device
|
||||
{
|
||||
|
||||
[ComVisible(false)]
|
||||
public class DsDev
|
||||
{
|
||||
|
||||
public static bool GetDevicesOfCat( Guid cat, out ArrayList devs )
|
||||
{
|
||||
devs = null;
|
||||
int hr;
|
||||
object comObj = null;
|
||||
ICreateDevEnum enumDev = null;
|
||||
UCOMIEnumMoniker enumMon = null;
|
||||
UCOMIMoniker[] mon = new UCOMIMoniker[1];
|
||||
try {
|
||||
Type srvType = Type.GetTypeFromCLSID( Clsid.SystemDeviceEnum );
|
||||
if( srvType == null )
|
||||
throw new NotImplementedException( "System Device Enumerator" );
|
||||
|
||||
comObj = Activator.CreateInstance( srvType );
|
||||
enumDev = (ICreateDevEnum) comObj;
|
||||
hr = enumDev.CreateClassEnumerator( ref cat, out enumMon, 0 );
|
||||
if( hr != 0 )
|
||||
throw new NotSupportedException( "No devices of the category" );
|
||||
|
||||
int f, count = 0;
|
||||
do
|
||||
{
|
||||
hr = enumMon.Next( 1, mon, out f );
|
||||
if( (hr != 0) || (mon[0] == null) )
|
||||
break;
|
||||
DsDevice dev = new DsDevice();
|
||||
dev.Name = GetFriendlyName( mon[0] );
|
||||
if( devs == null )
|
||||
devs = new ArrayList();
|
||||
dev.Mon = mon[0]; mon[0] = null;
|
||||
devs.Add( dev ); dev = null;
|
||||
count++;
|
||||
}
|
||||
while(true);
|
||||
|
||||
return count > 0;
|
||||
}
|
||||
catch( Exception )
|
||||
{
|
||||
if( devs != null )
|
||||
{
|
||||
foreach( DsDevice d in devs )
|
||||
d.Dispose();
|
||||
devs = null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
enumDev = null;
|
||||
if( mon[0] != null )
|
||||
Marshal.ReleaseComObject( mon[0] ); mon[0] = null;
|
||||
if( enumMon != null )
|
||||
Marshal.ReleaseComObject( enumMon ); enumMon = null;
|
||||
if( comObj != null )
|
||||
Marshal.ReleaseComObject( comObj ); comObj = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static string GetFriendlyName( UCOMIMoniker mon )
|
||||
{
|
||||
object bagObj = null;
|
||||
IPropertyBag bag = null;
|
||||
try {
|
||||
Guid bagId = typeof( IPropertyBag ).GUID;
|
||||
mon.BindToStorage( null, null, ref bagId, out bagObj );
|
||||
bag = (IPropertyBag) bagObj;
|
||||
object val = "";
|
||||
int hr = bag.Read( "FriendlyName", ref val, IntPtr.Zero );
|
||||
if( hr != 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
string ret = val as string;
|
||||
if( (ret == null) || (ret.Length < 1) )
|
||||
throw new NotImplementedException( "Device FriendlyName" );
|
||||
return ret;
|
||||
}
|
||||
catch( Exception )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
bag = null;
|
||||
if( bagObj != null )
|
||||
Marshal.ReleaseComObject( bagObj ); bagObj = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[ComVisible(false)]
|
||||
public class DsDevice : IDisposable
|
||||
{
|
||||
public string Name;
|
||||
public UCOMIMoniker Mon;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if( Mon != null )
|
||||
Marshal.ReleaseComObject( Mon ); Mon = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("29840822-5B84-11D0-BD3B-00A0C911CE86"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface ICreateDevEnum
|
||||
{
|
||||
[PreserveSig]
|
||||
int CreateClassEnumerator(
|
||||
[In] ref Guid pType,
|
||||
[Out] out UCOMIEnumMoniker ppEnumMoniker,
|
||||
[In] int dwFlags );
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("55272A00-42CB-11CE-8135-00AA004BB851"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IPropertyBag
|
||||
{
|
||||
[PreserveSig]
|
||||
int Read(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pszPropName,
|
||||
[In, Out, MarshalAs(UnmanagedType.Struct)] ref object pVar,
|
||||
IntPtr pErrorLog );
|
||||
|
||||
[PreserveSig]
|
||||
int Write(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pszPropName,
|
||||
[In, MarshalAs(UnmanagedType.Struct)] ref object pVar );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace DShowNET.Device
|
||||
@@ -0,0 +1,714 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// DsExtend
|
||||
// Extended streaming interfaces, ported from axextend.idl
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface ICaptureGraphBuilder2
|
||||
{
|
||||
[PreserveSig]
|
||||
int SetFiltergraph( [In] IGraphBuilder pfg );
|
||||
|
||||
[PreserveSig]
|
||||
int GetFiltergraph( [Out] out IGraphBuilder ppfg );
|
||||
|
||||
[PreserveSig]
|
||||
int SetOutputFileName(
|
||||
[In] ref Guid pType,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpstrFile,
|
||||
[Out] out IBaseFilter ppbf,
|
||||
[Out] out IFileSinkFilter ppSink );
|
||||
|
||||
[PreserveSig]
|
||||
int FindInterface(
|
||||
[In] ref Guid pCategory,
|
||||
[In] ref Guid pType,
|
||||
[In] IBaseFilter pbf,
|
||||
[In] ref Guid riid,
|
||||
[Out, MarshalAs(UnmanagedType.IUnknown) ] out object ppint );
|
||||
|
||||
[PreserveSig]
|
||||
int RenderStream(
|
||||
[In] ref Guid pCategory,
|
||||
[In] ref Guid pType,
|
||||
[In, MarshalAs(UnmanagedType.IUnknown)] object pSource,
|
||||
[In] IBaseFilter pfCompressor,
|
||||
[In] IBaseFilter pfRenderer );
|
||||
|
||||
[PreserveSig]
|
||||
int ControlStream(
|
||||
[In] ref Guid pCategory,
|
||||
[In] ref Guid pType,
|
||||
[In] IBaseFilter pFilter,
|
||||
[In] long pstart,
|
||||
[In] long pstop,
|
||||
[In] short wStartCookie,
|
||||
[In] short wStopCookie );
|
||||
|
||||
[PreserveSig]
|
||||
int AllocCapFile(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpstrFile,
|
||||
[In] long dwlSize );
|
||||
|
||||
[PreserveSig]
|
||||
int CopyCaptureFile(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpwstrOld,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpwstrNew,
|
||||
[In] int fAllowEscAbort,
|
||||
[In] IAMCopyCaptureFileProgress pFilter );
|
||||
|
||||
|
||||
[PreserveSig]
|
||||
int FindPin(
|
||||
[In] object pSource,
|
||||
[In] int pindir,
|
||||
[In] ref Guid pCategory,
|
||||
[In] ref Guid pType,
|
||||
[In, MarshalAs(UnmanagedType.Bool) ] bool fUnconnected,
|
||||
[In] int num,
|
||||
[Out] out IPin ppPin );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868a9-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IGraphBuilder
|
||||
{
|
||||
#region "IFilterGraph Methods"
|
||||
[PreserveSig]
|
||||
int AddFilter(
|
||||
[In] IBaseFilter pFilter,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pName );
|
||||
|
||||
[PreserveSig]
|
||||
int RemoveFilter( [In] IBaseFilter pFilter );
|
||||
|
||||
[PreserveSig]
|
||||
int EnumFilters( [Out] out IEnumFilters ppEnum );
|
||||
|
||||
[PreserveSig]
|
||||
int FindFilterByName(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pName,
|
||||
[Out] out IBaseFilter ppFilter );
|
||||
|
||||
[PreserveSig]
|
||||
int ConnectDirect( [In] IPin ppinOut, [In] IPin ppinIn,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int Reconnect( [In] IPin ppin );
|
||||
|
||||
[PreserveSig]
|
||||
int Disconnect( [In] IPin ppin );
|
||||
|
||||
[PreserveSig]
|
||||
int SetDefaultSyncSource();
|
||||
#endregion
|
||||
|
||||
[PreserveSig]
|
||||
int Connect( [In] IPin ppinOut, [In] IPin ppinIn );
|
||||
|
||||
[PreserveSig]
|
||||
int Render( [In] IPin ppinOut );
|
||||
|
||||
[PreserveSig]
|
||||
int RenderFile(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpcwstrFile,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpcwstrPlayList );
|
||||
|
||||
[PreserveSig]
|
||||
int AddSourceFilter(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpcwstrFileName,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string lpcwstrFilterName,
|
||||
[Out] out IBaseFilter ppFilter );
|
||||
|
||||
[PreserveSig]
|
||||
int SetLogFile( IntPtr hFile );
|
||||
|
||||
[PreserveSig]
|
||||
int Abort();
|
||||
|
||||
[PreserveSig]
|
||||
int ShouldOperationContinue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("a2104830-7c70-11cf-8bce-00aa00a3f1a6"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IFileSinkFilter
|
||||
{
|
||||
[PreserveSig]
|
||||
int SetFileName(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurFile(
|
||||
[Out, MarshalAs(UnmanagedType.LPWStr) ] out string pszFileName,
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct) ] AMMediaType pmt );
|
||||
}
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("00855B90-CE1B-11d0-BD4F-00A0C911CE86"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IFileSinkFilter2
|
||||
{
|
||||
[PreserveSig]
|
||||
int SetFileName(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurFile(
|
||||
[Out, MarshalAs(UnmanagedType.LPWStr) ] out string pszFileName,
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct) ] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int SetMode( [In] int dwFlags );
|
||||
|
||||
[PreserveSig]
|
||||
int GetMode( [Out] out int dwFlags );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("670d1d20-a068-11d0-b3f0-00aa003761c5"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IAMCopyCaptureFileProgress
|
||||
{
|
||||
[PreserveSig]
|
||||
int Progress( int iProgress );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("e46a9787-2b71-444d-a4b5-1fab7b708d6a"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IVideoFrameStep
|
||||
{
|
||||
[PreserveSig]
|
||||
int Step( int dwFrames,
|
||||
[In, MarshalAs(UnmanagedType.IUnknown)] object pStepObject );
|
||||
|
||||
[PreserveSig]
|
||||
int CanStep( int bMultiple,
|
||||
[In, MarshalAs(UnmanagedType.IUnknown)] object pStepObject );
|
||||
|
||||
[PreserveSig]
|
||||
int CancelStep();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("C6E13340-30AC-11d0-A18C-00A0C9118956"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IAMStreamConfig
|
||||
{
|
||||
[PreserveSig]
|
||||
int SetFormat(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int GetFormat(
|
||||
[Out] out IntPtr pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int GetNumberOfCapabilities( out int piCount, out int piSize );
|
||||
|
||||
[PreserveSig]
|
||||
int GetStreamCaps( int iIndex,
|
||||
//[Out, MarshalAs(UnmanagedType.LPStruct)] out AMMediaType ppmt,
|
||||
[Out] out IntPtr pmt,
|
||||
[In] IntPtr pSCC );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// =============================================================================
|
||||
// TUNER
|
||||
// =============================================================================
|
||||
|
||||
[ComVisible(false)]
|
||||
public enum AMTunerSubChannel
|
||||
{
|
||||
NoTune = -2, // AMTUNER_SUBCHAN_NO_TUNE : don't tune
|
||||
Default = -1 // AMTUNER_SUBCHAN_DEFAULT : use default sub chan
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
public enum AMTunerSignalStrength
|
||||
{
|
||||
NA = -1, // AMTUNER_HASNOSIGNALSTRENGTH : cannot indicate signal strength
|
||||
NoSignal = 0, // AMTUNER_NOSIGNAL : no signal available
|
||||
SignalPresent = 1 // AMTUNER_SIGNALPRESENT : signal present
|
||||
}
|
||||
|
||||
[Flags, ComVisible(false)]
|
||||
public enum AMTunerModeType
|
||||
{
|
||||
Default = 0x0000, // AMTUNER_MODE_DEFAULT : default tuner mode
|
||||
TV = 0x0001, // AMTUNER_MODE_TV : tv
|
||||
FMRadio = 0x0002, // AMTUNER_MODE_FM_RADIO : fm radio
|
||||
AMRadio = 0x0004, // AMTUNER_MODE_AM_RADIO : am radio
|
||||
Dss = 0x0008 // AMTUNER_MODE_DSS : dss
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
public enum AMTunerEventType
|
||||
{
|
||||
Changed = 0x0001, // AMTUNER_EVENT_CHANGED : status changed
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("211A8761-03AC-11d1-8D13-00AA00BD8339"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IAMTuner
|
||||
{
|
||||
[PreserveSig]
|
||||
int put_Channel( int lChannel, AMTunerSubChannel lVideoSubChannel, AMTunerSubChannel lAudioSubChannel );
|
||||
|
||||
[PreserveSig]
|
||||
int get_Channel( out int plChannel, out int plVideoSubChannel, out int plAudioSubChannel );
|
||||
|
||||
[PreserveSig]
|
||||
int ChannelMinMax( out int lChannelMin, out int lChannelMax );
|
||||
|
||||
[PreserveSig]
|
||||
int put_CountryCode( int lCountryCode );
|
||||
|
||||
[PreserveSig]
|
||||
int get_CountryCode( out int plCountryCode );
|
||||
|
||||
[PreserveSig]
|
||||
int put_TuningSpace( int lTuningSpace );
|
||||
|
||||
[PreserveSig]
|
||||
int get_TuningSpace( out int plTuningSpace );
|
||||
|
||||
[PreserveSig]
|
||||
int Logon( IntPtr hCurrentUser );
|
||||
|
||||
[PreserveSig]
|
||||
int Logout();
|
||||
|
||||
[PreserveSig]
|
||||
int SignalPresent( out AMTunerSignalStrength plSignalStrength );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Mode( AMTunerModeType lMode );
|
||||
|
||||
[PreserveSig]
|
||||
int get_Mode( out AMTunerModeType plMode );
|
||||
|
||||
[PreserveSig]
|
||||
int GetAvailableModes( out AMTunerModeType plModes );
|
||||
|
||||
[PreserveSig]
|
||||
int RegisterNotificationCallBack( IAMTunerNotification pNotify, AMTunerEventType lEvents );
|
||||
|
||||
[PreserveSig]
|
||||
int UnRegisterNotificationCallBack( IAMTunerNotification pNotify );
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("211A8760-03AC-11d1-8D13-00AA00BD8339"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IAMTunerNotification
|
||||
{
|
||||
[PreserveSig]
|
||||
int OnEvent( AMTunerEventType Event );
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
[Flags, ComVisible(false)]
|
||||
public enum AnalogVideoStandard
|
||||
{
|
||||
None = 0x00000000, // This is a digital sensor
|
||||
NTSC_M = 0x00000001, // 75 IRE Setup
|
||||
NTSC_M_J = 0x00000002, // Japan, 0 IRE Setup
|
||||
NTSC_433 = 0x00000004,
|
||||
PAL_B = 0x00000010,
|
||||
PAL_D = 0x00000020,
|
||||
PAL_G = 0x00000040,
|
||||
PAL_H = 0x00000080,
|
||||
PAL_I = 0x00000100,
|
||||
PAL_M = 0x00000200,
|
||||
PAL_N = 0x00000400,
|
||||
PAL_60 = 0x00000800,
|
||||
SECAM_B = 0x00001000,
|
||||
SECAM_D = 0x00002000,
|
||||
SECAM_G = 0x00004000,
|
||||
SECAM_H = 0x00008000,
|
||||
SECAM_K = 0x00010000,
|
||||
SECAM_K1 = 0x00020000,
|
||||
SECAM_L = 0x00040000,
|
||||
SECAM_L1 = 0x00080000,
|
||||
PAL_N_COMBO = 0x00100000 // Argentina
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
public enum TunerInputType
|
||||
{
|
||||
Cable,
|
||||
Antenna
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("211A8766-03AC-11d1-8D13-00AA00BD8339"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IAMTVTuner
|
||||
{
|
||||
|
||||
#region "IAMTuner Methods"
|
||||
[PreserveSig]
|
||||
int put_Channel( int lChannel, AMTunerSubChannel lVideoSubChannel, AMTunerSubChannel lAudioSubChannel );
|
||||
|
||||
[PreserveSig]
|
||||
int get_Channel( out int plChannel, out int plVideoSubChannel, out int plAudioSubChannel );
|
||||
|
||||
[PreserveSig]
|
||||
int ChannelMinMax( out int lChannelMin, out int lChannelMax );
|
||||
|
||||
[PreserveSig]
|
||||
int put_CountryCode( int lCountryCode );
|
||||
|
||||
[PreserveSig]
|
||||
int get_CountryCode( out int plCountryCode );
|
||||
|
||||
[PreserveSig]
|
||||
int put_TuningSpace( int lTuningSpace );
|
||||
|
||||
[PreserveSig]
|
||||
int get_TuningSpace( out int plTuningSpace );
|
||||
|
||||
[PreserveSig]
|
||||
int Logon( IntPtr hCurrentUser );
|
||||
|
||||
[PreserveSig]
|
||||
int Logout();
|
||||
|
||||
[PreserveSig]
|
||||
int SignalPresent( out AMTunerSignalStrength plSignalStrength );
|
||||
|
||||
[PreserveSig]
|
||||
int put_Mode( AMTunerModeType lMode );
|
||||
|
||||
[PreserveSig]
|
||||
int get_Mode( out AMTunerModeType plMode );
|
||||
|
||||
[PreserveSig]
|
||||
int GetAvailableModes( out AMTunerModeType plModes );
|
||||
|
||||
[PreserveSig]
|
||||
int RegisterNotificationCallBack( IAMTunerNotification pNotify, AMTunerEventType lEvents );
|
||||
|
||||
[PreserveSig]
|
||||
int UnRegisterNotificationCallBack( IAMTunerNotification pNotify );
|
||||
#endregion
|
||||
|
||||
[PreserveSig]
|
||||
int get_AvailableTVFormats( out AnalogVideoStandard lAnalogVideoStandard );
|
||||
|
||||
[PreserveSig]
|
||||
int get_TVFormat( out AnalogVideoStandard lAnalogVideoStandard );
|
||||
|
||||
[PreserveSig]
|
||||
int AutoTune( int lChannel, out int plFoundSignal );
|
||||
|
||||
[PreserveSig]
|
||||
int StoreAutoTune();
|
||||
|
||||
[PreserveSig]
|
||||
int get_NumInputConnections( out int plNumInputConnections );
|
||||
|
||||
[PreserveSig]
|
||||
int put_InputType( int lIndex, TunerInputType inputType );
|
||||
|
||||
[PreserveSig]
|
||||
int get_InputType( int lIndex, out TunerInputType inputType );
|
||||
|
||||
[PreserveSig]
|
||||
int put_ConnectInput( int lIndex );
|
||||
|
||||
[PreserveSig]
|
||||
int get_ConnectInput( out int lIndex );
|
||||
|
||||
[PreserveSig]
|
||||
int get_VideoFrequency( out int lFreq );
|
||||
|
||||
[PreserveSig]
|
||||
int get_AudioFrequency( out int lFreq );
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("C6E13380-30AC-11d0-A18C-00A0C9118956"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IAMCrossbar
|
||||
{
|
||||
[PreserveSig]
|
||||
int get_PinCounts(
|
||||
[Out] out int OutputPinCount,
|
||||
[Out] out int InputPinCount );
|
||||
|
||||
[PreserveSig]
|
||||
int CanRoute(
|
||||
[In] int OutputPinIndex,
|
||||
[In] int InputPinIndex );
|
||||
|
||||
[PreserveSig]
|
||||
int Route(
|
||||
[In] int OutputPinIndex,
|
||||
[In] int InputPinIndex );
|
||||
|
||||
[PreserveSig]
|
||||
int get_IsRoutedTo(
|
||||
[In] int OutputPinIndex,
|
||||
[Out] out int InputPinIndex );
|
||||
|
||||
[PreserveSig]
|
||||
int get_CrossbarPinInfo(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool IsInputPin,
|
||||
[In] int PinIndex,
|
||||
[Out] out int PinIndexRelated,
|
||||
[Out] out PhysicalConnectorType PhysicalType
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("54C39221-8380-11d0-B3F0-00AA003761C5"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IAMAudioInputMixer
|
||||
{
|
||||
// This interface is only supported by the input pins, not the filter
|
||||
// If disabled, this channel will not be mixed in as part of the
|
||||
// recorded signal.
|
||||
int put_Enable (
|
||||
[In] bool fEnable); // TRUE=enable FALSE=disable
|
||||
|
||||
//Is this channel enabled?
|
||||
int get_Enable (
|
||||
[Out] out bool pfEnable);
|
||||
|
||||
// When set to mono mode, making a stereo recording of this channel
|
||||
// will have both channels contain the same data... a mixture of the
|
||||
// left and right signals
|
||||
int put_Mono (
|
||||
[In] bool fMono); // TRUE=mono FALSE=multi channel
|
||||
|
||||
//all channels combined into a mono signal?
|
||||
int get_Mono (
|
||||
[Out] out bool pfMono);
|
||||
|
||||
// !!! WILL CARDS BE ABLE TO BOOST THE GAIN?
|
||||
//Set the record level for this channel
|
||||
int put_MixLevel (
|
||||
[In] double Level); // 0 = off, 1 = full (unity?) volume
|
||||
// AMF_AUTOMATICGAIN, if supported,
|
||||
// means automatic
|
||||
|
||||
//Get the record level for this channel
|
||||
int get_MixLevel (
|
||||
[Out] out double pLevel);
|
||||
|
||||
// For instance, when panned full left, and you make a stereo recording
|
||||
// of this channel, you will record a silent right channel.
|
||||
int put_Pan (
|
||||
[In] double Pan); // -1 = full left, 0 = centre, 1 = right
|
||||
|
||||
//Get the pan for this channel
|
||||
int get_Pan (
|
||||
[Out] out double pPan);
|
||||
|
||||
// Boosts the bass of low volume signals before they are recorded
|
||||
// to compensate for the fact that your ear has trouble hearing quiet
|
||||
// bass sounds
|
||||
int put_Loudness (
|
||||
[In] bool fLoudness);// TRUE=on FALSE=off
|
||||
|
||||
int get_Loudness (
|
||||
[Out] out bool pfLoudness);
|
||||
|
||||
// boosts or cuts the treble of the signal before it's recorded by
|
||||
// a certain amount of dB
|
||||
int put_Treble (
|
||||
[In] double Treble); // gain in dB (-ve = attenuate)
|
||||
|
||||
//Get the treble EQ for this channel
|
||||
int get_Treble (
|
||||
[Out] out double pTreble);
|
||||
|
||||
// This is the maximum value allowed in put_Treble. ie 6.0 means
|
||||
// any value between -6.0 and 6.0 is allowed
|
||||
int get_TrebleRange (
|
||||
[Out] out double pRange); // largest value allowed
|
||||
|
||||
// boosts or cuts the bass of the signal before it's recorded by
|
||||
// a certain amount of dB
|
||||
int put_Bass (
|
||||
[In] double Bass); // gain in dB (-ve = attenuate)
|
||||
|
||||
// Get the bass EQ for this channel
|
||||
int get_Bass (
|
||||
[Out] out double pBass);
|
||||
|
||||
// This is the maximum value allowed in put_Bass. ie 6.0 means
|
||||
// any value between -6.0 and 6.0 is allowed
|
||||
int get_BassRange (
|
||||
[Out] out double pRange); // largest value allowed
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
public enum VfwCompressDialogs
|
||||
{
|
||||
Config = 0x01,
|
||||
About = 0x02,
|
||||
QueryConfig = 0x04,
|
||||
QueryAbout = 0x08
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("D8D715A3-6E5E-11D0-B3F0-00AA003761C5"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IAMVfwCompressDialogs
|
||||
{
|
||||
[PreserveSig]
|
||||
// Bring up a dialog for this codec
|
||||
int ShowDialog(
|
||||
[In] VfwCompressDialogs iDialog,
|
||||
[In] IntPtr hwnd );
|
||||
|
||||
// Calls ICGetState and gives you the result
|
||||
int GetState(
|
||||
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] byte[] pState,
|
||||
ref int pcbState );
|
||||
|
||||
// Calls ICSetState
|
||||
int SetState(
|
||||
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] byte[] pState,
|
||||
[In] int cbState );
|
||||
|
||||
// Send a codec specific message
|
||||
int SendDriverMessage(
|
||||
int uMsg,
|
||||
long dw1,
|
||||
long dw2 );
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class VideoStreamConfigCaps // VIDEO_STREAM_CONFIG_CAPS
|
||||
{
|
||||
public Guid Guid;
|
||||
public AnalogVideoStandard VideoStandard;
|
||||
public Size InputSize;
|
||||
public Size MinCroppingSize;
|
||||
public Size MaxCroppingSize;
|
||||
public int CropGranularityX;
|
||||
public int CropGranularityY;
|
||||
public int CropAlignX;
|
||||
public int CropAlignY;
|
||||
public Size MinOutputSize;
|
||||
public Size MaxOutputSize;
|
||||
public int OutputGranularityX;
|
||||
public int OutputGranularityY;
|
||||
public int StretchTapsX;
|
||||
public int StretchTapsY;
|
||||
public int ShrinkTapsX;
|
||||
public int ShrinkTapsY;
|
||||
public long MinFrameInterval;
|
||||
public long MaxFrameInterval;
|
||||
public int MinBitsPerSecond;
|
||||
public int MaxBitsPerSecond;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class AudioStreamConfigCaps // AUDIO_STREAM_CONFIG_CAPS
|
||||
{
|
||||
public Guid Guid;
|
||||
public int MinimumChannels;
|
||||
public int MaximumChannels;
|
||||
public int ChannelsGranularity;
|
||||
public int MinimumBitsPerSample;
|
||||
public int MaximumBitsPerSample;
|
||||
public int BitsPerSampleGranularity;
|
||||
public int MinimumSampleFrequency;
|
||||
public int MaximumSampleFrequency;
|
||||
public int SampleFrequencyGranularity;
|
||||
}
|
||||
|
||||
|
||||
} // namespace DShowNET
|
||||
@@ -0,0 +1,342 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// DsUtils
|
||||
// DirectShow utility classes, partial from the SDK Common sources
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
|
||||
[ComVisible(false)]
|
||||
public class DsUtils
|
||||
{
|
||||
|
||||
public static bool IsCorrectDirectXVersion()
|
||||
{
|
||||
return File.Exists( Path.Combine( Environment.SystemDirectory, @"dpnhpast.dll" ) );
|
||||
}
|
||||
|
||||
|
||||
public static bool ShowCapPinDialog( ICaptureGraphBuilder2 bld, IBaseFilter flt, IntPtr hwnd )
|
||||
{
|
||||
int hr;
|
||||
object comObj = null;
|
||||
ISpecifyPropertyPages spec = null;
|
||||
DsCAUUID cauuid = new DsCAUUID();
|
||||
|
||||
try {
|
||||
Guid cat = PinCategory.Capture;
|
||||
Guid type = MediaType.Interleaved;
|
||||
Guid iid = typeof(IAMStreamConfig).GUID;
|
||||
hr = bld.FindInterface( ref cat, ref type, flt, ref iid, out comObj );
|
||||
if( hr != 0 )
|
||||
{
|
||||
type = MediaType.Video;
|
||||
hr = bld.FindInterface( ref cat, ref type, flt, ref iid, out comObj );
|
||||
if( hr != 0 )
|
||||
return false;
|
||||
}
|
||||
spec = comObj as ISpecifyPropertyPages;
|
||||
if( spec == null )
|
||||
return false;
|
||||
|
||||
hr = spec.GetPages( out cauuid );
|
||||
hr = OleCreatePropertyFrame( hwnd, 30, 30, null, 1,
|
||||
ref comObj, cauuid.cElems, cauuid.pElems, 0, 0, IntPtr.Zero );
|
||||
return true;
|
||||
}
|
||||
catch( Exception ee )
|
||||
{
|
||||
Trace.WriteLine( "!Ds.NET: ShowCapPinDialog " + ee.Message );
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if( cauuid.pElems != IntPtr.Zero )
|
||||
Marshal.FreeCoTaskMem( cauuid.pElems );
|
||||
|
||||
spec = null;
|
||||
if( comObj != null )
|
||||
Marshal.ReleaseComObject( comObj ); comObj = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ShowTunerPinDialog( ICaptureGraphBuilder2 bld, IBaseFilter flt, IntPtr hwnd )
|
||||
{
|
||||
int hr;
|
||||
object comObj = null;
|
||||
ISpecifyPropertyPages spec = null;
|
||||
DsCAUUID cauuid = new DsCAUUID();
|
||||
|
||||
try {
|
||||
Guid cat = PinCategory.Capture;
|
||||
Guid type = MediaType.Interleaved;
|
||||
Guid iid = typeof(IAMTVTuner).GUID;
|
||||
hr = bld.FindInterface( ref cat, ref type, flt, ref iid, out comObj );
|
||||
if( hr != 0 )
|
||||
{
|
||||
type = MediaType.Video;
|
||||
hr = bld.FindInterface( ref cat, ref type, flt, ref iid, out comObj );
|
||||
if( hr != 0 )
|
||||
return false;
|
||||
}
|
||||
spec = comObj as ISpecifyPropertyPages;
|
||||
if( spec == null )
|
||||
return false;
|
||||
|
||||
hr = spec.GetPages( out cauuid );
|
||||
hr = OleCreatePropertyFrame( hwnd, 30, 30, null, 1,
|
||||
ref comObj, cauuid.cElems, cauuid.pElems, 0, 0, IntPtr.Zero );
|
||||
return true;
|
||||
}
|
||||
catch( Exception ee )
|
||||
{
|
||||
Trace.WriteLine( "!Ds.NET: ShowCapPinDialog " + ee.Message );
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if( cauuid.pElems != IntPtr.Zero )
|
||||
Marshal.FreeCoTaskMem( cauuid.pElems );
|
||||
|
||||
spec = null;
|
||||
if( comObj != null )
|
||||
Marshal.ReleaseComObject( comObj ); comObj = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// from 'DShowUtil.cpp'
|
||||
public int GetPin( IBaseFilter filter, PinDirection dirrequired, int num, out IPin ppPin )
|
||||
{
|
||||
ppPin = null;
|
||||
int hr;
|
||||
IEnumPins pinEnum;
|
||||
hr = filter.EnumPins( out pinEnum );
|
||||
if( (hr < 0) || (pinEnum == null) )
|
||||
return hr;
|
||||
|
||||
IPin[] pins = new IPin[1];
|
||||
int f;
|
||||
PinDirection dir;
|
||||
do
|
||||
{
|
||||
hr = pinEnum.Next( 1, pins, out f );
|
||||
if( (hr != 0) || (pins[0] == null) )
|
||||
break;
|
||||
dir = (PinDirection) 3;
|
||||
hr = pins[0].QueryDirection( out dir );
|
||||
if( (hr == 0) && (dir == dirrequired) )
|
||||
{
|
||||
if( num == 0 )
|
||||
{
|
||||
ppPin = pins[0];
|
||||
pins[0] = null;
|
||||
break;
|
||||
}
|
||||
num--;
|
||||
}
|
||||
Marshal.ReleaseComObject( pins[0] ); pins[0] = null;
|
||||
}
|
||||
while( hr == 0 );
|
||||
|
||||
Marshal.ReleaseComObject( pinEnum ); pinEnum = null;
|
||||
return hr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Free the nested structures and release any
|
||||
/// COM objects within an AMMediaType struct.
|
||||
/// </summary>
|
||||
public static void FreeAMMediaType(AMMediaType mediaType)
|
||||
{
|
||||
if ( mediaType.formatSize != 0 )
|
||||
Marshal.FreeCoTaskMem( mediaType.formatPtr );
|
||||
if ( mediaType.unkPtr != IntPtr.Zero )
|
||||
Marshal.Release( mediaType.unkPtr );
|
||||
mediaType.formatSize = 0;
|
||||
mediaType.formatPtr = IntPtr.Zero;
|
||||
mediaType.unkPtr = IntPtr.Zero;
|
||||
}
|
||||
|
||||
[DllImport("olepro32.dll", CharSet=CharSet.Unicode, ExactSpelling=true) ]
|
||||
private static extern int OleCreatePropertyFrame( IntPtr hwndOwner, int x, int y,
|
||||
string lpszCaption, int cObjects,
|
||||
[In, MarshalAs(UnmanagedType.Interface)] ref object ppUnk,
|
||||
int cPages, IntPtr pPageClsID, int lcid, int dwReserved, IntPtr pvReserved );
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public struct DsPOINT // POINT
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public struct DsRECT // RECT
|
||||
{
|
||||
public int Left;
|
||||
public int Top;
|
||||
public int Right;
|
||||
public int Bottom;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack=2), ComVisible(false)]
|
||||
public struct BitmapInfoHeader
|
||||
{
|
||||
public int Size;
|
||||
public int Width;
|
||||
public int Height;
|
||||
public short Planes;
|
||||
public short BitCount;
|
||||
public int Compression;
|
||||
public int ImageSize;
|
||||
public int XPelsPerMeter;
|
||||
public int YPelsPerMeter;
|
||||
public int ClrUsed;
|
||||
public int ClrImportant;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
[ComVisible(false)]
|
||||
public class DsROT
|
||||
{
|
||||
public static bool AddGraphToRot( object graph, out int cookie )
|
||||
{
|
||||
cookie = 0;
|
||||
int hr = 0;
|
||||
UCOMIRunningObjectTable rot = null;
|
||||
UCOMIMoniker mk = null;
|
||||
try {
|
||||
hr = GetRunningObjectTable( 0, out rot );
|
||||
if( hr < 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
int id = GetCurrentProcessId();
|
||||
IntPtr iuPtr = Marshal.GetIUnknownForObject( graph );
|
||||
int iuInt = (int) iuPtr;
|
||||
Marshal.Release( iuPtr );
|
||||
string item = string.Format( "FilterGraph {0} pid {1}", iuInt.ToString("x8"), id.ToString("x8") );
|
||||
hr = CreateItemMoniker( "!", item, out mk );
|
||||
if( hr < 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
rot.Register( ROTFLAGS_REGISTRATIONKEEPSALIVE, graph, mk, out cookie );
|
||||
return true;
|
||||
}
|
||||
catch( Exception )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if( mk != null )
|
||||
Marshal.ReleaseComObject( mk ); mk = null;
|
||||
if( rot != null )
|
||||
Marshal.ReleaseComObject( rot ); rot = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool RemoveGraphFromRot( ref int cookie )
|
||||
{
|
||||
UCOMIRunningObjectTable rot = null;
|
||||
try {
|
||||
int hr = GetRunningObjectTable( 0, out rot );
|
||||
if( hr < 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
rot.Revoke( cookie );
|
||||
cookie = 0;
|
||||
return true;
|
||||
}
|
||||
catch( Exception )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if( rot != null )
|
||||
Marshal.ReleaseComObject( rot ); rot = null;
|
||||
}
|
||||
}
|
||||
|
||||
private const int ROTFLAGS_REGISTRATIONKEEPSALIVE = 1;
|
||||
|
||||
[DllImport("ole32.dll", ExactSpelling=true) ]
|
||||
private static extern int GetRunningObjectTable( int r,
|
||||
out UCOMIRunningObjectTable pprot );
|
||||
|
||||
[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true) ]
|
||||
private static extern int CreateItemMoniker( string delim,
|
||||
string item, out UCOMIMoniker ppmk );
|
||||
|
||||
[DllImport("kernel32.dll", ExactSpelling=true) ]
|
||||
private static extern int GetCurrentProcessId();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------- ocidl.idl ------------------------------------------------
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("B196B28B-BAB4-101A-B69C-00AA00341D07"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface ISpecifyPropertyPages
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetPages( out DsCAUUID pPages );
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public struct DsCAUUID // CAUUID
|
||||
{
|
||||
public int cElems;
|
||||
public IntPtr pElems;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class DsOptInt64
|
||||
{
|
||||
public DsOptInt64( long Value )
|
||||
{
|
||||
this.Value = Value;
|
||||
}
|
||||
public long Value;
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class DsOptIntPtr
|
||||
{
|
||||
public IntPtr Pointer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace DShowNET
|
||||
@@ -0,0 +1,190 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// UUIDs from uuids.h
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
|
||||
|
||||
[ComVisible(false)]
|
||||
public class FilterCategory // uuids.h : CLSID_*
|
||||
{
|
||||
/// <summary> CLSID_AudioInputDeviceCategory, audio capture category </summary>
|
||||
public static readonly Guid AudioInputDevice = new Guid( 0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x00,0xa0,0xc9,0x11,0xce,0x86 );
|
||||
|
||||
/// <summary> CLSID_VideoInputDeviceCategory, video capture category </summary>
|
||||
public static readonly Guid VideoInputDevice = new Guid( 0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86 );
|
||||
|
||||
/// <summary> CLSID_VideoCompressorCategory, video compressor category </summary>
|
||||
public static readonly Guid VideoCompressorCategory = new Guid( 0x33d9a760, 0x90c8, 0x11d0, 0xbd, 0x43, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86 );
|
||||
|
||||
/// <summary> CLSID_AudioCompressorCategory, audio compressor category </summary>
|
||||
public static readonly Guid AudioCompressorCategory = new Guid( 0x33d9a761, 0x90c8, 0x11d0, 0xbd, 0x43, 0x0, 0xa0, 0xc9, 0x11, 0xce, 0x86 );
|
||||
|
||||
/// <summary> CLSID_LegacyAmFilterCategory, legacy filters </summary>
|
||||
public static readonly Guid LegacyAmFilterCategory = new Guid( 0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86 );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ComVisible(false)]
|
||||
public class Clsid // uuids.h : CLSID_*
|
||||
{
|
||||
/// <summary> CLSID_SystemDeviceEnum for ICreateDevEnum </summary>
|
||||
public static readonly Guid SystemDeviceEnum = new Guid( 0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86 );
|
||||
|
||||
/// <summary> CLSID_FilterGraph, filter Graph </summary>
|
||||
public static readonly Guid FilterGraph = new Guid( 0xe436ebb3, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
/// <summary> CLSID_CaptureGraphBuilder2, new Capture graph building </summary>
|
||||
public static readonly Guid CaptureGraphBuilder2 = new Guid( 0xBF87B6E1, 0x8C27, 0x11d0, 0xB3, 0xF0, 0x0, 0xAA, 0x00, 0x37, 0x61, 0xC5 );
|
||||
|
||||
/// <summary> CLSID_SampleGrabber, Sample Grabber filter </summary>
|
||||
public static readonly Guid SampleGrabber = new Guid( 0xC1F400A0, 0x3F08, 0x11D3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 );
|
||||
|
||||
/// <summary> CLSID_DvdGraphBuilder, DVD graph builder </summary>
|
||||
public static readonly Guid DvdGraphBuilder = new Guid( 0xFCC152B7, 0xF372, 0x11d0, 0x8E, 0x00, 0x00, 0xC0, 0x4F, 0xD7, 0xC0, 0x8B );
|
||||
|
||||
/// <summary> CLSID_StreamBufferSink, stream buffer sink </summary>
|
||||
public static readonly Guid StreamBufferSink = new Guid( "2db47ae5-cf39-43c2-b4d6-0cd8d90946f4" );
|
||||
|
||||
/// <summary> CLSID_StreamBufferSource, stream buffer sink </summary>
|
||||
public static readonly Guid StreamBufferSource = new Guid( "c9f5fe02-f851-4eb5-99ee-ad602af1e619" );
|
||||
|
||||
/// <summary> CLSID_VideoMixingRenderer, video mixing renderer 7 </summary>
|
||||
public static readonly Guid VideoMixingRenderer = new Guid( 0xB87BEB7B, 0x8D29, 0x423f, 0xAE, 0x4D, 0x65, 0x82, 0xC1, 0x01, 0x75, 0xAC );
|
||||
|
||||
/// <summary> CLSID_VideoMixingRenderer9, video mixing renderer 9 </summary>
|
||||
public static readonly Guid VideoMixingRenderer9 = new Guid( 0x51b4abf3, 0x748f, 0x4e3b, 0xa2, 0x76, 0xc8, 0x28, 0x33, 0x0e, 0x92, 0x6a );
|
||||
|
||||
/// <summary> CLSID_VideoRendererDefault, default vmr renderer </summary>
|
||||
public static readonly Guid VideoRendererDefault = new Guid( 0x6BC1CFFA, 0x8FC1, 0x4261, 0xAC, 0x22, 0xCF, 0xB4, 0xCC, 0x38, 0xDB, 0x50 );
|
||||
|
||||
/// <summary> CLSID_AviSplitter, split an AVI stream into separate video and audio streams </summary>
|
||||
public static readonly Guid AviSplitter = new Guid( 0x1b544c20, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x0, 0xaa, 0x00, 0x44, 0xb5, 0x1e );
|
||||
|
||||
/// <summary> CLSID_SmartTee, create a preview stream when device only provides a capture stream. </summary>
|
||||
public static readonly Guid SmartTee = new Guid( 0xcc58e280, 0x8aa1, 0x11d1, 0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5 );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ComVisible(false)]
|
||||
public class MediaType // MEDIATYPE_*
|
||||
{
|
||||
/// <summary> MEDIATYPE_Video 'vids' </summary>
|
||||
public static readonly Guid Video = new Guid( 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
|
||||
|
||||
/// <summary> MEDIATYPE_Interleaved 'iavs' </summary>
|
||||
public static readonly Guid Interleaved = new Guid( 0x73766169, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
|
||||
|
||||
/// <summary> MEDIATYPE_Audio 'auds' </summary>
|
||||
public static readonly Guid Audio = new Guid( 0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
|
||||
|
||||
/// <summary> MEDIATYPE_Text 'txts' </summary>
|
||||
public static readonly Guid Text = new Guid( 0x73747874, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
|
||||
|
||||
/// <summary> MEDIATYPE_Stream </summary>
|
||||
public static readonly Guid Stream = new Guid( 0xe436eb83, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
public class MediaSubType // MEDIASUBTYPE_*
|
||||
{
|
||||
/// <summary> MEDIASUBTYPE_YUYV 'YUYV' </summary>
|
||||
public static readonly Guid YUYV = new Guid( 0x56595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_IYUV 'IYUV' </summary>
|
||||
public static readonly Guid IYUV = new Guid( 0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_DVSD 'DVSD' </summary>
|
||||
public static readonly Guid DVSD = new Guid( 0x44535644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_RGB1 'RGB1' </summary>
|
||||
public static readonly Guid RGB1 = new Guid( 0xe436eb78, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_RGB4 'RGB4' </summary>
|
||||
public static readonly Guid RGB4 = new Guid( 0xe436eb79, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_RGB8 'RGB8' </summary>
|
||||
public static readonly Guid RGB8 = new Guid( 0xe436eb7a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_RGB565 'RGB565' </summary>
|
||||
public static readonly Guid RGB565 = new Guid( 0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_RGB555 'RGB555' </summary>
|
||||
public static readonly Guid RGB555 = new Guid( 0xe436eb7c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_RGB24 'RGB24' </summary>
|
||||
public static readonly Guid RGB24 = new Guid( 0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_RGB32 'RGB32' </summary>
|
||||
public static readonly Guid RGB32 = new Guid( 0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
|
||||
/// <summary> MEDIASUBTYPE_Avi </summary>
|
||||
public static readonly Guid Avi = new Guid( 0xe436eb88, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
|
||||
|
||||
/// <summary> MEDIASUBTYPE_Asf </summary>
|
||||
public static readonly Guid Asf = new Guid( 0x3db80f90, 0x9412, 0x11d1, 0xad, 0xed, 0x0, 0x0, 0xf8, 0x75, 0x4b, 0x99 );
|
||||
}
|
||||
|
||||
|
||||
[ComVisible(false)]
|
||||
public class FormatType // FORMAT_*
|
||||
{
|
||||
/// <summary> FORMAT_None </summary>
|
||||
public static readonly Guid None = new Guid( 0x0F6417D6, 0xc318, 0x11d0, 0xa4, 0x3f, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 );
|
||||
|
||||
/// <summary> FORMAT_VideoInfo </summary>
|
||||
public static readonly Guid VideoInfo = new Guid( 0x05589f80, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a );
|
||||
|
||||
/// <summary> FORMAT_VideoInfo2 </summary>
|
||||
public static readonly Guid VideoInfo2 = new Guid( 0xf72a76A0, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba );
|
||||
|
||||
/// <summary> FORMAT_WaveFormatEx </summary>
|
||||
public static readonly Guid WaveEx = new Guid( 0x05589f81, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a );
|
||||
|
||||
/// <summary> FORMAT_MPEGVideo </summary>
|
||||
public static readonly Guid MpegVideo = new Guid( 0x05589f82, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a );
|
||||
|
||||
/// <summary> FORMAT_MPEGStreams </summary>
|
||||
public static readonly Guid MpegStreams = new Guid( 0x05589f83, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a );
|
||||
|
||||
/// <summary> FORMAT_DvInfo </summary>
|
||||
public static readonly Guid DvInfo = new Guid( 0x05589f84, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[ComVisible(false)]
|
||||
public class PinCategory // PIN_CATEGORY_*
|
||||
{
|
||||
/// <summary> PIN_CATEGORY_CAPTURE </summary>
|
||||
public static readonly Guid Capture = new Guid( 0xfb6c4281, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba );
|
||||
|
||||
/// <summary> PIN_CATEGORY_PREVIEW </summary>
|
||||
public static readonly Guid Preview = new Guid( 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba );
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
public class FindDirection
|
||||
{
|
||||
/// <summary> LOOK_UPSTREAM_ONLY </summary>
|
||||
public static readonly Guid UpstreamOnly = new Guid( 0xac798be0, 0x98e3, 0x11d1, 0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5 );
|
||||
|
||||
/// <summary> LOOK_DOWNSTREAM_ONLY </summary>
|
||||
public static readonly Guid DownstreamOnly = new Guid( 0xac798be1, 0x98e3, 0x11d1, 0xb3, 0xf1, 0x0, 0xaa, 0x0, 0x37, 0x61, 0xc5 );
|
||||
}
|
||||
|
||||
|
||||
} // namespace DShowNET
|
||||
@@ -0,0 +1,158 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
brian.low@shaw.ca
|
||||
*******************************************************/
|
||||
// DsVmRender
|
||||
// Video Mixer Renderer, ported from VmRender.idl
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
[ComVisible(false)]
|
||||
public enum VMRMode : uint
|
||||
{
|
||||
Windowed = 0x00000001,
|
||||
Windowless = 0x00000002,
|
||||
Renderless = 0x00000004,
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public struct RECT
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
}
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("0eb1088c-4dcd-46f0-878f-39dae86a51b7"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IVMRWindowlessControl
|
||||
{
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// Video size and position information
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int GetNativeVideoSize(
|
||||
[Out] out int lpWidth,
|
||||
[Out] out int lpHeight,
|
||||
[Out] out int lpARWidth,
|
||||
[Out] out int lpARHeight
|
||||
);
|
||||
|
||||
int GetMinIdealVideoSize(
|
||||
[Out] out int lpHeight
|
||||
);
|
||||
|
||||
int GetMaxIdealVideoSize(
|
||||
[Out] out int lpWidth,
|
||||
[Out] out int lpHeight
|
||||
);
|
||||
|
||||
int SetVideoPosition(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] RECT lpSRCRect,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] RECT lpDSTRect
|
||||
);
|
||||
|
||||
int GetVideoPosition(
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)] out RECT lpSRCRect,
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)] out RECT lpDSTRect
|
||||
);
|
||||
|
||||
int GetAspectRatioMode( [Out] out uint lpAspectRatioMode );
|
||||
|
||||
int SetAspectRatioMode( [In] uint AspectRatioMode );
|
||||
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// Display and clipping management
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int SetVideoClippingWindow( [In] IntPtr hwnd );
|
||||
|
||||
int RepaintVideo(
|
||||
[In] IntPtr hwnd,
|
||||
[In] IntPtr hdc
|
||||
);
|
||||
|
||||
int DisplayModeChanged();
|
||||
|
||||
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// GetCurrentImage
|
||||
//
|
||||
// Returns the current image being displayed. This images
|
||||
// is returned in the form of packed Windows DIB.
|
||||
//
|
||||
// GetCurrentImage can be called at any time, also
|
||||
// the caller is responsible for free the returned memory
|
||||
// by calling CoTaskMemFree.
|
||||
//
|
||||
// Excessive use of this function will degrade video
|
||||
// playback performed.
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int GetCurrentImage( [Out] out IntPtr lpDib );
|
||||
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// Border Color control
|
||||
//
|
||||
// The border color is color used to fill any area of the
|
||||
// the destination rectangle that does not contain video.
|
||||
// It is typically used in two instances. When the video
|
||||
// straddles two monitors and when the VMR is trying
|
||||
// to maintain the aspect ratio of the movies by letter
|
||||
// boxing the video to fit within the specified destination
|
||||
// rectangle. See SetAspectRatioMode above.
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int SetBorderColor( [In] uint Clr );
|
||||
|
||||
int GetBorderColor( [Out] out uint lpClr );
|
||||
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// Color key control only meaningful when the VMR is using
|
||||
// and overlay
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int SetColorKey( [In] uint Clr );
|
||||
|
||||
int GetColorKey( [Out] out uint lpClr );
|
||||
|
||||
}
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("9e5530c5-7034-48b4-bb46-0b8a6efc8e36"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IVMRFilterConfig
|
||||
{
|
||||
[PreserveSig]
|
||||
int SetImageCompositor( [In] IntPtr lpVMRImgCompositor );
|
||||
|
||||
[PreserveSig]
|
||||
int SetNumberOfStreams( [In] uint dwMaxStreams );
|
||||
|
||||
[PreserveSig]
|
||||
int GetNumberOfStreams( [Out] out uint pdwMaxStreams );
|
||||
|
||||
[PreserveSig]
|
||||
int SetRenderingPrefs( [In] uint dwRenderFlags );
|
||||
|
||||
[PreserveSig]
|
||||
int GetRenderingPrefs( [Out] out uint pdwRenderFlags );
|
||||
|
||||
[PreserveSig]
|
||||
int SetRenderingMode( [In] uint Mode );
|
||||
|
||||
[PreserveSig]
|
||||
int GetRenderingMode( [Out] out VMRMode Mode );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
brian.low@shaw.ca
|
||||
*******************************************************/
|
||||
// DsVmr9.cs
|
||||
// Video Mixer Renderer 9, ported from Vmr9.idl
|
||||
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
|
||||
[ComVisible(false)]
|
||||
public enum VMRMode9 : uint
|
||||
{
|
||||
Windowed = 0x00000001,
|
||||
Windowless = 0x00000002,
|
||||
Renderless = 0x00000004,
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
public enum VMR9AspectRatioMode : uint
|
||||
{
|
||||
None,
|
||||
LetterBox,
|
||||
}
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("5a804648-4f66-4867-9c43-4f5c822cf1b8"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IVMRFilterConfig9
|
||||
{
|
||||
[PreserveSig]
|
||||
int SetImageCompositor( [In] IntPtr lpVMRImgCompositor );
|
||||
|
||||
[PreserveSig]
|
||||
int SetNumberOfStreams( [In] uint dwMaxStreams );
|
||||
|
||||
[PreserveSig]
|
||||
int GetNumberOfStreams( [Out] out uint pdwMaxStreams );
|
||||
|
||||
[PreserveSig]
|
||||
int SetRenderingPrefs( [In] uint dwRenderFlags );
|
||||
|
||||
[PreserveSig]
|
||||
int GetRenderingPrefs( [Out] out uint pdwRenderFlags );
|
||||
|
||||
[PreserveSig]
|
||||
int SetRenderingMode( [In] VMRMode9 Mode );
|
||||
|
||||
[PreserveSig]
|
||||
int GetRenderingMode( [Out] out VMRMode9 Mode );
|
||||
}
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("8f537d09-f85e-4414-b23b-502e54c79927"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface IVMRWindowlessControl9
|
||||
{
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// Video size and position information
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int GetNativeVideoSize(
|
||||
[Out] out int lpWidth,
|
||||
[Out] out int lpHeight,
|
||||
[Out] out int lpARWidth,
|
||||
[Out] out int lpARHeight
|
||||
);
|
||||
|
||||
int GetMinIdealVideoSize(
|
||||
[Out] out int lpHeight
|
||||
);
|
||||
|
||||
int GetMaxIdealVideoSize(
|
||||
[Out] out int lpWidth,
|
||||
[Out] out int lpHeight
|
||||
);
|
||||
|
||||
int SetVideoPosition(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] RECT lpSRCRect,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] RECT lpDSTRect
|
||||
);
|
||||
|
||||
int GetVideoPosition(
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)] out RECT lpSRCRect,
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)] out RECT lpDSTRect
|
||||
);
|
||||
|
||||
int GetAspectRatioMode( [Out] out VMR9AspectRatioMode lpAspectRatioMode );
|
||||
|
||||
int SetAspectRatioMode( [In] VMR9AspectRatioMode AspectRatioMode );
|
||||
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// Display and clipping management
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int SetVideoClippingWindow( [In] IntPtr hwnd );
|
||||
|
||||
int RepaintVideo(
|
||||
[In] IntPtr hwnd,
|
||||
[In] IntPtr hdc
|
||||
);
|
||||
|
||||
int DisplayModeChanged();
|
||||
|
||||
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// GetCurrentImage
|
||||
//
|
||||
// Returns the current image being displayed. This images
|
||||
// is returned in the form of packed Windows DIB.
|
||||
//
|
||||
// GetCurrentImage can be called at any time, also
|
||||
// the caller is responsible for free the returned memory
|
||||
// by calling CoTaskMemFree.
|
||||
//
|
||||
// Excessive use of this function will degrade video
|
||||
// playback performed.
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int GetCurrentImage( [Out] out IntPtr lpDib );
|
||||
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
// Border Color control
|
||||
//
|
||||
// The border color is color used to fill any area of the
|
||||
// the destination rectangle that does not contain video.
|
||||
// It is typically used in two instances. When the video
|
||||
// straddles two monitors and when the VMR is trying
|
||||
// to maintain the aspect ratio of the movies by letter
|
||||
// boxing the video to fit within the specified destination
|
||||
// rectangle. See SetAspectRatioMode above.
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
int SetBorderColor( [In] uint Clr );
|
||||
|
||||
int GetBorderColor( [Out] out uint lpClr );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
/******************************************************
|
||||
DirectShow .NET
|
||||
netmaster@swissonline.ch
|
||||
*******************************************************/
|
||||
// QEdit
|
||||
// Extended streaming interfaces, ported from qedit.idl
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DShowNET
|
||||
{
|
||||
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("6B652FFF-11FE-4fce-92AD-0266B5D7C78F"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface ISampleGrabber
|
||||
{
|
||||
[PreserveSig]
|
||||
int SetOneShot(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool OneShot );
|
||||
|
||||
[PreserveSig]
|
||||
int SetMediaType(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int GetConnectedMediaType(
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt );
|
||||
|
||||
[PreserveSig]
|
||||
int SetBufferSamples(
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool BufferThem );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentBuffer( ref int pBufferSize, IntPtr pBuffer );
|
||||
|
||||
[PreserveSig]
|
||||
int GetCurrentSample( IntPtr ppSample );
|
||||
|
||||
[PreserveSig]
|
||||
int SetCallback( ISampleGrabberCB pCallback, int WhichMethodToCallback );
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("0579154A-2B53-4994-B0D0-E773148EFF85"),
|
||||
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
|
||||
public interface ISampleGrabberCB
|
||||
{
|
||||
[PreserveSig]
|
||||
int SampleCB( double SampleTime, IMediaSample pSample );
|
||||
|
||||
[PreserveSig]
|
||||
int BufferCB( double SampleTime, IntPtr pBuffer, int BufferLen );
|
||||
}
|
||||
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class VideoInfoHeader // VIDEOINFOHEADER
|
||||
{
|
||||
public DsRECT SrcRect;
|
||||
public DsRECT TargetRect;
|
||||
public int BitRate;
|
||||
public int BitErrorRate;
|
||||
public long AvgTimePerFrame;
|
||||
public BitmapInfoHeader BmiHeader;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class VideoInfoHeader2 // VIDEOINFOHEADER2
|
||||
{
|
||||
public DsRECT SrcRect;
|
||||
public DsRECT TargetRect;
|
||||
public int BitRate;
|
||||
public int BitErrorRate;
|
||||
public long AvgTimePerFrame;
|
||||
public int InterlaceFlags;
|
||||
public int CopyProtectFlags;
|
||||
public int PictAspectRatioX;
|
||||
public int PictAspectRatioY;
|
||||
public int ControlFlags;
|
||||
public int Reserved2;
|
||||
public BitmapInfoHeader BmiHeader;
|
||||
};
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
public class WaveFormatEx
|
||||
{
|
||||
public short wFormatTag;
|
||||
public short nChannels;
|
||||
public int nSamplesPerSec;
|
||||
public int nAvgBytesPerSec;
|
||||
public short nBlockAlign;
|
||||
public short wBitsPerSample;
|
||||
public short cbSize;
|
||||
}
|
||||
|
||||
} // namespace DShowNET
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DShowNET\bin\Debug\DShowNET.dll
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DShowNET\bin\Debug\DShowNET.pdb
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DShowNET\obj\Debug\ResolveAssemblyReference.cache
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DShowNET\obj\Debug\DShowNET.dll
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DShowNET\obj\Debug\DShowNET.pdb
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DShowNET\bin\Debug\DShowNET.dll
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DShowNET\bin\Debug\DShowNET.pdb
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DShowNET\obj\Debug\ResolveAssemblyReference.cache
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DShowNET\obj\Debug\DShowNET.dll
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DShowNET\obj\Debug\DShowNET.pdb
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DShowNET\bin\Release\DShowNET.dll
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DShowNET\obj\Release\ResolveAssemblyReference.cache
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DShowNET\obj\Release\DShowNET.dll
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,58 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("DirectX.Capture")]
|
||||
[assembly: AssemblyDescription("Capture Library")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("Copyright 2003 Brian Low")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
@@ -0,0 +1,113 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Capabilities of the audio device such as
|
||||
/// min/max sampling rate and number of channels available.
|
||||
/// </summary>
|
||||
public class AudioCapabilities
|
||||
{
|
||||
|
||||
// ------------------ Properties --------------------
|
||||
|
||||
/// <summary> Minimum number of audio channels. </summary>
|
||||
public int MinimumChannels;
|
||||
|
||||
/// <summary> Maximum number of audio channels. </summary>
|
||||
public int MaximumChannels;
|
||||
|
||||
/// <summary> Granularity of the channels. For example, channels 2 through 4, in steps of 2. </summary>
|
||||
public int ChannelsGranularity;
|
||||
|
||||
/// <summary> Minimum number of bits per sample. </summary>
|
||||
public int MinimumSampleSize;
|
||||
|
||||
/// <summary> Maximum number of bits per sample. </summary>
|
||||
public int MaximumSampleSize;
|
||||
|
||||
/// <summary> Granularity of the bits per sample. For example, 8 bits per sample through 32 bits per sample, in steps of 8. </summary>
|
||||
public int SampleSizeGranularity;
|
||||
|
||||
/// <summary> Minimum sample frequency. </summary>
|
||||
public int MinimumSamplingRate;
|
||||
|
||||
/// <summary> Maximum sample frequency. </summary>
|
||||
public int MaximumSamplingRate;
|
||||
|
||||
/// <summary> Granularity of the frequency. For example, 11025 Hz to 44100 Hz, in steps of 11025 Hz. </summary>
|
||||
public int SamplingRateGranularity;
|
||||
|
||||
|
||||
|
||||
// ----------------- Constructor ---------------------
|
||||
|
||||
/// <summary> Retrieve capabilities of an audio device </summary>
|
||||
internal AudioCapabilities(IAMStreamConfig audioStreamConfig)
|
||||
{
|
||||
if ( audioStreamConfig == null )
|
||||
throw new ArgumentNullException( "audioStreamConfig" );
|
||||
|
||||
AMMediaType mediaType = null;
|
||||
AudioStreamConfigCaps caps = null;
|
||||
IntPtr pCaps = IntPtr.Zero;
|
||||
IntPtr pMediaType;
|
||||
try
|
||||
{
|
||||
// Ensure this device reports capabilities
|
||||
int c, size;
|
||||
int hr = audioStreamConfig.GetNumberOfCapabilities( out c, out size );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
if ( c <= 0 )
|
||||
throw new NotSupportedException( "This audio device does not report capabilities." );
|
||||
if ( size > Marshal.SizeOf( typeof( AudioStreamConfigCaps ) ) )
|
||||
throw new NotSupportedException( "Unable to retrieve audio device capabilities. This audio device requires a larger AudioStreamConfigCaps structure." );
|
||||
if ( c > 1 )
|
||||
Debug.WriteLine("WARNING: This audio device supports " + c + " capability structures. Only the first structure will be used." );
|
||||
|
||||
// Alloc memory for structure
|
||||
pCaps = Marshal.AllocCoTaskMem( Marshal.SizeOf( typeof( AudioStreamConfigCaps ) ) );
|
||||
|
||||
// Retrieve first (and hopefully only) capabilities struct
|
||||
hr = audioStreamConfig.GetStreamCaps( 0, out pMediaType, pCaps );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
// Convert pointers to managed structures
|
||||
mediaType = (AMMediaType) Marshal.PtrToStructure( pMediaType, typeof( AMMediaType ) );
|
||||
caps = (AudioStreamConfigCaps) Marshal.PtrToStructure( pCaps, typeof( AudioStreamConfigCaps ) );
|
||||
|
||||
// Extract info
|
||||
MinimumChannels = caps.MinimumChannels;
|
||||
MaximumChannels = caps.MaximumChannels;
|
||||
ChannelsGranularity = caps.ChannelsGranularity;
|
||||
MinimumSampleSize = caps.MinimumBitsPerSample;
|
||||
MaximumSampleSize = caps.MaximumBitsPerSample;
|
||||
SampleSizeGranularity = caps.BitsPerSampleGranularity;
|
||||
MinimumSamplingRate = caps.MinimumSampleFrequency;
|
||||
MaximumSamplingRate = caps.MaximumSampleFrequency;
|
||||
SamplingRateGranularity = caps.SampleFrequencyGranularity;
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( pCaps != IntPtr.Zero )
|
||||
Marshal.FreeCoTaskMem( pCaps ); pCaps = IntPtr.Zero;
|
||||
if ( mediaType != null )
|
||||
DsUtils.FreeAMMediaType( mediaType ); mediaType = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a physical connector or source on an
|
||||
/// audio device. This class is used on filters that
|
||||
/// support the IAMAudioInputMixer interface such as
|
||||
/// source cards.
|
||||
/// </summary>
|
||||
public class AudioSource : Source
|
||||
{
|
||||
|
||||
// --------------------- Private/Internal properties -------------------------
|
||||
|
||||
internal IPin Pin; // audio mixer interface (COM object)
|
||||
|
||||
|
||||
|
||||
// -------------------- Constructors/Destructors ----------------------
|
||||
|
||||
/// <summary> Constructor. This class cannot be created directly. </summary>
|
||||
internal AudioSource( IPin pin )
|
||||
{
|
||||
if ( (pin as IAMAudioInputMixer) == null )
|
||||
throw new NotSupportedException( "The input pin does not support the IAMAudioInputMixer interface" );
|
||||
this.Pin = pin;
|
||||
this.name = getName( pin );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ----------------------- Public properties -------------------------
|
||||
|
||||
/// <summary> Enable or disable this source. For audio sources it is
|
||||
/// usually possible to enable several sources. When setting Enabled=true,
|
||||
/// set Enabled=false on all other audio sources. </summary>
|
||||
public override bool Enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
IAMAudioInputMixer mix = (IAMAudioInputMixer) Pin;
|
||||
bool e;
|
||||
mix.get_Enable( out e );
|
||||
return( e );
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
IAMAudioInputMixer mix = (IAMAudioInputMixer) Pin;
|
||||
mix.put_Enable( value );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// --------------------------- Private methods ----------------------------
|
||||
|
||||
/// <summary> Retrieve the friendly name of a connectorType. </summary>
|
||||
private string getName( IPin pin )
|
||||
{
|
||||
string s = "Unknown pin";
|
||||
PinInfo pinInfo = new PinInfo();
|
||||
|
||||
// Direction matches, so add pin name to listbox
|
||||
int hr = pin.QueryPinInfo( out pinInfo);
|
||||
if ( hr == 0 )
|
||||
{
|
||||
s = pinInfo.name + "";
|
||||
}
|
||||
else
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
// The pininfo structure contains a reference to an IBaseFilter,
|
||||
// so you must release its reference to prevent resource a leak.
|
||||
if ( pinInfo.filter != null )
|
||||
Marshal.ReleaseComObject( pinInfo.filter ); pinInfo.filter = null;
|
||||
|
||||
return( s );
|
||||
}
|
||||
|
||||
// -------------------- IDisposable -----------------------
|
||||
|
||||
/// <summary> Release unmanaged resources. </summary>
|
||||
public override void Dispose()
|
||||
{
|
||||
if ( Pin != null )
|
||||
Marshal.ReleaseComObject( Pin );
|
||||
Pin = null;
|
||||
base.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,132 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a physical connector or source on an
|
||||
/// audio/video device. This class is used on filters that
|
||||
/// support the IAMCrossbar interface such as TV Tuners.
|
||||
/// </summary>
|
||||
public class CrossbarSource : Source
|
||||
{
|
||||
// --------------------- Private/Internal properties -------------------------
|
||||
|
||||
internal IAMCrossbar Crossbar; // crossbar filter (COM object)
|
||||
internal int OutputPin; // output pin number on the crossbar
|
||||
internal int InputPin; // input pin number on the crossbar
|
||||
internal PhysicalConnectorType ConnectorType; // type of the connector
|
||||
|
||||
|
||||
|
||||
// ----------------------- Public properties -------------------------
|
||||
|
||||
/// <summary> Enabled or disable this source. </summary>
|
||||
public override bool Enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
int i;
|
||||
if ( Crossbar.get_IsRoutedTo( OutputPin, out i ) == 0 )
|
||||
if ( InputPin == i )
|
||||
return( true );
|
||||
return( false );
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if ( value )
|
||||
{
|
||||
// Enable this route
|
||||
int hr = this.Crossbar.Route( this.OutputPin, this.InputPin );
|
||||
if ( hr < 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable this route by routing the output
|
||||
// pin to input pin -1
|
||||
int hr = this.Crossbar.Route( this.OutputPin, -1 );
|
||||
if ( hr < 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -------------------- Constructors/Destructors ----------------------
|
||||
|
||||
/// <summary> Constructor. This class cannot be created directly. </summary>
|
||||
internal CrossbarSource( IAMCrossbar crossbar, int outputPin, int inputPin, PhysicalConnectorType connectorType )
|
||||
{
|
||||
this.Crossbar = crossbar;
|
||||
this.OutputPin = outputPin;
|
||||
this.InputPin = inputPin;
|
||||
this.ConnectorType = connectorType;
|
||||
this.name = getName( connectorType );
|
||||
}
|
||||
|
||||
// --------------------------- Private methods ----------------------------
|
||||
|
||||
/// <summary> Retrieve the friendly name of a connectorType. </summary>
|
||||
private string getName( PhysicalConnectorType connectorType )
|
||||
{
|
||||
string name;
|
||||
switch( connectorType )
|
||||
{
|
||||
case PhysicalConnectorType.Video_Tuner: name = "Video Tuner"; break;
|
||||
case PhysicalConnectorType.Video_Composite: name = "Video Composite"; break;
|
||||
case PhysicalConnectorType.Video_SVideo: name = "Video S-Video"; break;
|
||||
case PhysicalConnectorType.Video_RGB: name = "Video RGB"; break;
|
||||
case PhysicalConnectorType.Video_YRYBY: name = "Video YRYBY"; break;
|
||||
case PhysicalConnectorType.Video_SerialDigital: name = "Video Serial Digital"; break;
|
||||
case PhysicalConnectorType.Video_ParallelDigital: name = "Video Parallel Digital";break;
|
||||
case PhysicalConnectorType.Video_SCSI: name = "Video SCSI"; break;
|
||||
case PhysicalConnectorType.Video_AUX: name = "Video AUX"; break;
|
||||
case PhysicalConnectorType.Video_1394: name = "Video Firewire"; break;
|
||||
case PhysicalConnectorType.Video_USB: name = "Video USB"; break;
|
||||
case PhysicalConnectorType.Video_VideoDecoder: name = "Video Decoder"; break;
|
||||
case PhysicalConnectorType.Video_VideoEncoder: name = "Video Encoder"; break;
|
||||
case PhysicalConnectorType.Video_SCART: name = "Video SCART"; break;
|
||||
|
||||
case PhysicalConnectorType.Audio_Tuner: name = "Audio Tuner"; break;
|
||||
case PhysicalConnectorType.Audio_Line: name = "Audio Line In"; break;
|
||||
case PhysicalConnectorType.Audio_Mic: name = "Audio Mic"; break;
|
||||
case PhysicalConnectorType.Audio_AESDigital: name = "Audio AES Digital"; break;
|
||||
case PhysicalConnectorType.Audio_SPDIFDigital: name = "Audio SPDIF Digital"; break;
|
||||
case PhysicalConnectorType.Audio_SCSI: name = "Audio SCSI"; break;
|
||||
case PhysicalConnectorType.Audio_AUX: name = "Audio AUX"; break;
|
||||
case PhysicalConnectorType.Audio_1394: name = "Audio Firewire"; break;
|
||||
case PhysicalConnectorType.Audio_USB: name = "Audio USB"; break;
|
||||
case PhysicalConnectorType.Audio_AudioDecoder: name = "Audio Decoder"; break;
|
||||
|
||||
default: name = "Unknown Connector"; break;
|
||||
}
|
||||
return( name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -------------------- IDisposable -----------------------
|
||||
|
||||
/// <summary> Release unmanaged resources. </summary>
|
||||
public override void Dispose()
|
||||
{
|
||||
if ( Crossbar != null )
|
||||
Marshal.ReleaseComObject( Crossbar );
|
||||
Crossbar = null;
|
||||
base.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception thrown when the device cannot be rendered or started.
|
||||
/// </summary>
|
||||
public class DeviceInUseException : SystemException
|
||||
{
|
||||
// Initializes a new instance with the specified HRESULT
|
||||
public DeviceInUseException(string deviceName, int hResult) : base( deviceName + " is in use or cannot be rendered. (" + hResult + ")" )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Property pages for a DirectShow filter (e.g. hardware device). These
|
||||
/// property pages do not support persisting their settings.
|
||||
/// </summary>
|
||||
public class DirectShowPropertyPage : PropertyPage
|
||||
{
|
||||
// ---------------- Properties --------------------
|
||||
|
||||
/// <summary> COM ISpecifyPropertyPages interface </summary>
|
||||
protected ISpecifyPropertyPages specifyPropertyPages;
|
||||
|
||||
|
||||
|
||||
// ---------------- Constructors --------------------
|
||||
|
||||
/// <summary> Constructor </summary>
|
||||
public DirectShowPropertyPage(string name, ISpecifyPropertyPages specifyPropertyPages)
|
||||
{
|
||||
Name = name;
|
||||
SupportsPersisting = false;
|
||||
this.specifyPropertyPages = specifyPropertyPages;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- Public Methods --------------------
|
||||
|
||||
/// <summary>
|
||||
/// Show the property page. Some property pages cannot be displayed
|
||||
/// while previewing and/or capturing.
|
||||
/// </summary>
|
||||
public override void Show(Control owner)
|
||||
{
|
||||
DsCAUUID cauuid = new DsCAUUID();
|
||||
try
|
||||
{
|
||||
int hr = specifyPropertyPages.GetPages( out cauuid );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
object o = specifyPropertyPages;
|
||||
hr = OleCreatePropertyFrame( owner.Handle, 30, 30, null, 1,
|
||||
ref o, cauuid.cElems, cauuid.pElems, 0, 0, IntPtr.Zero );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if( cauuid.pElems != IntPtr.Zero )
|
||||
Marshal.FreeCoTaskMem( cauuid.pElems );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Release unmanaged resources </summary>
|
||||
public new void Dispose()
|
||||
{
|
||||
if ( specifyPropertyPages != null )
|
||||
Marshal.ReleaseComObject( specifyPropertyPages ); specifyPropertyPages = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- DLL Imports --------------------
|
||||
|
||||
[DllImport("olepro32.dll", CharSet=CharSet.Unicode, ExactSpelling=true) ]
|
||||
private static extern int OleCreatePropertyFrame(
|
||||
IntPtr hwndOwner, int x, int y,
|
||||
string lpszCaption, int cObjects,
|
||||
[In, MarshalAs(UnmanagedType.Interface)] ref object ppUnk,
|
||||
int cPages, IntPtr pPageClsID, int lcid, int dwReserved, IntPtr pvReserved );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.30319</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{8C0015DB-69E1-46E7-8705-3A4F8BE2E5E7}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon />
|
||||
<AssemblyKeyContainerName />
|
||||
<AssemblyName>DirectX.Capture</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile />
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DirectX.Capture</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject />
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>0.0</OldToolsVersion>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile />
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile />
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn />
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile />
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile>DirectX.Capture.xml</DocumentationFile>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn />
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>none</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing">
|
||||
<Name>System.Drawing</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<Name>System.Windows.Forms</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AudioCapabilities.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AudioSource.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Capture.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CrossbarSource.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DeviceInUseException.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DirectShowPropertyPage.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Filter.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FilterCollection.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Filters.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PropertyPage.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PropertyPageCollection.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Source.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SourceCollection.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Tuner.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="VfwCompressorPropertyPage.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="VideoCapabilities.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DShowNET\DShowNET.csproj">
|
||||
<Project>{CE009BFA-5EF6-4153-B2A1-2FA79698A9AE}</Project>
|
||||
<Name>DShowNET</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent />
|
||||
<PostBuildEvent />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<LastOpenVersion>7.10.3077</LastOpenVersion>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>D:\Source\DirectXCapture_demo\DirectX.Capture\bin\Debug\;J:\Source\DirectXCapture_demo\DirectX.Capture\bin\Debug\</ReferencePath>
|
||||
<CopyProjectDestinationFolder />
|
||||
<CopyProjectUncPath />
|
||||
<CopyProjectOption>0</CopyProjectOption>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
<PublishUrlHistory />
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<BootstrapperUrlHistory />
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<EnableASPDebugging>false</EnableASPDebugging>
|
||||
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||
<RemoteDebugMachine />
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments />
|
||||
<StartPage />
|
||||
<StartProgram />
|
||||
<StartURL />
|
||||
<StartWorkingDirectory />
|
||||
<StartWithIE>false</StartWithIE>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<EnableASPDebugging>false</EnableASPDebugging>
|
||||
<EnableASPXDebugging>false</EnableASPXDebugging>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
<EnableSQLServerDebugging>false</EnableSQLServerDebugging>
|
||||
<RemoteDebugEnabled>false</RemoteDebugEnabled>
|
||||
<RemoteDebugMachine />
|
||||
<StartAction>Project</StartAction>
|
||||
<StartArguments />
|
||||
<StartPage />
|
||||
<StartProgram />
|
||||
<StartURL />
|
||||
<StartWorkingDirectory />
|
||||
<StartWithIE>false</StartWithIE>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,182 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
using DShowNET.Device;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a DirectShow filter (e.g. video capture device,
|
||||
/// compression codec).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// To save a chosen filer for later recall
|
||||
/// save the MonikerString property on the filter:
|
||||
/// <code><div style="background-color:whitesmoke;">
|
||||
/// string savedMonikerString = myFilter.MonikerString;
|
||||
/// </div></code>
|
||||
///
|
||||
/// To recall the filter create a new Filter class and pass the
|
||||
/// string to the constructor:
|
||||
/// <code><div style="background-color:whitesmoke;">
|
||||
/// Filter mySelectedFilter = new Filter( savedMonikerString );
|
||||
/// </div></code>
|
||||
/// </remarks>
|
||||
public class Filter : IComparable
|
||||
{
|
||||
/// <summary> Human-readable name of the filter </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary> Unique string referencing this filter. This string can be used to recreate this filter. </summary>
|
||||
public string MonikerString;
|
||||
|
||||
/// <summary> Create a new filter from its moniker string. </summary>
|
||||
public Filter( string monikerString )
|
||||
{
|
||||
Name = getName( monikerString );
|
||||
MonikerString = monikerString;
|
||||
}
|
||||
|
||||
/// <summary> Create a new filter from its moniker </summary>
|
||||
internal Filter( UCOMIMoniker moniker )
|
||||
{
|
||||
Name = getName( moniker );
|
||||
MonikerString = getMonikerString( moniker );
|
||||
}
|
||||
|
||||
/// <summary> Retrieve the a moniker's display name (i.e. it's unique string) </summary>
|
||||
protected string getMonikerString(UCOMIMoniker moniker)
|
||||
{
|
||||
string s;
|
||||
moniker.GetDisplayName( null, null, out s );
|
||||
return( s );
|
||||
}
|
||||
|
||||
/// <summary> Retrieve the human-readable name of the filter </summary>
|
||||
protected string getName(UCOMIMoniker moniker)
|
||||
{
|
||||
object bagObj = null;
|
||||
IPropertyBag bag = null;
|
||||
try
|
||||
{
|
||||
Guid bagId = typeof( IPropertyBag ).GUID;
|
||||
moniker.BindToStorage( null, null, ref bagId, out bagObj );
|
||||
bag = (IPropertyBag) bagObj;
|
||||
object val = "";
|
||||
int hr = bag.Read( "FriendlyName", ref val, IntPtr.Zero );
|
||||
if( hr != 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
string ret = val as string;
|
||||
if( (ret == null) || (ret.Length < 1) )
|
||||
throw new NotImplementedException( "Device FriendlyName" );
|
||||
return( ret );
|
||||
}
|
||||
catch( Exception )
|
||||
{
|
||||
return( "" );
|
||||
}
|
||||
finally
|
||||
{
|
||||
bag = null;
|
||||
if( bagObj != null )
|
||||
Marshal.ReleaseComObject( bagObj ); bagObj = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Get a moniker's human-readable name based on a moniker string. </summary>
|
||||
protected string getName(string monikerString)
|
||||
{
|
||||
UCOMIMoniker parser = null;
|
||||
UCOMIMoniker moniker = null;
|
||||
try
|
||||
{
|
||||
parser = getAnyMoniker();
|
||||
int eaten;
|
||||
parser.ParseDisplayName( null, null, monikerString, out eaten, out moniker );
|
||||
return( getName( parser ) );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( parser != null )
|
||||
Marshal.ReleaseComObject( parser ); parser = null;
|
||||
if ( moniker != null )
|
||||
Marshal.ReleaseComObject( moniker ); moniker = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method gets a UCOMIMoniker object.
|
||||
///
|
||||
/// HACK: The only way to create a UCOMIMoniker from a moniker
|
||||
/// string is to use UCOMIMoniker.ParseDisplayName(). So I
|
||||
/// need ANY UCOMIMoniker object so that I can call
|
||||
/// ParseDisplayName(). Does anyone have a better solution?
|
||||
///
|
||||
/// This assumes there is at least one video compressor filter
|
||||
/// installed on the system.
|
||||
/// </summary>
|
||||
protected UCOMIMoniker getAnyMoniker()
|
||||
{
|
||||
Guid category = FilterCategory.VideoCompressorCategory;
|
||||
int hr;
|
||||
object comObj = null;
|
||||
ICreateDevEnum enumDev = null;
|
||||
UCOMIEnumMoniker enumMon = null;
|
||||
UCOMIMoniker[] mon = new UCOMIMoniker[1];
|
||||
|
||||
try
|
||||
{
|
||||
// Get the system device enumerator
|
||||
Type srvType = Type.GetTypeFromCLSID( Clsid.SystemDeviceEnum );
|
||||
if( srvType == null )
|
||||
throw new NotImplementedException( "System Device Enumerator" );
|
||||
comObj = Activator.CreateInstance( srvType );
|
||||
enumDev = (ICreateDevEnum) comObj;
|
||||
|
||||
// Create an enumerator to find filters in category
|
||||
hr = enumDev.CreateClassEnumerator( ref category, out enumMon, 0 );
|
||||
if( hr != 0 )
|
||||
throw new NotSupportedException( "No devices of the category" );
|
||||
|
||||
// Get first filter
|
||||
int f;
|
||||
hr = enumMon.Next( 1, mon, out f );
|
||||
if( (hr != 0) )
|
||||
mon[0] = null;
|
||||
|
||||
return( mon[0] );
|
||||
}
|
||||
finally
|
||||
{
|
||||
enumDev = null;
|
||||
if( enumMon != null )
|
||||
Marshal.ReleaseComObject( enumMon ); enumMon = null;
|
||||
if( comObj != null )
|
||||
Marshal.ReleaseComObject( comObj ); comObj = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares the current instance with another object of
|
||||
/// the same type.
|
||||
/// </summary>
|
||||
public int CompareTo(object obj)
|
||||
{
|
||||
if ( obj == null )
|
||||
return( 1 );
|
||||
Filter f = (Filter) obj;
|
||||
return( this.Name.CompareTo( f.Name ) );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
using DShowNET.Device;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// A collection of Filter objects (DirectShow filters).
|
||||
/// This is used by the <see cref="Capture"/> class to provide
|
||||
/// lists of capture devices and compression filters. This class
|
||||
/// cannot be created directly.
|
||||
/// </summary>
|
||||
public class FilterCollection : CollectionBase
|
||||
{
|
||||
/// <summary> Populate the collection with a list of filters from a particular category. </summary>
|
||||
internal FilterCollection(Guid category)
|
||||
{
|
||||
getFilters( category );
|
||||
}
|
||||
|
||||
/// <summary> Populate the InnerList with a list of filters from a particular category </summary>
|
||||
protected void getFilters(Guid category)
|
||||
{
|
||||
int hr;
|
||||
object comObj = null;
|
||||
ICreateDevEnum enumDev = null;
|
||||
UCOMIEnumMoniker enumMon = null;
|
||||
UCOMIMoniker[] mon = new UCOMIMoniker[1];
|
||||
|
||||
try
|
||||
{
|
||||
// Get the system device enumerator
|
||||
Type srvType = Type.GetTypeFromCLSID( Clsid.SystemDeviceEnum );
|
||||
if( srvType == null )
|
||||
throw new NotImplementedException( "System Device Enumerator" );
|
||||
comObj = Activator.CreateInstance( srvType );
|
||||
enumDev = (ICreateDevEnum) comObj;
|
||||
|
||||
// Create an enumerator to find filters in category
|
||||
hr = enumDev.CreateClassEnumerator( ref category, out enumMon, 0 );
|
||||
if( hr != 0 )
|
||||
throw new NotSupportedException( "No devices of the category" );
|
||||
|
||||
// Loop through the enumerator
|
||||
int f;
|
||||
do
|
||||
{
|
||||
// Next filter
|
||||
hr = enumMon.Next( 1, mon, out f );
|
||||
if( (hr != 0) || (mon[0] == null) )
|
||||
break;
|
||||
|
||||
// Add the filter
|
||||
Filter filter = new Filter( mon[0] );
|
||||
InnerList.Add( filter );
|
||||
|
||||
// Release resources
|
||||
Marshal.ReleaseComObject( mon[0] );
|
||||
mon[0] = null;
|
||||
}
|
||||
while(true);
|
||||
|
||||
// Sort
|
||||
InnerList.Sort();
|
||||
}
|
||||
finally
|
||||
{
|
||||
enumDev = null;
|
||||
if( mon[0] != null )
|
||||
Marshal.ReleaseComObject( mon[0] ); mon[0] = null;
|
||||
if( enumMon != null )
|
||||
Marshal.ReleaseComObject( enumMon ); enumMon = null;
|
||||
if( comObj != null )
|
||||
Marshal.ReleaseComObject( comObj ); comObj = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Get the filter at the specified index. </summary>
|
||||
public Filter this[int index]
|
||||
{
|
||||
get { return( (Filter) InnerList[index] ); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides collections of devices and compression codecs
|
||||
/// installed on the system.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// Devices and compression codecs are implemented in DirectShow
|
||||
/// as filters, see the <see cref="Filter"/> class for more
|
||||
/// information. To list the available video devices:
|
||||
/// <code><div style="background-color:whitesmoke;">
|
||||
/// Filters filters = new Filters();
|
||||
/// foreach ( Filter f in filters.VideoInputDevices )
|
||||
/// {
|
||||
/// Debug.WriteLine( f.Name );
|
||||
/// }
|
||||
/// </div></code>
|
||||
/// <seealso cref="Filter"/>
|
||||
/// </example>
|
||||
public class Filters
|
||||
{
|
||||
// ------------------ Public Properties --------------------
|
||||
|
||||
/// <summary> Collection of available video capture devices. </summary>
|
||||
public FilterCollection VideoInputDevices = new FilterCollection( FilterCategory.VideoInputDevice );
|
||||
|
||||
/// <summary> Collection of available audio capture devices. </summary>
|
||||
public FilterCollection AudioInputDevices = new FilterCollection( FilterCategory.AudioInputDevice );
|
||||
|
||||
/// <summary> Collection of available video compressors. </summary>
|
||||
public FilterCollection VideoCompressors = new FilterCollection( FilterCategory.VideoCompressorCategory );
|
||||
|
||||
/// <summary> Collection of available audio compressors. </summary>
|
||||
public FilterCollection AudioCompressors = new FilterCollection( FilterCategory.AudioCompressorCategory );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// A base class for representing property pages exposed by filters.
|
||||
/// </summary>
|
||||
public class PropertyPage : IDisposable
|
||||
{
|
||||
|
||||
// ---------------- Properties --------------------
|
||||
|
||||
/// <summary> Name of property page. This name may not be unique </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary> Does this property page support saving and loading the user's choices. </summary>
|
||||
public bool SupportsPersisting = false;
|
||||
|
||||
/// <summary>
|
||||
/// Get or set the state of the property page. This is used to save
|
||||
/// and restore the user's choices without redisplaying the property page.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// After showing this property page, read and store the value of
|
||||
/// this property. At a later time, the user's choices can be
|
||||
/// reloaded by setting this property with the value stored earlier.
|
||||
/// Note that some property pages, after setting this property,
|
||||
/// will not reflect the new state. However, the filter will use the
|
||||
/// new settings.
|
||||
///
|
||||
/// <para>
|
||||
/// When reading this property, copy the entire array at once then manipulate
|
||||
/// your local copy (e..g byte[] myState = propertyPage.State). When
|
||||
/// setting this property set the entire array at once (e.g. propertyPage = myState).
|
||||
/// </para>
|
||||
///
|
||||
/// <para>
|
||||
/// Not all property pages support saving/loading state. Check the
|
||||
/// <see cref="SupportsPersisting"/> property to determine if this
|
||||
/// property page supports it.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public virtual byte[] State
|
||||
{
|
||||
get { throw new NotSupportedException( "This property page does not support persisting state." ); }
|
||||
set { throw new NotSupportedException( "This property page does not support persisting state." ); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- Constructors --------------------
|
||||
|
||||
/// <summary> Constructor </summary>
|
||||
public PropertyPage()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- Public Methods --------------------
|
||||
|
||||
/// <summary>
|
||||
/// Show the property page. Some property pages cannot be displayed
|
||||
/// while previewing and/or capturing. This method will block until
|
||||
/// the property page is closed by the user.
|
||||
/// </summary>
|
||||
public virtual void Show(Control owner)
|
||||
{
|
||||
throw new NotSupportedException( "Not implemented. Use a derived class. " );
|
||||
}
|
||||
|
||||
/// <summary> Release unmanaged resources </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// A collection of available PropertyPages in a DirectShow
|
||||
/// filter graph. It is up to the driver manufacturer to implement
|
||||
/// a property pages on their drivers. The list of supported
|
||||
/// property pages will vary from driver to driver.
|
||||
/// </summary>
|
||||
public class PropertyPageCollection : CollectionBase, IDisposable
|
||||
{
|
||||
|
||||
// --------------- Constructors / Destructor ----------------
|
||||
|
||||
/// <summary> Initialize collection with no property pages. </summary>
|
||||
internal PropertyPageCollection()
|
||||
{
|
||||
InnerList.Capacity = 1;
|
||||
}
|
||||
|
||||
/// <summary> Initialize collection with property pages from existing graph. </summary>
|
||||
internal PropertyPageCollection(
|
||||
ICaptureGraphBuilder2 graphBuilder,
|
||||
IBaseFilter videoDeviceFilter, IBaseFilter audioDeviceFilter,
|
||||
IBaseFilter videoCompressorFilter, IBaseFilter audioCompressorFilter,
|
||||
SourceCollection videoSources, SourceCollection audioSources)
|
||||
{
|
||||
addFromGraph( graphBuilder,
|
||||
videoDeviceFilter, audioDeviceFilter,
|
||||
videoCompressorFilter, audioCompressorFilter,
|
||||
videoSources, audioSources );
|
||||
}
|
||||
|
||||
/// <summary> Destructor. Release unmanaged resources. </summary>
|
||||
~PropertyPageCollection()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ----------------- Public Properties ------------------
|
||||
|
||||
/// <summary> Empty the collection. </summary>
|
||||
public new void Clear()
|
||||
{
|
||||
for ( int c = 0; c < InnerList.Count; c++ )
|
||||
this[c].Dispose();
|
||||
InnerList.Clear();
|
||||
}
|
||||
|
||||
/// <summary> Release unmanaged resources </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Clear();
|
||||
InnerList.Capacity = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- Private Methods --------------------
|
||||
|
||||
/// <summary> Get the filter at the specified index. </summary>
|
||||
public PropertyPage this[int index]
|
||||
{
|
||||
get { return( (PropertyPage) InnerList[index] ); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ------------------ Public Methods --------------------
|
||||
|
||||
/// <summary> Populate the collection by looking for commonly implemented property pages. </summary>
|
||||
protected void addFromGraph(
|
||||
ICaptureGraphBuilder2 graphBuilder,
|
||||
IBaseFilter videoDeviceFilter, IBaseFilter audioDeviceFilter,
|
||||
IBaseFilter videoCompressorFilter, IBaseFilter audioCompressorFilter,
|
||||
SourceCollection videoSources, SourceCollection audioSources)
|
||||
{
|
||||
object filter = null;
|
||||
Guid cat;
|
||||
Guid med;
|
||||
Guid iid;
|
||||
int hr;
|
||||
|
||||
Trace.Assert( graphBuilder != null );
|
||||
|
||||
// 1. the video capture filter
|
||||
addIfSupported( videoDeviceFilter, "Video Capture Device" );
|
||||
|
||||
// 2. the video capture pin
|
||||
cat = PinCategory.Capture;
|
||||
med = MediaType.Interleaved;
|
||||
iid = typeof(IAMStreamConfig).GUID;
|
||||
hr = graphBuilder.FindInterface(
|
||||
ref cat, ref med, videoDeviceFilter, ref iid, out filter );
|
||||
if ( hr != 0 )
|
||||
{
|
||||
med = MediaType.Video ;
|
||||
hr = graphBuilder.FindInterface(
|
||||
ref cat, ref med, videoDeviceFilter, ref iid, out filter );
|
||||
if ( hr != 0 )
|
||||
filter = null;
|
||||
}
|
||||
addIfSupported( filter, "Video Capture Pin" );
|
||||
|
||||
// 3. the video preview pin
|
||||
cat = PinCategory.Preview;
|
||||
med = MediaType.Interleaved;
|
||||
iid = typeof(IAMStreamConfig).GUID;
|
||||
hr = graphBuilder.FindInterface(
|
||||
ref cat, ref med, videoDeviceFilter, ref iid, out filter );
|
||||
if ( hr != 0 )
|
||||
{
|
||||
med = MediaType.Video ;
|
||||
hr = graphBuilder.FindInterface(
|
||||
ref cat, ref med, videoDeviceFilter, ref iid, out filter );
|
||||
if ( hr != 0 )
|
||||
filter = null;
|
||||
}
|
||||
addIfSupported( filter, "Video Preview Pin" );
|
||||
|
||||
// 4. the video crossbar(s)
|
||||
ArrayList crossbars = new ArrayList();
|
||||
int num = 1;
|
||||
for ( int c = 0; c < videoSources.Count; c++ )
|
||||
{
|
||||
CrossbarSource s = videoSources[c] as CrossbarSource;
|
||||
if ( s != null )
|
||||
{
|
||||
if ( crossbars.IndexOf( s.Crossbar ) < 0 )
|
||||
{
|
||||
crossbars.Add( s.Crossbar );
|
||||
if ( addIfSupported( s.Crossbar, "Video Crossbar " + ( num==1 ? "" : num.ToString() ) ) )
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
crossbars.Clear();
|
||||
|
||||
// 5. the video compressor
|
||||
addIfSupported( videoCompressorFilter, "Video Compressor" );
|
||||
|
||||
// 6. the video TV tuner
|
||||
cat = PinCategory.Capture;
|
||||
med = MediaType.Interleaved;
|
||||
iid = typeof(IAMTVTuner).GUID;
|
||||
hr = graphBuilder.FindInterface(
|
||||
ref cat, ref med, videoDeviceFilter, ref iid, out filter );
|
||||
if ( hr != 0 )
|
||||
{
|
||||
med = MediaType.Video ;
|
||||
hr = graphBuilder.FindInterface(
|
||||
ref cat, ref med, videoDeviceFilter, ref iid, out filter );
|
||||
if ( hr != 0 )
|
||||
filter = null;
|
||||
}
|
||||
addIfSupported( filter, "TV Tuner" );
|
||||
|
||||
// 7. the video compressor (VFW)
|
||||
IAMVfwCompressDialogs compressDialog = videoCompressorFilter as IAMVfwCompressDialogs;
|
||||
if ( compressDialog != null )
|
||||
{
|
||||
VfwCompressorPropertyPage page = new VfwCompressorPropertyPage( "Video Compressor", compressDialog );
|
||||
InnerList.Add( page );
|
||||
}
|
||||
|
||||
// 8. the audio capture filter
|
||||
addIfSupported( audioDeviceFilter, "Audio Capture Device" );
|
||||
|
||||
// 9. the audio capture pin
|
||||
cat = PinCategory.Capture;
|
||||
med = MediaType.Audio;
|
||||
iid = typeof(IAMStreamConfig).GUID;
|
||||
hr = graphBuilder.FindInterface(
|
||||
ref cat, ref med, audioDeviceFilter, ref iid, out filter );
|
||||
if ( hr != 0 )
|
||||
{
|
||||
filter = null;
|
||||
}
|
||||
addIfSupported( filter, "Audio Capture Pin" );
|
||||
|
||||
// 9. the audio preview pin
|
||||
cat = PinCategory.Preview;
|
||||
med = MediaType.Audio;
|
||||
iid = typeof(IAMStreamConfig).GUID;
|
||||
hr = graphBuilder.FindInterface(
|
||||
ref cat, ref med, audioDeviceFilter, ref iid, out filter );
|
||||
if ( hr != 0 )
|
||||
{
|
||||
filter = null;
|
||||
}
|
||||
addIfSupported( filter, "Audio Preview Pin" );
|
||||
|
||||
// 10. the audio crossbar(s)
|
||||
num = 1;
|
||||
for ( int c = 0; c < audioSources.Count; c++ )
|
||||
{
|
||||
CrossbarSource s = audioSources[c] as CrossbarSource;
|
||||
if ( s != null )
|
||||
{
|
||||
if ( crossbars.IndexOf( s.Crossbar ) < 0 )
|
||||
{
|
||||
crossbars.Add( s.Crossbar );
|
||||
if ( addIfSupported( s.Crossbar, "Audio Crossbar " + ( num==1 ? "" : num.ToString() ) ) )
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
crossbars.Clear();
|
||||
|
||||
// 11. the audio compressor
|
||||
addIfSupported( audioCompressorFilter, "Audio Compressor" );
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the object as an ISpecificPropertyPage
|
||||
/// if the object supports the ISpecificPropertyPage
|
||||
/// interface and has at least one property page.
|
||||
/// </summary>
|
||||
protected bool addIfSupported(object o, string name)
|
||||
{
|
||||
ISpecifyPropertyPages specifyPropertyPages = null;
|
||||
DsCAUUID cauuid = new DsCAUUID();
|
||||
bool wasAdded = false;
|
||||
|
||||
// Determine if the object supports the interface
|
||||
// and has at least 1 property page
|
||||
try
|
||||
{
|
||||
specifyPropertyPages = o as ISpecifyPropertyPages;
|
||||
if ( specifyPropertyPages != null )
|
||||
{
|
||||
int hr = specifyPropertyPages.GetPages( out cauuid );
|
||||
if ( ( hr != 0 ) || ( cauuid.cElems <= 0 ) )
|
||||
specifyPropertyPages = null;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if( cauuid.pElems != IntPtr.Zero )
|
||||
Marshal.FreeCoTaskMem( cauuid.pElems );
|
||||
}
|
||||
|
||||
// Add the page to the internal collection
|
||||
if ( specifyPropertyPages != null )
|
||||
{
|
||||
DirectShowPropertyPage p = new DirectShowPropertyPage( name, specifyPropertyPages );
|
||||
InnerList.Add( p );
|
||||
wasAdded = true;
|
||||
}
|
||||
return( wasAdded );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a physical connector or source on an audio/video device.
|
||||
/// </summary>
|
||||
public class Source : IDisposable
|
||||
{
|
||||
|
||||
// --------------------- Private/Internal properties -------------------------
|
||||
|
||||
protected string name; // Name of the source
|
||||
|
||||
|
||||
|
||||
// ----------------------- Public properties -------------------------
|
||||
|
||||
/// <summary> The name of the source. Read-only. </summary>
|
||||
public string Name { get { return( name ); } }
|
||||
|
||||
/// <summary> Obtains the String representation of this instance. </summary>
|
||||
public override string ToString() { return( Name ); }
|
||||
|
||||
/// <summary> Is this source enabled. </summary>
|
||||
public virtual bool Enabled
|
||||
{
|
||||
get { throw new NotSupportedException( "This method should be overriden in derrived classes." ); }
|
||||
set { throw new NotSupportedException( "This method should be overriden in derrived classes." ); }
|
||||
}
|
||||
|
||||
|
||||
// -------------------- Constructors/Destructors ----------------------
|
||||
|
||||
/// <summary> Release unmanaged resources. </summary>
|
||||
~Source()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -------------------- IDisposable -----------------------
|
||||
|
||||
/// <summary> Release unmanaged resources. </summary>
|
||||
public virtual void Dispose()
|
||||
{
|
||||
name = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// A collection of sources (or physical connectors) on an
|
||||
/// audio or video device. This is used by the <see cref="Capture"/>
|
||||
/// class to provide a list of available sources on the currently
|
||||
/// selected audio and video devices. This class cannot be created
|
||||
/// directly. This class assumes there is only 1 video and 1 audio
|
||||
/// crossbar and all input pins route to a single output pin on each
|
||||
/// crossbar.
|
||||
/// </summary>
|
||||
public class SourceCollection : CollectionBase, IDisposable
|
||||
{
|
||||
|
||||
// ------------------ Constructors/Destructors -----------------------
|
||||
|
||||
/// <summary> Initialize collection with no sources. </summary>
|
||||
internal SourceCollection()
|
||||
{
|
||||
InnerList.Capacity = 1;
|
||||
}
|
||||
|
||||
/// <summary> Initialize collection with sources from graph. </summary>
|
||||
internal SourceCollection(ICaptureGraphBuilder2 graphBuilder, IBaseFilter deviceFilter, bool isVideoDevice)
|
||||
{
|
||||
addFromGraph( graphBuilder, deviceFilter, isVideoDevice );
|
||||
}
|
||||
|
||||
/// <summary> Destructor. Release unmanaged resources. </summary>
|
||||
~SourceCollection()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -------------------- Public Properties -----------------------
|
||||
|
||||
/// <summary> Get the source at the specified index. </summary>
|
||||
public Source this[int index]
|
||||
{
|
||||
get { return( (Source) InnerList[index] ); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the source/physical connector currently in use.
|
||||
/// This is marked internal so that the Capture class can control
|
||||
/// how and when the source is changed.
|
||||
/// </summary>
|
||||
internal Source CurrentSource
|
||||
{
|
||||
get
|
||||
{
|
||||
// Loop through each source and find the first
|
||||
// enabled source.
|
||||
foreach ( Source s in InnerList )
|
||||
{
|
||||
if ( s.Enabled )
|
||||
return( s );
|
||||
}
|
||||
|
||||
return ( null );
|
||||
|
||||
}
|
||||
set
|
||||
{
|
||||
if ( value == null )
|
||||
{
|
||||
// Disable all sources
|
||||
foreach ( Source s in InnerList )
|
||||
s.Enabled = false;
|
||||
}
|
||||
else if ( value is CrossbarSource )
|
||||
{
|
||||
// Enable this source
|
||||
// (this will automatically disable all other sources)
|
||||
value.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable all sources
|
||||
// Enable selected source
|
||||
foreach ( Source s in InnerList )
|
||||
s.Enabled = false;
|
||||
value.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -------------------- Public methods -----------------------
|
||||
|
||||
/// <summary> Empty the collection. </summary>
|
||||
public new void Clear()
|
||||
{
|
||||
for ( int c = 0; c < InnerList.Count; c++ )
|
||||
this[c].Dispose();
|
||||
InnerList.Clear();
|
||||
}
|
||||
|
||||
/// <summary> Release unmanaged resources. </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Clear();
|
||||
InnerList.Capacity = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -------------------- Protected Methods -----------------------
|
||||
|
||||
/// <summary> Populate the collection from a filter graph. </summary>
|
||||
protected void addFromGraph ( ICaptureGraphBuilder2 graphBuilder, IBaseFilter deviceFilter, bool isVideoDevice )
|
||||
{
|
||||
Trace.Assert( graphBuilder != null );
|
||||
|
||||
ArrayList crossbars = findCrossbars( graphBuilder, deviceFilter );
|
||||
foreach ( IAMCrossbar crossbar in crossbars )
|
||||
{
|
||||
ArrayList sources = findCrossbarSources( graphBuilder, crossbar, isVideoDevice );
|
||||
InnerList.AddRange( sources );
|
||||
}
|
||||
|
||||
if ( !isVideoDevice )
|
||||
{
|
||||
if ( InnerList.Count == 0 )
|
||||
{
|
||||
ArrayList sources = findAudioSources( graphBuilder, deviceFilter );
|
||||
InnerList.AddRange( sources );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve a list of crossbar filters in the graph.
|
||||
/// Most hardware devices should have a maximum of 2 crossbars,
|
||||
/// one for video and another for audio.
|
||||
/// </summary>
|
||||
protected ArrayList findCrossbars(ICaptureGraphBuilder2 graphBuilder, IBaseFilter deviceFilter)
|
||||
{
|
||||
ArrayList crossbars = new ArrayList();
|
||||
|
||||
Guid category = FindDirection.UpstreamOnly;
|
||||
Guid type = new Guid();
|
||||
Guid riid = typeof(IAMCrossbar).GUID;
|
||||
int hr;
|
||||
|
||||
object comObj = null;
|
||||
object comObjNext = null;
|
||||
|
||||
// Find the first interface, look upstream from the selected device
|
||||
hr = graphBuilder.FindInterface( ref category, ref type, deviceFilter, ref riid, out comObj );
|
||||
while ( (hr == 0) && (comObj != null) )
|
||||
{
|
||||
// If found, add to the list
|
||||
if ( comObj is IAMCrossbar )
|
||||
{
|
||||
crossbars.Add( comObj as IAMCrossbar );
|
||||
|
||||
// Find the second interface, look upstream from the next found crossbar
|
||||
hr = graphBuilder.FindInterface( ref category, ref type, comObj as IBaseFilter, ref riid, out comObjNext );
|
||||
comObj = comObjNext;
|
||||
}
|
||||
else
|
||||
comObj = null;
|
||||
}
|
||||
|
||||
return( crossbars );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populate the internal InnerList with sources/physical connectors
|
||||
/// found on the crossbars. Each instance of this class is limited
|
||||
/// to video only or audio only sources ( specified by the isVideoDevice
|
||||
/// parameter on the constructor) so we check each source before adding
|
||||
/// it to the list.
|
||||
/// </summary>
|
||||
protected ArrayList findCrossbarSources(ICaptureGraphBuilder2 graphBuilder, IAMCrossbar crossbar, bool isVideoDevice)
|
||||
{
|
||||
ArrayList sources = new ArrayList();
|
||||
int hr;
|
||||
int numOutPins;
|
||||
int numInPins;
|
||||
hr = crossbar.get_PinCounts( out numOutPins, out numInPins );
|
||||
if ( hr < 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
// We loop through every combination of output and input pin
|
||||
// to see which combinations match.
|
||||
|
||||
// Loop through output pins
|
||||
for ( int cOut = 0; cOut < numOutPins; cOut++ )
|
||||
{
|
||||
// Loop through input pins
|
||||
for ( int cIn = 0; cIn < numInPins; cIn++ )
|
||||
{
|
||||
// Can this combination be routed?
|
||||
hr = crossbar.CanRoute( cOut, cIn );
|
||||
if ( hr == 0 )
|
||||
{
|
||||
// Yes, this can be routed
|
||||
int relatedPin;
|
||||
PhysicalConnectorType connectorType;
|
||||
hr = crossbar.get_CrossbarPinInfo( true, cIn, out relatedPin, out connectorType );
|
||||
if ( hr < 0 )
|
||||
Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
// Is this the correct type?, If so add to the InnerList
|
||||
CrossbarSource source = new CrossbarSource( crossbar, cOut, cIn, connectorType );
|
||||
if ( connectorType < PhysicalConnectorType.Audio_Tuner )
|
||||
if ( isVideoDevice )
|
||||
sources.Add( source );
|
||||
else
|
||||
if ( !isVideoDevice )
|
||||
sources.Add( source );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Some silly drivers (*cough* Nvidia *cough*) add crossbars
|
||||
// with no real choices. Every input can only be routed to
|
||||
// one output. Loop through every Source and see if there
|
||||
// at least one other Source with the same output pin.
|
||||
int refIndex = 0;
|
||||
while ( refIndex < sources.Count )
|
||||
{
|
||||
bool found = false;
|
||||
CrossbarSource refSource = (CrossbarSource) sources[refIndex];
|
||||
for ( int c = 0; c < sources.Count; c++ )
|
||||
{
|
||||
CrossbarSource s = (CrossbarSource) sources[c];
|
||||
if ( ( refSource.OutputPin == s.OutputPin ) && ( refIndex != c ) )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( found )
|
||||
refIndex++;
|
||||
else
|
||||
sources.RemoveAt( refIndex );
|
||||
}
|
||||
|
||||
return( sources );
|
||||
}
|
||||
|
||||
protected ArrayList findAudioSources(ICaptureGraphBuilder2 graphBuilder, IBaseFilter deviceFilter)
|
||||
{
|
||||
ArrayList sources = new ArrayList();
|
||||
IAMAudioInputMixer audioInputMixer = deviceFilter as IAMAudioInputMixer;
|
||||
if ( audioInputMixer != null )
|
||||
{
|
||||
// Get a pin enumerator off the filter
|
||||
IEnumPins pinEnum;
|
||||
int hr = deviceFilter.EnumPins( out pinEnum );
|
||||
pinEnum.Reset();
|
||||
if( (hr == 0) && (pinEnum != null) )
|
||||
{
|
||||
// Loop through each pin
|
||||
IPin[] pins = new IPin[1];
|
||||
int f;
|
||||
do
|
||||
{
|
||||
// Get the next pin
|
||||
hr = pinEnum.Next( 1, pins, out f );
|
||||
if( (hr == 0) && (pins[0] != null) )
|
||||
{
|
||||
// Is this an input pin?
|
||||
PinDirection dir = PinDirection.Output;
|
||||
hr = pins[0].QueryDirection( out dir );
|
||||
if( (hr == 0) && (dir == (PinDirection.Input)) )
|
||||
{
|
||||
// Add the input pin to the sources list
|
||||
AudioSource source = new AudioSource( pins[0] );
|
||||
sources.Add( source );
|
||||
}
|
||||
pins[0] = null;
|
||||
}
|
||||
}
|
||||
while( hr == 0 );
|
||||
|
||||
Marshal.ReleaseComObject( pinEnum ); pinEnum = null;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is only one source, don't return it
|
||||
// because there is nothing for the user to choose.
|
||||
// (Hopefully that single source is already enabled).
|
||||
if ( sources.Count == 1 )
|
||||
sources.Clear();
|
||||
|
||||
return( sources );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Specify the frequency of the TV tuner.
|
||||
/// </summary>
|
||||
public enum TunerInputType
|
||||
{
|
||||
/// <summary> Cable frequency </summary>
|
||||
Cable,
|
||||
/// <summary> Antenna frequency </summary>
|
||||
Antenna
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Control and query a hardware TV Tuner.
|
||||
/// </summary>
|
||||
public class Tuner : IDisposable
|
||||
{
|
||||
// ---------------- Private Properties ---------------
|
||||
|
||||
protected IAMTVTuner tvTuner = null;
|
||||
|
||||
|
||||
|
||||
// ------------------- Constructors ------------------
|
||||
|
||||
/// <summary> Initialize this object with a DirectShow tuner </summary>
|
||||
public Tuner(IAMTVTuner tuner)
|
||||
{
|
||||
tvTuner = tuner;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- Public Properties ---------------
|
||||
|
||||
/// <summary>
|
||||
/// Get or set the TV Tuner channel.
|
||||
/// </summary>
|
||||
public int Channel
|
||||
{
|
||||
get
|
||||
{
|
||||
int channel;
|
||||
int v, a;
|
||||
int hr = tvTuner.get_Channel( out channel, out v, out a );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
return( channel );
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
int hr = tvTuner.put_Channel( value, AMTunerSubChannel.Default, AMTunerSubChannel.Default );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get or set the tuner frequency (cable or antenna).
|
||||
/// </summary>
|
||||
public TunerInputType InputType
|
||||
{
|
||||
get
|
||||
{
|
||||
DShowNET.TunerInputType t;
|
||||
int hr = tvTuner.get_InputType( 0, out t );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
return( (TunerInputType) t );
|
||||
}
|
||||
set
|
||||
{
|
||||
DShowNET.TunerInputType t = (DShowNET.TunerInputType) value;
|
||||
int hr = tvTuner.put_InputType( 0, t );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether a signal is present on the current channel.
|
||||
/// If the signal strength cannot be determined, a NotSupportedException
|
||||
/// is thrown.
|
||||
/// </summary>
|
||||
public bool SignalPresent
|
||||
{
|
||||
get
|
||||
{
|
||||
AMTunerSignalStrength sig;
|
||||
int hr = tvTuner.SignalPresent( out sig );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
if ( sig == AMTunerSignalStrength.NA ) throw new NotSupportedException("Signal strength not available.");
|
||||
return( sig == AMTunerSignalStrength.SignalPresent );
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- Public Methods ---------------
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if ( tvTuner != null )
|
||||
Marshal.ReleaseComObject( tvTuner ); tvTuner = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// The property page to configure a Video for Windows compliant
|
||||
/// compression codec. Most compressors support this property page
|
||||
/// rather than a DirectShow property page. Also, most compressors
|
||||
/// do not support the IAMVideoCompression interface so this
|
||||
/// property page is the only method to configure a compressor.
|
||||
/// </summary>
|
||||
public class VfwCompressorPropertyPage : PropertyPage
|
||||
{
|
||||
|
||||
// ---------------- Properties --------------------
|
||||
|
||||
/// <summary> Video for Windows compression dialog interface </summary>
|
||||
protected IAMVfwCompressDialogs vfwCompressDialogs = null;
|
||||
|
||||
/// <summary>
|
||||
/// Get or set the state of the property page. This is used to save
|
||||
/// and restore the user's choices without redisplaying the property page.
|
||||
/// This property will be null if unable to retrieve the property page's
|
||||
/// state.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// After showing this property page, read and store the value of
|
||||
/// this property. At a later time, the user's choices can be
|
||||
/// reloaded by setting this property with the value stored earlier.
|
||||
/// Note that some property pages, after setting this property,
|
||||
/// will not reflect the new state. However, the filter will use the
|
||||
/// new settings.
|
||||
/// </remarks>
|
||||
public override byte[] State
|
||||
{
|
||||
get
|
||||
{
|
||||
byte[] data = null;
|
||||
int size = 0;
|
||||
|
||||
int hr = vfwCompressDialogs.GetState( null, ref size );
|
||||
if ( ( hr == 0 ) && ( size > 0 ) )
|
||||
{
|
||||
data = new byte[size];
|
||||
hr = vfwCompressDialogs.GetState( data, ref size );
|
||||
if ( hr != 0 ) data = null;
|
||||
}
|
||||
return( data );
|
||||
}
|
||||
set
|
||||
{
|
||||
int hr = vfwCompressDialogs.SetState( value, value.Length );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ---------------- Constructors --------------------
|
||||
|
||||
/// <summary> Constructor </summary>
|
||||
public VfwCompressorPropertyPage(string name, IAMVfwCompressDialogs compressDialogs)
|
||||
{
|
||||
Name = name;
|
||||
SupportsPersisting = true;
|
||||
this.vfwCompressDialogs = compressDialogs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- Public Methods --------------------
|
||||
|
||||
/// <summary>
|
||||
/// Show the property page. Some property pages cannot be displayed
|
||||
/// while previewing and/or capturing.
|
||||
/// </summary>
|
||||
public override void Show(Control owner)
|
||||
{
|
||||
vfwCompressDialogs.ShowDialog( VfwCompressDialogs.Config, owner.Handle );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
// ------------------------------------------------------------------
|
||||
// DirectX.Capture
|
||||
//
|
||||
// History:
|
||||
// 2003-Jan-24 BL - created
|
||||
//
|
||||
// Copyright (c) 2003 Brian Low
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using DShowNET;
|
||||
|
||||
namespace DirectX.Capture
|
||||
{
|
||||
/// <summary>
|
||||
/// Capabilities of the video device such as
|
||||
/// min/max frame size and frame rate.
|
||||
/// </summary>
|
||||
public class VideoCapabilities
|
||||
{
|
||||
|
||||
// ------------------ Properties --------------------
|
||||
|
||||
/// <summary> Native size of the incoming video signal. This is the largest signal the filter can digitize with every pixel remaining unique. Read-only. </summary>
|
||||
public Size InputSize;
|
||||
|
||||
/// <summary> Minimum supported frame size. Read-only. </summary>
|
||||
public Size MinFrameSize;
|
||||
|
||||
/// <summary> Maximum supported frame size. Read-only. </summary>
|
||||
public Size MaxFrameSize;
|
||||
|
||||
/// <summary> Granularity of the output width. This value specifies the increments that are valid between MinFrameSize and MaxFrameSize. Read-only. </summary>
|
||||
public int FrameSizeGranularityX;
|
||||
|
||||
/// <summary> Granularity of the output height. This value specifies the increments that are valid between MinFrameSize and MaxFrameSize. Read-only. </summary>
|
||||
public int FrameSizeGranularityY;
|
||||
|
||||
/// <summary> Minimum supported frame rate. Read-only. </summary>
|
||||
public double MinFrameRate;
|
||||
|
||||
/// <summary> Maximum supported frame rate. Read-only. </summary>
|
||||
public double MaxFrameRate;
|
||||
|
||||
|
||||
|
||||
// ----------------- Constructor ---------------------
|
||||
|
||||
/// <summary> Retrieve capabilities of a video device </summary>
|
||||
internal VideoCapabilities(IAMStreamConfig videoStreamConfig)
|
||||
{
|
||||
if ( videoStreamConfig == null )
|
||||
throw new ArgumentNullException( "videoStreamConfig" );
|
||||
|
||||
AMMediaType mediaType = null;
|
||||
VideoStreamConfigCaps caps = null;
|
||||
IntPtr pCaps = IntPtr.Zero;
|
||||
IntPtr pMediaType;
|
||||
try
|
||||
{
|
||||
// Ensure this device reports capabilities
|
||||
int c, size;
|
||||
int hr = videoStreamConfig.GetNumberOfCapabilities( out c, out size );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
if ( c <= 0 )
|
||||
throw new NotSupportedException( "This video device does not report capabilities." );
|
||||
if ( size > Marshal.SizeOf( typeof( VideoStreamConfigCaps ) ) )
|
||||
throw new NotSupportedException( "Unable to retrieve video device capabilities. This video device requires a larger VideoStreamConfigCaps structure." );
|
||||
if ( c > 1 )
|
||||
Debug.WriteLine("This video device supports " + c + " capability structures. Only the first structure will be used." );
|
||||
|
||||
// Alloc memory for structure
|
||||
pCaps = Marshal.AllocCoTaskMem( Marshal.SizeOf( typeof( VideoStreamConfigCaps ) ) );
|
||||
|
||||
// Retrieve first (and hopefully only) capabilities struct
|
||||
hr = videoStreamConfig.GetStreamCaps( 0, out pMediaType, pCaps );
|
||||
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
|
||||
|
||||
// Convert pointers to managed structures
|
||||
mediaType = (AMMediaType) Marshal.PtrToStructure( pMediaType, typeof( AMMediaType ) );
|
||||
caps = (VideoStreamConfigCaps) Marshal.PtrToStructure( pCaps, typeof( VideoStreamConfigCaps ) );
|
||||
|
||||
// Extract info
|
||||
InputSize = caps.InputSize;
|
||||
MinFrameSize = caps.MinOutputSize;
|
||||
MaxFrameSize = caps.MaxOutputSize;
|
||||
FrameSizeGranularityX = caps.OutputGranularityX;
|
||||
FrameSizeGranularityY = caps.OutputGranularityY;
|
||||
MinFrameRate = (double)10000000 / caps.MaxFrameInterval;
|
||||
MaxFrameRate = (double)10000000 / caps.MinFrameInterval;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( pCaps != IntPtr.Zero )
|
||||
Marshal.FreeCoTaskMem( pCaps ); pCaps = IntPtr.Zero;
|
||||
if ( mediaType != null )
|
||||
DsUtils.FreeAMMediaType( mediaType ); mediaType = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\obj\Debug\ResolveAssemblyReference.cache
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\bin\Debug\DirectX.Capture.dll
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\bin\Debug\DirectX.Capture.pdb
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\bin\Debug\DShowNET.dll
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\bin\Debug\DShowNET.pdb
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\obj\Debug\DirectX.Capture.dll
|
||||
C:\Users\Pete\Documents\DirectXCapture_demo_Enhanced\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\obj\Debug\DirectX.Capture.pdb
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DirectX.Capture\bin\Debug\DirectX.Capture.dll
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DirectX.Capture\bin\Debug\DirectX.Capture.pdb
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DirectX.Capture\bin\Debug\DShowNET.dll
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DirectX.Capture\bin\Debug\DShowNET.pdb
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DirectX.Capture\obj\Debug\ResolveAssemblyReference.cache
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DirectX.Capture\obj\Debug\DirectX.Capture.dll
|
||||
C:\Users\Pete\Dropbox\Projects\Fun\PoolVision\PoolVision\DirectX.Capture\obj\Debug\DirectX.Capture.pdb
|
||||
Binary file not shown.
Binary file not shown.
Loaded 100 of 125 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user