Click here to Skip to main content
15,917,481 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a problem in adding "LAV Splitter Source" filter in the graph using directshow. If i give mp4 format file as a source file the "LAV Splitter Source" filter was created with 2 output pin(video and audio).
ex:
C#
IGraphBuilder::AddSourceFilter(L"C:\\video.mp4",L"LAV Splitter Source",&pLAVSplitterSource);

But if i give avi file format as a source file the "LAV Splitter Source" filter was created with only 1 output pin(video).
ex:
C#
IGraphBuilder::AddSourceFilter(L"C:\\video.avi",L"LAV Splitter Source",&pLAVSplitterSource);

What i need to do to get both output pin?
Posted
Updated 5-Feb-13 23:36pm
v4

1 solution

I have solved this myself by using the below code rather than using AddSourceFilter function.
C#
hr = CoCreateInstance(CLSID_LAV_SPLITTER_SOURCE, NULL, CLSCTX_INPROC_SERVER,
                        IID_IBaseFilter, (void **)&pLAVSplitterSource);
     if (FAILED(hr))
    {
        MessageBox(hwnd,L"ERROR - Could not create the LAV.",L"Error",0);
    }
    hr = pLAVSplitterSource->QueryInterface(IID_IFileSourceFilter,(void **)&pLAV);
    hr = pLAV->Load(strFilename,NULL);
    hr = pGraph->AddFilter(pLAVSplitterSource,L"LAV");


Now its created in both the formats what i was expected.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900