Using ISampleGrabberCB SampleCB in C# PDF Print E-mail
Written by Daniel P   
Monday, 03 October 2005

I've tried before to use this method in C# but I failed. I don't think I have seen code using it on the net. So here is a snippet using it. The important line is the second last one, it seems that you have to call "Marshal.ReleaseComObject".

unsafe int ISampleGrabberCB.SampleCB( double SampleTime, IMediaSample pSample )
{
IntPtr ptr;
pSample.GetPointer( out ptr );
byte *b = (byte *)ptr;
for (int x = 1; x <= videoHeight; x++)
{
for (int y = 0; y < videoStride; y++)
{
*b ^= 0xff;
b++;
}

b = (byte *)(ptr);
b += (x * videoStride);
}
Marshal.ReleaseComObject( pSample ); 
return 0;
}

With this simple modification, the CsEzRgb24 sample can be made to run using the BufferCB or the SampleCB callback.




Bookmark it...
Digg!Reddit!Del.icio.us!Google!Facebook!Slashdot!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!
 
Using the IVMRImageCompositor9 interface in C# PDF Print E-mail
Written by Daniel P   
Tuesday, 20 September 2005

I have implemented a version of the Cube sample from the DirectShow SDK in C#. You can find more info here.




Bookmark it...
Digg!Reddit!Del.icio.us!Google!Facebook!Slashdot!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!
 
<< Start < Prev 11 12 13 14 15 16 17 18 19 20 Next > End >>

Results 65 - 68 of 81
Joomla Template by Joomlashack
Joomla Templates by JoomlaShack Joomla Templates by Compass Design