--- branches/dev-api-4/xvidcore/vfw/src/driverproc.c 2003/04/12 06:58:50 983 +++ branches/dev-api-4/xvidcore/vfw/src/driverproc.c 2003/06/09 01:25:19 1053 @@ -30,6 +30,7 @@ #include #include +#include "vfwext.h" #include "debug.h" #include "codec.h" @@ -87,17 +88,19 @@ return 0; } - codec->ehandle = codec->dhandle = NULL; - codec->fbase = 25; + codec->config.ci_valid = 0; + codec->ehandle = codec->dhandle = NULL; + codec->fbase = 25; codec->fincr = 1; config_reg_get(&codec->config); - /* bad things happen if this is uncommented +#if 0 + /* bad things happen if this piece of code is activated */ if (lstrcmp(XVID_BUILD, codec->config.build)) { config_reg_default(&codec->config); } - */ +#endif if (icopen != NULL) { @@ -108,7 +111,7 @@ case DRV_CLOSE : DPRINTF("DRV_CLOSE"); - // compress_end/decompress_end don't always get called + /* compress_end/decompress_end don't always get called */ compress_end(codec); decompress_end(codec); free(codec); @@ -194,7 +197,7 @@ return 0; } memcpy(&codec->config,(void*)lParam1, sizeof(CONFIG)); - return 0; // sizeof(CONFIG); + return 0; /* sizeof(CONFIG); */ /* not sure the difference, private/public data? */ @@ -273,6 +276,21 @@ case ICM_DECOMPRESSEX: return ICERR_UNSUPPORTED; + /* VFWEXT entry point */ + case ICM_USER+0x0fff : + if (lParam1 == VFWEXT_CONFIGURE_INFO) { + VFWEXT_CONFIGURE_INFO_T * info = (VFWEXT_CONFIGURE_INFO_T*)lParam2; + DPRINTF("%i %i %i %i %i %i", + info->ciWidth, info->ciHeight, + info->ciRate, info->ciScale, + info->ciActiveFrame, info->ciFrameCount); + + codec->config.ci_valid = 1; + memcpy(&codec->config.ci, (void*)lParam2, sizeof(VFWEXT_CONFIGURE_INFO_T)); + return ICERR_OK; + } + return ICERR_UNSUPPORTED; + default: return DefDriverProc(dwDriverId, hDriver, uMsg, lParam1, lParam2); }