Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Adding Filter by Class ID

Adding Filter by Class ID

Scheduled Pinned Locked Moved COM
helptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Raja Bose C Leo
    wrote on last edited by
    #1

    Hi all, Can anyone tell me how to add a filter by Class ID and relate it with IBaseFilter Interface. I mean I have the filter Class ID from the graphedit application not something like CLSID_FilterName.Can anyone help me with this? Thank You. With regards

    Raja Bose

    R 1 Reply Last reply
    0
    • R Raja Bose C Leo

      Hi all, Can anyone tell me how to add a filter by Class ID and relate it with IBaseFilter Interface. I mean I have the filter Class ID from the graphedit application not something like CLSID_FilterName.Can anyone help me with this? Thank You. With regards

      Raja Bose

      R Offline
      R Offline
      rjkg
      wrote on last edited by
      #2

      write the following code IGraphBuilder* g_pGraphBuilder; IBaseFilter *MyFilter; HRESULT hr hr=AddFilterByCLSID(g_pGraphBuilder,CLSID_VideoRenderer,NULL,&VideoRendrer); where the function is HRESULT AddFilterByCLSID( IGraphBuilder *pGraph, // Pointer to the Filter Graph Manager. const GUID& clsid, // CLSID of the filter to create. LPCWSTR wszName, // A name for the filter. IBaseFilter **ppF) // Receives a pointer to the filter. { if (!pGraph || ! ppF) return E_POINTER; *ppF = 0; IBaseFilter *pF = 0; HRESULT hr = CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, reinterpret_cast(&pF)); if (SUCCEEDED(hr)) { hr = pGraph->AddFilter(pF, wszName); if (SUCCEEDED(hr)) *ppF = pF; else pF->Release(); } return hr; }

      RajeshGupta

      R 1 Reply Last reply
      0
      • R rjkg

        write the following code IGraphBuilder* g_pGraphBuilder; IBaseFilter *MyFilter; HRESULT hr hr=AddFilterByCLSID(g_pGraphBuilder,CLSID_VideoRenderer,NULL,&VideoRendrer); where the function is HRESULT AddFilterByCLSID( IGraphBuilder *pGraph, // Pointer to the Filter Graph Manager. const GUID& clsid, // CLSID of the filter to create. LPCWSTR wszName, // A name for the filter. IBaseFilter **ppF) // Receives a pointer to the filter. { if (!pGraph || ! ppF) return E_POINTER; *ppF = 0; IBaseFilter *pF = 0; HRESULT hr = CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, reinterpret_cast(&pF)); if (SUCCEEDED(hr)) { hr = pGraph->AddFilter(pF, wszName); if (SUCCEEDED(hr)) *ppF = pF; else pF->Release(); } return hr; }

        RajeshGupta

        R Offline
        R Offline
        Raja Bose C Leo
        wrote on last edited by
        #3

        Hi Rajesh, Thank you very much for replying, As you said in the following case IGraphBuilder* g_pGraphBuilder; IBaseFilter *MyFilter; HRESULT hr hr=AddFilterByCLSID(g_pGraphBuilder,CLSID_VideoRenderer,NULL,&VideoRendrer); CLSID_VideoRenderer this one is not known to me. The classid like 2345-2445-3245-543456 (for example CLSID_VideoRenderer = 2345-2445-3245-543456)which I got from DxFilterSpy.exe is known to me. So can you tell me how do I add this Classid in my application and relate it to my base class filter Awaiting for your reply Thank You With regards

        Raja Bose

        R 1 Reply Last reply
        0
        • R Raja Bose C Leo

          Hi Rajesh, Thank you very much for replying, As you said in the following case IGraphBuilder* g_pGraphBuilder; IBaseFilter *MyFilter; HRESULT hr hr=AddFilterByCLSID(g_pGraphBuilder,CLSID_VideoRenderer,NULL,&VideoRendrer); CLSID_VideoRenderer this one is not known to me. The classid like 2345-2445-3245-543456 (for example CLSID_VideoRenderer = 2345-2445-3245-543456)which I got from DxFilterSpy.exe is known to me. So can you tell me how do I add this Classid in my application and relate it to my base class filter Awaiting for your reply Thank You With regards

          Raja Bose

          R Offline
          R Offline
          rjkg
          wrote on last edited by
          #4

          CLSID_VideoRenderer defined in uuids.h header file in directx sdk if you want to include any CLSID that is not in uuids.h the see DirectShow FAQ in directshow helpfile

          RajeshGupta

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups