GetDeinterlaceModeCaps() returns negative value RRS feed

  • Question


    hi all,


    i am trying add deinterlacing finctionality to my application. But i have problem in GetDeinterlaceModeCaps() function which is returning negative value, but i have registered DScaler deinterlace filter.


    Please help me out of this problem

    Wednesday, June 18, 2008 9:15 AM


All replies

  • It returns a HRESULT so post the exact value it returns and maybe someone can help you out.
    Wednesday, June 18, 2008 10:48 AM
  • thanks for the reply, i have developed the application using C#, so the return value for the GetDeinterlaceModeCaps() is -2147024809, which i think is invalid pointer error code (correct me if i am worng over here). Below is the code which i am calling to get the deinterlace registered on my computer.


    int noOfDeinterlace = 0;

    hr = deinterlaceCtrl.GetNumberOfDeinterlaceModes(ref vmrVideoDesc, ref noOfDeinterlace, null);

    if (noOfDeinterlace != 0)


    Guid[] noGuidMode = new Guid[noOfDeinterlace];

    hr = deinterlaceCtrl.GetNumberOfDeinterlaceModes(ref vmrVideoDesc, ref noOfDeinterlace, noGuidMode);

    for (int i = 0; i < noOfDeinterlace; i++)


    VMR9DeinterlaceCaps capsDeinterlace = new VMR9DeinterlaceCaps();

    //capsDeinterlace.dwSize = sizeof(VMR9DeinterlaceCaps);

    capsDeinterlace.dwSize = Marshal.SizeOf(typeof(VMR9DeinterlaceCaps));

    hr = deinterlaceCtrl.GetDeinterlaceModeCaps(noGuidModeIdea, ref vmrVideoDesc, ref capsDeinterlace);


    hr = deinterlaceCtrl.SetDeinterlaceMode(0, noGuidMode[0]);

    hr = deinterlaceCtrl.SetDeinterlacePrefs(VMR9DeinterlacePrefs.NextBest);




    Red Marked line is where i am getting negative value as return value. So please help me out on this issue

    Wednesday, June 18, 2008 11:56 AM
  • The error you got is E_INVALIDARG so what I would check is that the array of Guids seem correct and that vmrVideoDesc is also correct. I assume you just removed the error-checking before posting the code?
    Sorry, I can't help you more than this since I haven't used any deinterlacing in my projects.
    Wednesday, June 18, 2008 12:19 PM
  • i am still getting the negative value.... can anyone help me on this

    Wednesday, June 18, 2008 12:39 PM
  • Are you using DirectShowNet?  If so, you might check out the test code for that method at http://directshownet.cvs.sourceforge.net/directshownet/directshowlib/Test/v1.1/IVMRDeinterlaceControl9Test.cs?revision=1.1&view=markup.


    DirectShowNet can be downloaded at http://directshownet.sourceforge.net.

    Wednesday, June 18, 2008 4:07 PM
  • thanks for the reply... this link helped me a little, previously i wasn't assigning VMR9VideoDesc.InputSampleFreq & VMR9VideoDesc.OutputFrameFreq value. Now I have fixed this.


    Even after doing this, i am getting same return value....


    can anyone help on this

    Thursday, June 19, 2008 11:53 AM
  • Can you post the array of Guids here? It's still E_INVALIDARG so it's the array of Guids or VMR9VideoDesc.
    Does the function ever return another value or does the error happen when i==0?
    Thursday, June 19, 2008 12:23 PM
  • i am only getting only one guid, i have registered DScaler one, i think this is the one.....

    the guid retuned is {335aa36e-7884-43a4-9c91-7f87faf3e37e}

    Thursday, June 19, 2008 12:56 PM