Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ MFC VC++
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:
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:
IGraphBuilder::AddSourceFilter(L"C:\\video.avi",L"LAV Splitter Source",&pLAVSplitterSource);

What i need to do to get both output pin?
Posted 5-Feb-13 20:29pm
Edited 6-Feb-13 0:36am
v4

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I have solved this myself by using the below code rather than using AddSourceFilter function.
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 386
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 215
3 /\jmot 189
4 Praneet Nadkar 173
0 OriginalGriff 8,289
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,624
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100