// AForge Direct Show Library
// AForge.NET framework
//
// Copyright © Andrew Kirillov, 2007
// andrew.kirillov@gmail.com
//
namespace AForge.Video.DirectShow.Internals
{
using System;
using System.Runtime.InteropServices;
///
/// The interface is exposed by the Sample Grabber Filter. It enables an application to retrieve
/// individual media samples as they move through the filter graph.
///
///
[ComImport,
Guid("6B652FFF-11FE-4FCE-92AD-0266B5D7C78F"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface ISampleGrabber
{
///
/// Specifies whether the filter should stop the graph after receiving one sample.
///
///
/// Boolean value specifying whether the filter should stop the graph after receiving one sample.
///
/// Return's HRESULT error code.
///
[PreserveSig]
int SetOneShot( [In, MarshalAs( UnmanagedType.Bool )] bool oneShot );
///
/// Specifies the media type for the connection on the Sample Grabber's input pin.
///
///
/// Specifies the required media type.
///
/// Return's HRESULT error code.
///
[PreserveSig]
int SetMediaType( [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType );
///
/// Retrieves the media type for the connection on the Sample Grabber's input pin.
///
///
/// structure, which receives media type.
///
/// Return's HRESULT error code.
///
[PreserveSig]
int GetConnectedMediaType( [Out, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType );
///
/// Specifies whether to copy sample data into a buffer as it goes through the filter.
///
///
/// Boolean value specifying whether to buffer sample data.
/// If true, the filter copies sample data into an internal buffer.
///
/// Return's HRESULT error code.
///
[PreserveSig]
int SetBufferSamples( [In, MarshalAs( UnmanagedType.Bool )] bool bufferThem );
///
/// Retrieves a copy of the sample that the filter received most recently.
///
///
/// Pointer to the size of the buffer. If pBuffer is NULL, this parameter receives the required size.
/// Pointer to a buffer to receive a copy of the sample, or NULL.
///
/// Return's HRESULT error code.
///
[PreserveSig]
int GetCurrentBuffer( ref int bufferSize, IntPtr buffer );
///
/// Not currently implemented.
///
///
///
///
/// Return's HRESULT error code.
///
[PreserveSig]
int GetCurrentSample( IntPtr sample );
///
/// Specifies a callback method to call on incoming samples.
///
///
/// interface containing the callback method, or NULL to cancel the callback.
/// Index specifying the callback method.
///
/// Return's HRESULT error code.
///
[PreserveSig]
int SetCallback( ISampleGrabberCB callback, int whichMethodToCallback );
}
}