Jump to content

mmioQueryCODECName

From EDM2

The mmioQueryCODECName function returns the CODEC procedure name.

Syntax

#define INCL_MMIOOS2
#define INCL_MMIO_CODEC
#include <os2.h>

ULONG mmioQueryCODECName(PCODECINIFILEINFO pCODECIniFileinfo, PSZ pszCODECName, PULONG pulBytesRead);

Parameters

pCODECIniFileinfo (PCODECINIFILEINFO) - input
Pointer to the CODECINIFILEINFO data structure containing the CODEC information. Only the fcc, ulCompressType, ulCompressSubType, szHWID, and ulCapsFlags fields of the structure are used to identify a CODEC procedure.
pszCODECName (PSZ) - output
Pointer to the CODEC name. The function fills in the CODEC name associated with the specified CODEC procedure, up to pulBytesRead bytes. Make sure the buffer is at least one byte long.
pulBytesRead (PULONG) - in/out
On input, specifies the size in bytes of the pszCODECName. On output, returns the number of bytes read into the pszCODECName.

Return Value

rc (ULONG) - returns
Return codes.
  • MMIO_SUCCESS: If the function succeeds, 0 is returned.
  • MMIO_ERROR: The function failed for a reason different from any of the returns in this list.
  • MMIO_INVALID_PARAMETER: An invalid parameter was passed.

Remarks

The function identifies the CODEC based on the information provided in the CODECINIFILEINFO structure and retrieves its descriptive name.

Example Code

The following code illustrates how to obtain the name of the CODEC procedure.

   CODECINIFILFO  codecIniFileInfo;
   PULONG pulBytesRead;
   PSZ pszCODECName;
   ULONG rc;
    ...

   mmset(&codecIniFileInfo, '\0', sizeof(CODECINIFILEINFO);
   codecIniFileInfo.ulStructLen = sizeof(CODECINIFILEINFO);
   codecIniFileInfo.fcc = FOURCC MYPROC;
   codecIniFileInfo.ulCompressType = COMPRESS_TYPE_MYPROC;
   codecIniFileInfo.ulCompressSubType = COMPRESSSUBTYPE_MYPROC;
   codecIniFileInfo.ulCapsFlags = CODEC_CAN_DECOMPRESS;
   codecIniFileInfo.szHWID = MYPROC;
   rc = mmioQueryCODECNameLength (&codecIniFileInfo,
        pulBytesRead);
   if (rc)
      /* error */
   else
   pszCODECName = malloc(*pulBytesRead + sizeof (char));
   rc = mmioQueryCODECName ( &codecIniFileInfo,
                            pszCODECName,
                            pulBytesRead);

     if (rc)
      /* error */
     else
     {
     }
     ...