AOIFOURCC* constants and functions

Updated: April 19, 2023

Macro constants and functions for constructing FOURCC values

Definitions:

#define AOIFOURCC4( C0, C1, C2, C3 ) \
    ( ((uint32_t)C0<<24) | ((uint8_t)C1<<16) | ((uint8_t)C2<<8) | ((uint8_t)C3) )
#define AOIFOURCC( FCC ) AOIFOURCC4( FCC[0], FCC[1], FCC[2], FCC[3] )

#define AOIFOURCC_METADATA_ISO8859    "TXT1"
#define AOIFOURCC_METADATA_UTF16_LE   "TXT2"
#define AOIFOURCC_METADATA_UTF16_BE   "2TXT"
#define AOIFOURCC_METADATA_UTF16      "TX2T"
#define AOIFOURCC_METADATA_UTF32_LE   "TXT4"
#define AOIFOURCC_METADATA_UTF32_BE   "4TXT"
#define AOIFOURCC_METADATA_UTF32      "TX4T"
#define AOIFOURCC_METADATA_UTF8       "UTF8"
#define AOIFOURCC_METADATA_ID3V1      "TXT0"

#define AOIFOURCC_METADATA_BINARY     "BINA"
#define AOIFOURCC_METADATA_BOOL       "BOOL"
#define AOIFOURCC_METADATA_WORD       "NUM2"
#define AOIFOURCC_METADATA_DWORD      "NUM4"
#define AOIFOURCC_METADATA_QWORD      "NUM8"

#define AOIFOURCC_METADATA_STORAGE    "TmpF"

Description:

The AOIFOURCC() macro constructs a value that can be stored in the fourcc field of an AODataFormat_t structure. This macro converts a four-character string into an unsigned 32-bit integer, with one character stored in each byte. You can pass in any AOIFOURCC_METADATA_* constant to the macro function; these constants offer a convenient way of generating FOURCC values that describe common media types. You can pass in strings describing other media types as well, such as:
  • RGB6 — 16-bit RGB
  • RGB5 — 15-bit RGB
  • RGB4 — 24-bit RGB
  • RGB2 — 32-bit RGB

The AOIFOURCC4() macro also generates a value suitable for the fourcc field, but takes four separate characters as input.

Using a value based on the AOIFOURCC_METADATA_STORAGE constant instructs the library to use a temporary path in the filesystem for storing the metadata payload (e.g., an image). The filename is in ASCII format.

Library:

libaoi.so

Classification:

QNX Neutrino