alarco (Programmer) (OP)
11 Aug 04 13:50
Basically, I'm developped a filter that receive MPEG2 video over the internet. It works very well when using GraphEdit:
MyRecvFilter->MS MPEG2 Demux->Elecard MPEG2 Decoder->VR
I just want to code it, so here the main lines:
IGraphBuilder *pGraph = NULL;
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph);
IBaseFilter *pBaseDemux = NULL;
CoCreateInstance(CLSID_MPEG2Demultiplexer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pBaseDemux);
IMpeg2Demultiplexer *pDemux = NULL;
pBaseDemux->QueryInterface(IID_IMpeg2Demultiplexer, (void **)&pDemux);
mt.majortype = MEDIATYPE_Stream;
mt.subtype = MEDIASUBTYPE_MPEG2_PROGRAM
mt.formattype = FORMAT_None;
//(media types are okay)
IPin *pPinDemux = NULL;
pDemux->CreateOutputPin(&mt, L"video pin", &pPinDemux);
IMPEG2PIDMap *pPidMapDemux = NULL;
pPinDemux->QueryInterface(IID_IMPEG2PIDMap, (void **)&pPidMapDemux);
and here it fails!
When running from MSVC++, HRESULT dont have time to returns value : got a "Protection Error", telling me that a debugger is detected ?!
When launching the exec file, HRESULT returns 0x80040217, which means that The specified object was not found.
What's wrong with the code ?
Thanks for you time!