Jump to content

MMProgRef - CODEC Messages

From EDM2

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation

Multimedia Programming Reference
  1. Introduction
  2. What's New...
  3. MCI Functions
  4. High-Level Macro Service Functions
  5. Subsystem Messages
  6. Notification Messages
  7. MCI Command Messages
  8. String Commands
  9. Memory Playlist Commands
  10. Graphic Button Control
  11. Secondary Window Functions
  12. MMIO Functions
  13. MMIO Messages
  14. CODEC Messages
  15. DIVE Functions
  16. Real-Time MIDI Functions
  17. SPI Functions
  18. Data Stream State Table
  19. SMH Messages
  20. DDCMD Messages
  21. VSD Commands
  22. SHD Messages
  23. SHC Messages
  24. Data Types
  25. Types of MIDI Messages
  26. Multimedia Specification Overview
  27. Resource Interchange File Format
  28. Multimedia File Formats
  29. RIFF Compound Files and Elements - Sharing and Access
  30. Return Codes
  31. Notices
  32. Glossary

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.