本文整理汇总了C++中ICClose函数的典型用法代码示例。如果您正苦于以下问题:C++ ICClose函数的具体用法?C++ ICClose怎么用?C++ ICClose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ICClose函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: capCaptureAbort
void CMainFrame::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
capCaptureAbort(m_hWndCap);
capDriverDisconnect(m_hWndCap);
Sleep(100);
capSetCallbackOnError(m_hWndCap,NULL);
capSetCallbackOnStatus(m_hWndCap,NULL);
capSetCallbackOnVideoStream(m_hWndCap,NULL);
delete lpbiIn;
delete lpbiTmp;
delete lpbiOut;
if (m_vfwState==ENCDEC){
ICDecompressEnd(hic2);
ICClose(hic2);
ICSeqCompressFrameEnd(&pc);
ICCompressEnd(hic1);
ICClose(hic1);
AVIStreamClose(ps);
if(m_pFile != NULL)
AVIFileRelease(m_pFile);
}
enc_stop();
dec_stop();
Sleep(100);
CFrameWnd::OnClose();
}
示例2: RefreshCodec
void RefreshCodec(HWND hW)
{
char buffer[255];
union {
char chFCC[5];
DWORD dwFCC;
} fcc;
ICINFO icinfo;
memset(&icinfo,0,sizeof(icinfo));
icinfo.dwSize = sizeof(icinfo);
strcpy(fcc.chFCC,"VIDC");
RECORD_COMPRESSION1.hic = ICOpen(fcc.dwFCC,RECORD_COMPRESSION1.fccHandler,ICMODE_QUERY);
if(RECORD_COMPRESSION1.hic)
{
ICGetInfo(RECORD_COMPRESSION1.hic,&icinfo,sizeof(icinfo));
ICClose(RECORD_COMPRESSION1.hic);
wsprintf(buffer,"16 bit Compression: %ws",icinfo.szDescription);
}
else
wsprintf(buffer,"16 bit Compression: Full Frames (Uncompressed)");
SetDlgItemText(hW,IDC_COMPRESSION1,buffer);
memset(&icinfo,0,sizeof(icinfo));
icinfo.dwSize = sizeof(icinfo);
RECORD_COMPRESSION2.hic = ICOpen(fcc.dwFCC,RECORD_COMPRESSION2.fccHandler,ICMODE_QUERY);
if(RECORD_COMPRESSION2.hic)
{
ICGetInfo(RECORD_COMPRESSION2.hic,&icinfo,sizeof(icinfo));
ICClose(RECORD_COMPRESSION2.hic);
wsprintf(buffer,"24 bit Compression: %ws",icinfo.szDescription);
}
else
wsprintf(buffer,"24 bit Compression: Full Frames (Uncompressed)");
SetDlgItemText(hW,IDC_COMPRESSION2,buffer);
}
示例3: test_OpenCase
static void test_OpenCase(void)
{
HIC h;
ICINFO info;
/* Check if default handler works */
h = ICOpen(mmioFOURCC('v','i','d','c'),0,ICMODE_DECOMPRESS);
ok(0!=h,"ICOpen(vidc.0) failed\n");
if (h) {
info.dwSize = sizeof(info);
info.szName[0] = 0;
ICGetInfo(h, &info, sizeof(info));
trace("The default decompressor is %s\n", wine_dbgstr_w(info.szName));
ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
}
h = ICOpen(mmioFOURCC('v','i','d','c'),0,ICMODE_COMPRESS);
ok(0!=h || broken(h == 0),"ICOpen(vidc.0) failed\n"); /* Not present in Win8 */
if (h) {
info.dwSize = sizeof(info);
info.szName[0] = 0;
ICGetInfo(h, &info, sizeof(info));
trace("The default compressor is %s\n", wine_dbgstr_w(info.szName));
ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
}
/* Open a compressor with combinations of lowercase
* and uppercase compressortype and handler.
*/
h = ICOpen(mmioFOURCC('v','i','d','c'),mmioFOURCC('m','s','v','c'),ICMODE_DECOMPRESS);
ok(0!=h,"ICOpen(vidc.msvc) failed\n");
if (h) {
ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
}
h = ICOpen(mmioFOURCC('v','i','d','c'),mmioFOURCC('M','S','V','C'),ICMODE_DECOMPRESS);
ok(0!=h,"ICOpen(vidc.MSVC) failed\n");
if (h) {
ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
}
h = ICOpen(mmioFOURCC('V','I','D','C'),mmioFOURCC('m','s','v','c'),ICMODE_DECOMPRESS);
ok(0!=h,"ICOpen(VIDC.msvc) failed\n");
if (h) {
ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
}
h = ICOpen(mmioFOURCC('V','I','D','C'),mmioFOURCC('M','S','V','C'),ICMODE_DECOMPRESS);
ok(0!=h,"ICOpen(VIDC.MSVC) failed\n");
if (h) {
ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
}
h = ICOpen(mmioFOURCC('v','i','d','c'),mmioFOURCC('m','S','v','C'),ICMODE_DECOMPRESS);
ok(0!=h,"ICOpen(vidc.mSvC) failed\n");
if (h) {
ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
}
h = ICOpen(mmioFOURCC('v','I','d','C'),mmioFOURCC('m','s','v','c'),ICMODE_DECOMPRESS);
ok(0!=h,"ICOpen(vIdC.msvc) failed\n");
if (h) {
ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
}
}
示例4: GetDlgItem
void CVideoOptions::RefreshCompressorButtons()
{
int sel = ((CComboBox *) GetDlgItem(IDC_COMPRESSORS))->GetCurSel();
if (sel != CB_ERR) {
HIC hic = ICOpen(compressor_info[sel].fccType, compressor_info[sel].fccHandler, ICMODE_QUERY);
if (hic) {
if (ICQueryAbout(hic))
((CButton *) GetDlgItem(ID_ABOUT))->EnableWindow(TRUE);
else
((CButton *) GetDlgItem(ID_ABOUT))->EnableWindow(FALSE);
if (ICQueryConfigure(hic))
((CButton *) GetDlgItem(ID_CONFIGURE))->EnableWindow(TRUE);
else
((CButton *) GetDlgItem(ID_CONFIGURE))->EnableWindow(FALSE);
ICClose(hic);
}
}
}
示例5: uninit
// uninit driver
static void uninit(sh_video_t *sh){
HRESULT ret;
vd_vfw_ctx *priv = sh->context;
#ifdef BUILD_VFWEX
ret = ICDecompressEndEx(priv->handle);
#else
ret = ICDecompressEnd(priv->handle);
#endif
if (ret)
{
mp_msg(MSGT_WIN32, MSGL_WARN, "ICDecompressEnd failed: %ld\n", ret);
return;
}
ret = ICClose(priv->handle);
if (ret)
{
mp_msg(MSGT_WIN32, MSGL_WARN, "ICClose failed: %ld\n", ret);
return;
}
free(priv->o_bih);
free(priv);
}
示例6: ZeroMemory
void CPgPubExtra::FillCodecs()
{
m_comboCodec.ResetContent();
m_codecs.Destroy();
BITMAPINFOHEADER bih;
ZeroMemory( &bih, sizeof( bih ) );
bih.biSize = sizeof( bih );
bih.biPlanes = 1;
bih.biCompression = BI_RGB;
bih.biBitCount = 24;
ICINFO ii;
ZeroMemory( &ii, sizeof( ii ) );
ii.dwSize = sizeof( ii );
for ( DWORD i = 0; ICInfo( ICTYPE_VIDEO, i, &ii ); i++ )
{
// This one is valid
DWORD fourCC = ii.fccHandler;
HIC hIc = ICOpen( ii.fccType, ii.fccHandler, ICMODE_QUERY );
if ( hIc != NULL )
{
// Ensure it supports our video type
if ( ii.fccType == ICTYPE_VIDEO &&
// ICCompressQuery( hIc, &bih, NULL ) == ICERR_OK &&
ICGetInfo( hIc, &ii, sizeof( ii ) ) )
{
char str[ 256 ] = { 0 };
wcstombs( str, ii.szDescription, sizeof( str ) );
// Save codec info
LPCODECINFO pci = (LPCODECINFO)m_codecs.NewObj( sizeof( CODECINFO ), NULL, i, str );
if ( pci != NULL )
{
// Save data
pci->bConfig = ICQueryConfigure( hIc ) != ICERR_OK; // Backwards???
pci->fourCC = fourCC;
// Get settings
int item = m_comboCodec.AddString( str );
if ( item != CB_ERR ) m_comboCodec.SetItemData( item, (DWORD)pci );
} // end if
} // end if
ICClose( hIc );
} // end if
// Next codec
ZeroMemory( &ii, sizeof( ii ) );
ii.dwSize = sizeof( ii );
i++;
} // end while
}
示例7: cap_ic_start
int cap_ic_start(cap_cx *cx, char *err)
{
char format[32];
char message[80];
if((cx->ic = ICDecompressOpen(
ICTYPE_VIDEO,
0,
&(cx->pfmt->bmiHeader),
NULL)))
{
cx->outfmtlen = ICDecompressGetFormatSize(cx->ic, cx->pfmt);
if((cx->poutfmt = malloc(cx->outfmtlen)))
{
if(ICDecompressGetFormat(cx->ic, cx->pfmt, cx->poutfmt) == ICERR_OK)
{
if(ICDecompressBegin(cx->ic, cx->pfmt, cx->poutfmt) == ICERR_OK)
{
cx->mode = CAP_USE_IC;
return 1;
}
}
free(cx->poutfmt);
}
ICClose(cx->ic);
}
sprintf(message, "Can't open decompressor for format \"%s\"",
reverse_fourcc(format, cx->pfmt->bmiHeader.biCompression));
set_err(message);
return 0;
}
示例8: ICDecompressEnd
void CvCaptureCAM_VFW::closeHIC()
{
if( hic )
{
ICDecompressEnd( hic );
ICClose( hic );
hic = 0;
}
}
示例9: cap_ic_finish
void cap_ic_finish(cap_cx *cx)
{
if(cx->mode == CAP_USE_IC)
{
ICDecompressEnd(cx->ic);
free(cx->poutfmt);
ICClose(cx->ic);
}
}
示例10: memset
QMap<std::wstring, bool> AviCodecRestrictions::getUsableCodecs(const TDimension &resolution)
{
QMap<std::wstring, bool> codecs;
HIC hic = 0;
ICINFO icinfo;
memset(&icinfo, 0, sizeof(ICINFO));
char descr[2048], name[2048];
DWORD fccType = 0;
BITMAPINFO inFmt;
memset(&inFmt, 0, sizeof(BITMAPINFO));
inFmt.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
inFmt.bmiHeader.biWidth = inFmt.bmiHeader.biHeight = 100;
inFmt.bmiHeader.biPlanes = 1;
inFmt.bmiHeader.biCompression = BI_RGB;
int bpp;
for (bpp = 32; (bpp >= 24); bpp -= 8) {
//find the codec.
inFmt.bmiHeader.biBitCount = bpp;
for (int i = 0; ICInfo(fccType, i, &icinfo); i++) {
hic = ICOpen(icinfo.fccType, icinfo.fccHandler, ICMODE_COMPRESS);
ICGetInfo(hic, &icinfo, sizeof(ICINFO)); // Find out the compressor name
WideCharToMultiByte(CP_ACP, 0, icinfo.szDescription, -1, descr, sizeof(descr), 0, 0);
WideCharToMultiByte(CP_ACP, 0, icinfo.szName, -1, name, sizeof(name), 0, 0);
std::wstring compressorName;
compressorName = toWideString(std::string(name) + " '" + toString(bpp) + "' " + std::string(descr));
if (hic) {
if (ICCompressQuery(hic, &inFmt, NULL) != ICERR_OK) {
ICClose(hic);
continue; // Skip this compressor if it can't handle the format.
}
codecs[compressorName] = canWork(hic, resolution, bpp);
ICClose(hic);
}
}
}
return codecs;
}
示例11: try_driver
static HIC try_driver(driver_info_t *info)
{
HIC hic;
if ((hic = ICOpen(info->fccType, info->fccHandler, info->wMode)))
{
if (!ICSendMessage(hic, info->querymsg, (DWORD_PTR)info->lpbiIn, (DWORD_PTR)info->lpbiOut))
return hic;
ICClose(hic);
}
return 0;
}
示例12: SetVideoCompressState
//Ver 1.2
// Note : Because the program stores the state for only one compressor (in the
// pVideoCompressParams), if the user chooses "Configure" for compressor A, then
// chooses another compressor B and presses "Configure" again the previous state
// info for compressor A will be lost.
void CVideoOptionsDlg::OnConfigure()
{
int sel = m_ctrlCBCompressor.GetCurSel();
if (sel != CB_ERR) {
// Still unable to handle DIVX state (results in error)
//if (pCompressorInfo[sel].fccHandler == mmioFOURCC('D', 'I', 'V', 'X'))
// return;
//TODO, How long is this code stil experimental and soo in use ???
#define EXPERIMENTAL_CODE
#ifdef EXPERIMENTAL_CODE
CHIC chic;
if (chic.Open(pCompressorInfo[sel].fccType, pCompressorInfo[sel].fccHandler, ICMODE_QUERY)) {
// Set our current Video Compress State Info into the hic,
// which will update the ICConfigure Dialog
SetVideoCompressState(chic, chic.Handler());
chic.Configure(m_hWnd);
// Get Video Compress State Info from the hic after adjustment with the
// ICConfigure dialog. This will set the external pVideoCompressParams
// variable which is used by AVICOMPRESSOPTIONS (This means the external
// variable pVideoCompressParams will be changed even if user press "Cancel")
DWORD dwSize = chic.GetStateSize();
LRESULT lResult = chic.GetState(m_cOpts.State(dwSize), dwSize);
// if (lResult != dwSize) ==> C4244 Warning, type mismatch
if ( lResult - dwSize != 0 ) // Save
{
m_cOpts.State(0L);
}
}
#else
HIC hic = ICOpen(pCompressorInfo[sel].fccType, pCompressorInfo[sel].fccHandler, ICMODE_QUERY);
if (hic) {
// Set our current Video Compress State Info into the hic, which will
// update the ICConfigure Dialog
SetVideoCompressState(hic, pCompressorInfo[sel].fccHandler);
ICConfigure(hic, m_hWnd);
// Get Video Compress State Info from the hic after adjustment with the
// ICConfigure dialog. This will set the external pVideoCompressParams
// variable which is used by AVICOMPRESSOPTIONS (This means the external
// variable pVideoCompressParams will be changed even if user press "Cancel")
GetVideoCompressState(hic, pCompressorInfo[sel].fccHandler);
ICClose(hic);
}
#endif
#undef EXPERIMENTAL_CODE
}
}
示例13: ICGetDisplayFormat
/***********************************************************************
* ICGetDisplayFormat [[email protected]]
*/
HIC VFWAPI ICGetDisplayFormat(
HIC hic,LPBITMAPINFOHEADER lpbiIn,LPBITMAPINFOHEADER lpbiOut,
INT depth,INT dx,INT dy)
{
HIC tmphic = hic;
TRACE("(%p,%p,%p,%d,%d,%d)!\n",hic,lpbiIn,lpbiOut,depth,dx,dy);
if (!tmphic) {
tmphic=ICLocate(ICTYPE_VIDEO,0,lpbiIn,NULL,ICMODE_DECOMPRESS);
if (!tmphic)
return tmphic;
}
if ((dy == lpbiIn->biHeight) && (dx == lpbiIn->biWidth))
dy = dx = 0; /* no resize needed */
/* Can we decompress it ? */
if (ICDecompressQuery(tmphic,lpbiIn,NULL) != 0)
goto errout; /* no, sorry */
ICSendMessage(tmphic, ICM_DECOMPRESS_GET_FORMAT, (DWORD_PTR)lpbiIn, (DWORD_PTR)lpbiOut);
if (lpbiOut->biCompression != 0) {
FIXME("Ooch, how come decompressor outputs compressed data (%d)??\n",
lpbiOut->biCompression);
}
if (lpbiOut->biSize < sizeof(*lpbiOut)) {
FIXME("Ooch, size of output BIH is too small (%d)\n",
lpbiOut->biSize);
lpbiOut->biSize = sizeof(*lpbiOut);
}
if (!depth) {
HDC hdc;
hdc = GetDC(0);
depth = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES);
ReleaseDC(0,hdc);
if (depth==15) depth = 16;
if (depth<8) depth = 8;
}
if (lpbiIn->biBitCount == 8)
depth = 8;
TRACE("=> %p\n", tmphic);
return tmphic;
errout:
if (hic!=tmphic)
ICClose(tmphic);
TRACE("=> 0\n");
return 0;
}
示例14: getCodec
void AviCodecRestrictions::openConfiguration(const std::wstring &codecName, void *winId)
{
if (codecName == L"Uncompressed")
return;
//find the codec
int bpp;
HIC hic = getCodec(codecName, bpp);
if (!hic)
return;
ICConfigure(hic, winId);
ICClose(hic);
}
示例15: enum_compressors
static BOOL enum_compressors(HWND list, COMPVARS *pcv, BOOL enum_all)
{
UINT id, total = 0;
ICINFO icinfo;
id = 0;
while (ICInfo(pcv->fccType, id, &icinfo))
{
struct codec_info *ic;
DWORD idx;
HIC hic;
id++;
hic = ICOpen(icinfo.fccType, icinfo.fccHandler, ICMODE_COMPRESS);
if (hic)
{
/* for unknown reason fccHandler reported by the driver
* doesn't always work, use the one returned by ICInfo instead.
*/
DWORD fccHandler = icinfo.fccHandler;
if (!enum_all && pcv->lpbiIn)
{
if (ICCompressQuery(hic, pcv->lpbiIn, NULL) != ICERR_OK)
{
TRACE("fccHandler %s doesn't support input DIB format %d\n",
wine_dbgstr_fcc(icinfo.fccHandler), pcv->lpbiIn->bmiHeader.biCompression);
ICClose(hic);
continue;
}
}
ICGetInfo(hic, &icinfo, sizeof(icinfo));
icinfo.fccHandler = fccHandler;
idx = SendMessageW(list, CB_ADDSTRING, 0, (LPARAM)icinfo.szDescription);
ic = HeapAlloc(GetProcessHeap(), 0, sizeof(struct codec_info));
ic->icinfo = icinfo;
ic->hic = hic;
SendMessageW(list, CB_SETITEMDATA, idx, (LPARAM)ic);
}
total++;
}
return total != 0;
}