Samplegrabber Changes

I made some changes in native part of library (Samplegrabber) now we can use up to 3 samplegrabbers in the same time and now you can PIvoke for samplegrabber like in bellow code:

[DllImport("DirectShowNETCF.Native.dll")]
private static extern IntPtr GetBaseFilter(int index);

[DllImport("DirectShowNETCF.Native.dll")]
private static extern void DeleteBaseFilter(int index);

also interface IBaseFrame has been changed:

[ComVisible(true), ComImport,
Guid("2B21644A-D405-4E27-A51C-A4812bE0CE4C"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IGetFrame
{
[PreserveSig]
int getFrame(IntPtr pBuff);

[PreserveSig]
int getSize([Out] out long size);

[PreserveSig]
int getFrameParams(
[Out] out int width,
[Out] out int height,
[Out] out RawFrameFormat format);

[PreserveSig]
int drawText(
[In] IntPtr ptr,
[In] int height,
[In] int width);

[PreserveSig]
int stopDraw();

[PreserveSig]
int getGrayScale(IntPtr ptr);

[PreserveSig]
int getRgb(IntPtr ptr);

[PreserveSig]
int drawTarget();

[PreserveSig]
int stopDrawTarget();
}

all this changes was made for new functionality (grabbing rgb or grayscale frames for RGB565 or YV12 fromats, drawing target on preview, using more then 1 sample grabber in 1 application)

You can check updated AMCamera example from DirectShowNETCF

Leave a Reply