directshow播放dvd
给大伙看看我的代码:
hr = CoCreateInstance(CLSID_DvdGraphBuilder,NULL,CLSCTX_INPROC_SERVER,
IID_IDvdGraphBuilder,(void**)(&pDvdGB));
pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl) ;
pGraph->QueryInterface(IID_IMediaEventEx, (void **)&pEvent);
hr = pDvdGB->RenderDvdVideoVolume(wFile, AM_DVD_HWDEC_PREFER, &buildStatus);//wFile是我的VOB文件的在电脑上的绝对路径
hr = pDvdGB->GetDvdInterface(IID_IDvdInfo2, reinterpret_cast<void**>(&pDvdInfo));
hr = pDvdGB->GetDvdInterface(IID_IDvdControl2, reinterpret_cast<void**>(&pDvdControl));
hr = pDvdGB->GetDvdInterface(IID_IAMLine21Decoder, reinterpret_cast<void**>(&pLine21Dec);
pControl->Run();
代码编译没有错!单数不能播放VOB 我想问问是不是我理解错了>RenderDvdVideoVolume 这个函数。
还有播放视频应该使用IDvdControl2的PlayTitle
msdn
HRESULT PlayTitle(
ULONG uiTitle,
[in] DWORD dwFlags,
[out] IDvdCmd **ppCmd
);
uiTitle
Value that specifies the title number; this value must be from 1 through 99.
dwFlags [in]
Bitwise OR of one or more flags from the DVD_CMD_FLAGS enumeration, specifying how to synchronize the command.
ppCmd [out]
Receives a pointer to an IDvdCmd object that can be used to synchronize DVD commands. The caller must release the interface. This parameter can be NULL. For more information, see Synchronizing DVD Commands.
如果使用PlayTitle的话,我的VOB 文件要怎么传进去呢?
如果我的错了,请告诉我要怎么调用!很急。。。
qq:1914103452