Installing a CODEC Procedure

Unlike I/O procedures that have several methods of installation, CODEC procedures are installed by registering them in the MMPMMMIO.INI file using the mmioIniFileCODEC function. Once registered in the MMPMMMIO.INI file, queries can be made on CODEC properties associated with the file format of the opened file. A particular CODEC procedure can be associated with different file formats. A separate entry is required for each different file format a CODEC procedure supports. Allowing CODEC procedures to be queried and dynamically loaded based on the data content alleviates the need to statically load CODEC procedures with the file format IOProc, or hard code DLL names with the IOProc. The following code fragment shows how to install a CODEC procedure using mmioIniFileCODEC.

 CODECINIFILEINFO codecIniFileInfo;
 ULONG ulFlags = 0L;
 ULONG rc;
       .
       .
       .
 memset( &codecIniFileInfo, '\0', sizeof(CODECINIFILEINFO) );
 codecIniFileInfo.ulStructLen = sizeof(CODECINIFILEINFO);
 codecIniFileInfo.fcc = FOURCC_MYPROC;
 codecIniFileInfo.ulCompressType = COMPRESSTYPE_MYPROC;
 codecIniFileInfo.ulCompressSubType = COMPRESSSUBTYPE_MYPROC;
 codecIniFileInfo.ulMediaType = MEDIATYPE_MYPROC;
 codecIniFileInfo.ulCapsFlags = CODEC_DECOMPRESS;
 codecIniFileInfo.ulFlags = 0;
 codecIniFileInfo.szHWID = HWID_MYPROC;
 codecIniFileInfo.ulMaxSrcBufLen = MAXBUFLEN_MYPROC;
 codecIniFileInfo.ulSyncMethod = 1;
 codecIniFileInfo.ulReserved1 = 0;
 codecIniFileInfo.ulXalignment = XALIGNMENT_MYPROC;
 codecIniFileInfo.ulYalignment = YALIGNMENT_MYPROC;
 strncpy( codecIniFileInfo.szDLLName, "MYPROC.DLL", DLLNAME_SIZE );
 strncpy( codecIniFileInfo.szProcName, "MyCODECProc", PROCNAME_SIZE );
 ulFlags = MMIO_INSTALLPROC | MMIO_MATCHCOMPRESSTYPE |
           MMIO_MATCHCOMPRESSSUBTYPE |
           MMIO_MATCHCAPSFLAGS | MMIO_MATCHHWID;

 rc = mmioIniFileCODEC( &codecIniFileInfo,
                         ulFlags);
 if (rc)
   /* error */
 else
       .
       .
       .


[Back: CODEC Functions, Messages, and Data Structures]
[Next: MMIO Data Structures]