摘要:
HRESULT CVideoSource::GetFameImageFromAVI(TCHAR * szAVIFileSource, TCHAR * szImageFileDest){HRESULT hr;// 定义IMediaDet接口实例CComPtr< IMediaDet > pDet;hr = CoCreateInstance( CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER, IID_IMediaDet, (void**) &pDet );if (FAILED(hr))return hr;// 将影片文件名转换成BSTR类型C 阅读全文
摘要:
HRESULT CVideoSource::RecoderAVIFrames(char* szFile){ HRESULT hr = NULL;OFSTRUCT os;//IBaseFilter *pMux;IFileSinkFilter *pSink;IConfigAviMux * pConfigAviMux;if(OpenFile(szFile, &os, OF_EXIST) == HFILE_ERROR){// bring up dialog, and set new file size/*CFile f;bool bFile = f.Open(szFile,CFile::mod 阅读全文
摘要:
HRESULT CVideoSource::SaveToBmpFile(char* szFile){HRESULT hr =NULL;TRY {BYTE *buffer = NULL; hr = m_pWindowsLessControl->GetCurrentImage(&buffer); if (!SUCCEEDED(hr)) { return hr;}BITMAPFILEHEADER hdr; BITMAPINFOHEADER *lpbi = (BITMAPINFOHEADER *)buffer; //颜色空间转换,如果为32位位图,转换为24bool isSize24 = 阅读全文
摘要:
HRESULT CVideoSource::RenderStream( ){//CoInitialize(NULL);HRESULT hr = NULL;hr=m_pBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,//&PIN_CATEGORY_CAPTURE, // Pin category&MEDIATYPE_Video, // Media typem_pVideoCap, // Capture filterNULL,//m_pVidCompress, // Compression filter (optional)NU 阅读全文
摘要:
HRESULT CVideoSource::AddWindowLessRender( HWND hwndApp, RECT win_rect) // Window to hold the video. { HRESULT hr = NULL;CRect rcSrc, rcDest; hr=CoCreateInstance(CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&m_pVideoRender);if(hr!=S_OK)return hr;// Create the 阅读全文
摘要:
HRESULT CVideoSource::AddVedioPreviewFilter(char* varDeviceName){HRESULT hr = NULL;IMoniker *pMoniker = NULL;IPropertyBag *pPropBag = NULL;BOOL bFind = false;VARIANT varDescriptName;VARIANT varFriendName;VariantInit(&varDescriptName);VariantInit(&varFriendName);// Create the System Device En 阅读全文
摘要:
HRESULT CVideoSource::EnumVideoDevices(){// Create the System Device Enumerator.HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, reinterpret_cast<void**>(&m_pDevEnum));if (FAILED(hr)){return hr;}// Create an enumerator for the video captu 阅读全文