windowsvisual-c++directshowmpeg2-tsdvb

How to use DvbSiparser.h to parser mpeg2 TS in vc++?


I have a Mpeg2 TS should be analyze. I m using a header file introduced in Windows Kit ver 8 (or 8.1) named Dvbsiparser.h.
I know (but not sure) I should build a filter graph and then add tow important filter:
1. Mpeg2 Sections and table 2. Mpeg2 Transport Information After then, I use a IDvbSiParser obj to analyze stream. When I want to instantiate IDvbSiParser:

CoCreateInstance(__uuidof(IDvbSiParser), ..., ..., IID_IDvbSiParser, ...)

I get Link error: Unresolved external IID_IDvbSiParser.

I use Visual stdio 2013, .Net 4.5 and msvc++. I also included stream.h and link winmm.lib, strmbased.lib, msvcrtd.lib and strmiids.lib and set true lib path to windows kit. All other objects are created except IDvbSiParser.

Should I use another lib or include another header file? How can I find proper lib for IID_IDvbSiParser? Thanks.


Solution

  • After all I read MSDN about DvbSiParser2 again and faced this important note:

    The IDvbSiParser2 interface inherits from IDvbSiParser. IDvbSiParser2 also has these types of members:

    So, we can use IDvbSiParser2 instead of IDvbSiParser, Because we have know have proper and true CLSID for IDvbSiParser have mentioned in IDvbSiParser2 MSDN Doc. Next step including defining new GUID variable like this:

    GUID CLSID_IDvbSiParser2 = {0xF6B96EDA, 0x1A94, 0x4476, 0xA8, 0x5F, 0X4D, 0x3D, 0xC7, 0xB3, 0x9C, 0x3F};
    IDvbSiParser2 *ppdvbsp;
    HRESULT hr = CoCreateInstance(CLSID_IDvbSiParser2, NULL, CLSCTX_INPROC_SERVER, __uuidof(IDvbSiParser2), void **( pDvbsiparser ));
    if (SUCCEEDED(hr)) { lab lab lab};
    

    I think you will get S_OK as I did.