cngreatwall

赫赫盛唐艺轩

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2011年9月2日

摘要: 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 阅读全文
posted @ 2011-09-02 11:46 cngreatwall 阅读(360) 评论(0) 推荐(0) 编辑

摘要: 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 阅读全文
posted @ 2011-09-02 11:44 cngreatwall 阅读(731) 评论(0) 推荐(0) 编辑

摘要: 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 = 阅读全文
posted @ 2011-09-02 11:42 cngreatwall 阅读(405) 评论(0) 推荐(0) 编辑

摘要: 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 阅读全文
posted @ 2011-09-02 11:40 cngreatwall 阅读(374) 评论(0) 推荐(0) 编辑

摘要: 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 阅读全文
posted @ 2011-09-02 11:39 cngreatwall 阅读(544) 评论(0) 推荐(0) 编辑

摘要: 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 阅读全文
posted @ 2011-09-02 11:37 cngreatwall 阅读(890) 评论(0) 推荐(0) 编辑

摘要: 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 阅读全文
posted @ 2011-09-02 11:35 cngreatwall 阅读(579) 评论(0) 推荐(0) 编辑