CODEC procedure messages can be sent to a CODEC procedure as a result of an MMIO function call. For example, the MMIOM_CODEC_OPEN message is sent to a CODEC procedure when mmioOpen is called.
CODEC procedures can also be loaded and called directly, without using mmioSendMessage. The mmioLoadCODECProc function loads a CODEC procedure and returns the entry point. A call to this entry point with an MMIOM_CODEC_OPEN message returns an HCODEC, which is used to identify the open instance on all other calls to the CODEC.
The following syntax is required for a direct CODEC procedure call:
typedef LONG (APIENTRY CODECPROC) (PHCODEC phcodec, USHORT usMsg, LONG lParam1, LONG lParam2); typedef CODECPROC *PCODECPROC;
Note that OS/2 multimedia currently supports image and video CODECs. OS/2 multimedia does provide a set of audio CODECs, but does not provide a public interface to install new audio CODECs or to interface to audio CODECs directly.
All CODEC procedures must support the following messages. However, if a CODEC is a compressor only, MMIOM_CODEC_DECOMPRESS does not need to be supported. The same is true if a CODEC is a decompressor only; MMIOM_CODEC_COMPRESS does not need to be supported.
┌──────────────────────────────┬──────────────────────────────┐ │Message │Description │ ├──────────────────────────────┼──────────────────────────────┤ │MMIOM_CODEC_CLOSE │Requests close of instance │ │ │specified by phCODEC. │ ├──────────────────────────────┼──────────────────────────────┤ │MMIOM_CODEC_COMPRESS │Requests CODEC to compress the│ │ │data. │ ├──────────────────────────────┼──────────────────────────────┤ │MMIOM_CODEC_DECOMPRESS │Requests CODEC to decompress │ │ │the data. │ ├──────────────────────────────┼──────────────────────────────┤ │MMIOM_CODEC_OPEN │Requests CODEC to open an │ │ │instance. │ ├──────────────────────────────┼──────────────────────────────┤ │MMIOM_CODEC_QUERYNAME │Requests the name of the │ │ │CODEC. │ ├──────────────────────────────┼──────────────────────────────┤ │MMIOM_CODEC_QUERYNAMELENGTH │Requests the length of the │ │ │CODEC name. │ └──────────────────────────────┴──────────────────────────────┘