CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  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.

  2. #2
    Join Date
    Oct 2005
    Location
    Aix en Provence, France
    Posts
    5

    Re: Connect two input pin to Smart Tee

    The smart tee is a strange component :

    The Smart Tee filter is used in video capture graphs to split the video stream into a preview stream and a capture stream. This is done without any additional data copying.
    In other words, the smart tee does not allocate a sample for preview...
    There is no extra sample travelling in the preview path, just a reference to the actual sample used by the capture path. This is why you cannot put the sample grabber there.
    So I suggest that you insert the sample grabber in the capture path. This should not cause any problem.

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