CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Sep 2003
    Posts
    280

    Connect two input pin to Smart Tee

    Hi,
    I would like to capture live video, preview live video and grab live video.
    But I find that the input pin of SampleGrab can't connect to the output Preview pin of Smart Tee.
    Could someone tell me how to coonect between Smart Tee's Preview Pin and SampleGrab's input Pin ?
    Thank you!
    Code:
    pFilterGraph->AddFilter(pSourceFilter,L"Source Filter");
    pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,&MEDIATYPE_Video,pSourceFilter,NULL,NULL);         
    pCaptureGraphBuilder->SetOutputFileName(&MEDIASUBTYPE_Avi,L"Example.avi",&pMux,NULL);
    pCaptureGraphBuilder->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video,pSourceFilter,NULL,pMux);
             
    // Setting of grabbing image 
    IBaseFilter *pSG_Filter;
    IBaseFilter *pNull;
    CoCreateInstance(CLSID_SampleGrabber,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void**)&pSG_Filter);
    pFilterGraph->AddFilter(pSG_Filter, L"SampleGrab");
    
    CoCreateInstance(CLSID_NullRenderer,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void**)&pNull);
    pFilterGraph->AddFilter(pNull, L"NullRender");    
    
    // I get the FAILED
    pCaptureGraphBuilder->RenderStream
    (&PIN_CATEGORY_PREVIEW,&MEDIATYPE_Video,pSourceFilter,pSG_Filter,pNull);
    SaveGraphFile(pFilterGraph, L"C:\\MyGraph.grf");
    Attached Images Attached Images
    Last edited by Cooker; October 6th, 2005 at 04:21 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured