AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

FileVideoSource PreventFreezing stopped working

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

FileVideoSource PreventFreezing stopped working

Postby azx656254 » Fri Apr 21, 2017 5:47 am

The PreventFreezing property in AForge.Video.DirectShow FileVideoSource no longer works for me and my application now stalls when the property is set. The property used to work before I did a re-installation of Windows. I took a look at the FileVideoSource source code and thought that maybe I could add the filters that Graph.Render() automatically adds, which I found using graphedt, but that didn't seem to work. Does anyone have any idea how to fix this?
azx656254
 
Posts: 2
Joined: Thu Apr 20, 2017 3:23 pm

Re: FileVideoSource PreventFreezing stopped working

Postby azx656254 » Wed May 17, 2017 12:57 pm

I think that a work around for this may be to connect the Null Renderer filter to the sample grabber filter, as that seems to work for the DxScan sample included in the directshow.net library. I tried to implement this but the BufferCB method was never run.

This is the code that I added to the File Video Source.
Code: Select all
                // get type for null render filter               
                type = Type.GetTypeFromCLSID(Clsid.NullRenderer);
                if (type == null)
                    throw new ApplicationException("Failed creating null renderer");

                //Create the null render filter.
                nullRenderObject = Activator.CreateInstance(type);
                nullRenderFilter = (IBaseFilter)nullRenderObject;

                // connect null renderer to grabber filter
                inPin = Tools.GetInPin(nullRenderFilter, 0);
                outPin = Tools.GetOutPin(grabberBase, 0);
                graph.Connect(outPin, inPin);
                Marshal.ReleaseComObject(outPin);
                Marshal.ReleaseComObject(inPin);


I also added the NullRenderer CsID in the Uuids class. I got this id from Graph Edit.
Code: Select all
        public static readonly Guid NullRenderer =
            new Guid(0xC1F400A4, 0x3F08, 0x11D3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37);
azx656254
 
Posts: 2
Joined: Thu Apr 20, 2017 3:23 pm




Return to AForge.NET Framework