资源简介

directshow实务精选光盘 免积分下载

资源截图

代码片段和文件信息

//
// CMPEG1Builder.cpp
//

#include 
#include “FltGuids.h“
#include “CMPEG1Builder.h“

/////////////////////////////////////////////////////////////////////////////
CMPEG1Builder::CMPEG1Builder(LPUNKNOWN pUnk HRESULT *phr) :
CUnknown(NAME(“MPEG1 Builder“) pUnk)
{
}

CMPEG1Builder::~CMPEG1Builder()
{
}

//
// Expose our own interface
STDMETHODIMP CMPEG1Builder::NonDelegatingQueryInterface(REFIID riid void ** ppv)
{
CheckPointer(ppv E_POINTER);

if (riid == IID_IMPEG1Builder) 
{
return GetInterface((IMPEG1Builder *) this ppv);
}
else if (riid == IID_IDistributorNotify)
{
return GetInterface((IDistributorNotify *) this ppv);
}
else
{
return CUnknown::NonDelegatingQueryInterface(riid ppv);
}
}

// --- IMPEG1Builder methods ---
STDMETHODIMP CMPEG1Builder::IsMPEG1File(const char * inFilePath)
{
IGraphBuilder * pBuilder = RetrieveGraphBuilder();

// Create a file source filter
IbaseFilter * pSource = NULL;
WCHAR  wcFilePath[MAX_PATH];
MultiByteToWideChar(CP_ACP 0 inFilePath -1 wcFilePath MAX_PATH);
pBuilder->AddSourceFilter(wcFilePath L“Source“ &pSource);
pSource->Release();

// Create microsoft MPEG-1 Stream Splitter
IbaseFilter * pSplitter = NULL;
CoCreateInstance(CLSID_MPEG1Splitter  NULL CLSCTX_INPROC_SERVER
IID_IbaseFilter (void **)&pSplitter);
pBuilder->AddFilter(pSplitter L“MPEG-1 Splitter“);
pSplitter->Release();

// Try to connect them...
IPin * pOut = GetPinByDirection(pSource PINDIR_OUTPUT);
IPin * pIn  = GetPinByDirection(pSplitter PINDIR_INPUT);
HRESULT hr  = pBuilder->ConnectDirect(pOut pIn NULL);

pBuilder->RemoveFilter(pSplitter);
pBuilder->RemoveFilter(pSource);

return SUCCEEDED(hr) ? S_OK : S_FALSE;
}

STDMETHODIMP CMPEG1Builder::RenderMPEG1File(const char * inFilePath)
{
IGraphBuilder * pBuilder = RetrieveGraphBuilder();

// Create a file source filter
IbaseFilter * pSource = NULL;
WCHAR  wcFilePath[MAX_PATH];
MultiByteToWideChar(CP_ACP 0 inFilePath -1 wcFilePath MAX_PATH);
pBuilder->AddSourceFilter(wcFilePath L“Source“ &pSource);
pSource->Release();

// Create microsoft MPEG-1 Stream Splitter
IbaseFilter * pSplitter = NULL;
CoCreateInstance(CLSID_MPEG1Splitter  NULL CLSCTX_INPROC_SERVER
IID_IbaseFilter (void **)&pSplitter);
pBuilder->AddFilter(pSplitter L“MPEG-1 Splitter“);
pSplitter->Release();

// Create microsoft MPEG-1 Video Decoder
IbaseFilter * pVideoDec = NULL;
CoCreateInstance(CLSID_CMpegVideoCodec NULL CLSCTX_INPROC_SERVER
IID_IbaseFilter (void **)&pVideoDec);
pBuilder->AddFilter(pVideoDec L“MPEG-1 Video Decoder“);
pVideoDec->Release();

// Create microsoft MPEG-1 Audio Dedocer
IbaseFilter * pAudioDec = NULL;
CoCreateInstance(CLSID_CMpegAudioCodec NULL CLSCTX_INPROC_SERVER
IID_IbaseFilter (void **)&pAudioDec);
pBuilder->AddFilter(pAudioDec L“MPEG-1 Audio Decoder“);
pAudioDec->Release();

// Connect filte

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ......R     77824  2004-04-20 19:45  实务精选2\Bin\AVCap.exe

    ......R     77824  2004-04-20 19:48  实务精选2\Bin\AVChat.exe

    ......R     94208  2004-04-20 19:52  实务精选2\Bin\ball.ax

    ......R     73728  2004-04-20 19:56  实务精选2\Bin\Blender9.exe

    ......R    700416  2004-04-20 19:55  实务精选2\Bin\BmpMix9.exe

    ......R     65536  2004-04-20 20:00  实务精选2\Bin\DesTlSrc.ax

    ......R     98304  2004-04-20 19:54  实务精选2\Bin\dsnet.ax

    ......R    114688  2004-04-20 20:00  实务精选2\Bin\dump.ax

    ......R     57344  2004-04-20 19:50  实务精选2\Bin\FltNtrcvr.ax

    ......R     49152  2004-04-20 19:45  实务精选2\Bin\HqGrbr.ax

    ......R     61440  2004-04-20 19:53  实务精选2\Bin\Hqtlystd.ax

    ......R     49152  2004-04-20 19:51  实务精选2\Bin\Hqvk.ax

    ......R     45056  2004-04-20 19:55  实务精选2\Bin\mpg2tssrc.ax

    ......R     20480  2004-04-20 19:48  实务精选2\Bin\MulticastClient.exe

    ......R     20480  2004-04-20 19:48  实务精选2\Bin\MulticastServer.exe

    ......R     24576  2004-04-20 19:56  实务精选2\Bin\PidMpg1.dll

    ......R     24576  2004-04-20 19:56  实务精选2\Bin\PIDTest.exe

    ......R     61440  2004-04-20 20:00  实务精选2\Bin\qqsrc.ax

    ......R     28672  2004-04-20 19:53  实务精选2\Bin\SimplePlayer.exe

    ......R     24576  2004-04-20 19:49  实务精选2\Bin\TCPClient.exe

    ......R     24576  2004-04-20 19:49  实务精选2\Bin\TCPServer.exe

    ......R     61440  2004-04-20 19:55  实务精选2\Bin\Ticker9.exe

    ......R      3988  2004-04-20 19:59  实务精选2\Bin\titleSource.tlb

    ......R     24576  2004-04-20 19:49  实务精选2\Bin\UDPClient.exe

    ......R     20480  2004-04-20 19:50  实务精选2\Bin\UDPServer.exe

    ......R     40960  2004-04-20 19:50  实务精选2\Bin\VODClient.exe

    ......R     40960  2004-04-20 19:51  实务精选2\Bin\VODServer.exe

    ......R      1725  2003-06-18 16:08  实务精选2\Readme.txt

    ......R      6858  2004-02-21 10:19  实务精选2\《DirectShow实务精选》\Appendix_B\PidMpeg1\CMPEG1Builder.cpp

    ......R      1133  2003-12-30 13:49  实务精选2\《DirectShow实务精选》\Appendix_B\PidMpeg1\CMPEG1Builder.h

............此处省略363个文件信息

评论

共有 条评论