static BOOL ICLocate_enum_handler(const char *drv, unsigned int nr, void *param) { driver_info_t *info = param; info->fccHandler = mmioStringToFOURCCA(drv + 5, 0); info->hic = try_driver(info); return info->hic != 0; }
static struct ibv_device *try_drivers(struct ibv_sysfs_dev *sysfs_dev) { struct ibv_driver *driver; struct ibv_device *dev; for (driver = head_driver; driver; driver = driver->next) { dev = try_driver(driver, sysfs_dev); if (dev) return dev; } return NULL; }
/*********************************************************************** * ICLocate [MSVFW32.@] */ HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wMode) { driver_info_t info; TRACE("(%s,%s,%p,%p,0x%04x)\n", wine_dbgstr_fcc(fccType), wine_dbgstr_fcc(fccHandler), lpbiIn, lpbiOut, wMode); info.fccType = fccType; info.fccHandler = fccHandler; info.lpbiIn = lpbiIn; info.lpbiOut = lpbiOut; info.wMode = wMode; switch (wMode) { case ICMODE_FASTCOMPRESS: case ICMODE_COMPRESS: info.querymsg = ICM_COMPRESS_QUERY; break; case ICMODE_FASTDECOMPRESS: case ICMODE_DECOMPRESS: info.querymsg = ICM_DECOMPRESS_QUERY; break; case ICMODE_DRAW: info.querymsg = ICM_DRAW_QUERY; break; default: WARN("Unknown mode (%d)\n", wMode); return 0; } /* Easy case: handler/type match, we just fire a query and return */ info.hic = try_driver(&info); /* If it didn't work, try each driver in turn. 32 bit codecs only. */ /* FIXME: Move this to an init routine? */ if (!info.hic) enum_drivers(fccType, ICLocate_enum_handler, &info); if (info.hic) { TRACE("=> %p\n", info.hic); return info.hic; } if (fccType == streamtypeVIDEO) return ICLocate(ICTYPE_VIDEO, fccHandler, lpbiIn, lpbiOut, wMode); WARN("(%s,%s,%p,%p,0x%04x) not found!\n", wine_dbgstr_fcc(fccType), wine_dbgstr_fcc(fccHandler), lpbiIn, lpbiOut, wMode); return 0; }