Seeking keyframes using DirectShowNet

只愿长相守 提交于 2019-12-08 05:27:28

ok..I have finally been able to solve that problem. I would describe it here in case it helps anyone else. I was not actually releasing the IMediaSample object in the callback method. That is a must to do, it being a COM object.

On simply adding the Marshal.ReleaseComObject() to my SampleCB() callback method, it is now called everytime the SampleGrabber grabs a sample.

public int SampleCB ( double sampleTime, IMediaSample mediaSample )
{
    Console.WriteLine ( "SampleCB Callback" );
    Console.WriteLine ( mediaSample.IsSyncPoint ( ) + " " );

        /* other code */
    Marshal.ReleaseComObject ( mediaSample );
    return 0;
}

I am facing another issue now. However, I have made another post for that as it doesnt totally relate to this question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!