## FOURCCMap Class

This class provides conversion between GUID media subtypes and old-style FOURCC 32-bit media tags. In the original Microsoft® Windows® multimedia APIs, media types were tagged with 32-bit values created from four 8-bit characters and were known as FOURCCs. Microsoft DirectShow™ media types have GUIDs for the subtype, partly because these are simpler to create (creation of a new FOURCC requires its registration with Microsoft). Because FOURCCs are unique, a one-to-one mapping has been made possible by allocating a range of 4,000 million GUIDs representing FOURCCs. This range is all GUIDs of the form:

    XXXXXXXX-0000-0010-8000-00AA00389B71

This class simplifies conversion between GUIDs and FOURCCs. This is for compatibility only. It is recommended that all new media subtypes be represented by GUIDs created by Guidgen.exe or a similar tool, and not by mapping FOURCCs.

The object is derived from a GUID, with no extra data members, and can be cast to a GUID. The object can be passed a FOURCC at construction time. The default constructor will initialize the FOURCC to zero.

The GetFOURCC and SetFOURCC methods do not check that the fixed portions of the GUID correspond to the FOURCC range. Thus, if you cast a pointer to a GUID into a pointer to a FOURCC and then set or get the FOURCC field, you also need to check separately that the GUID is within the FOURCC range.

Member Functions

Name | Description
FOURCCMap | Constructs a FOURCCMap object.
GetFOURCC | Returns the FOURCC from a FOURCCMap object.
SetFOURCC | Sets the FOURCC portion of the FOURCCMap object.

###

FOURCCMap::FOURCCMap

FOURCCMap Class

Constructs a FOURCCMap object. Provides a mapping between old-style multimedia format DWORD types and new-style GUID types.

FOURCCMap( );
FOURCCMap(
DWORD Fourcc
);
FOURCCMap(
const GUID * pguid
);

##### Parameters

Fourcc
  DWORD media tag formerly used for Microsoft multimedia types.
pguid
  Globally unique identifier (GUID).

##### Return Values

No return value.

##### Remarks

If this object is constructed with the FOURCC code, a GUID is created to match it. If this object is created with an existing GUID, the FOURCC value of the object is set to zero. Thereafter, the FOURCC value can be set or retrieved using the SetFOURCC and GetFOURCC member functions, respectively.

###

FOURCCMap::GetFOURCC

FOURCCMap Class

Retrieves the FOURCC DWORD from the FOURCCMap object.

DWORD GetFOURCC(void);

##### Return Values

Returns the FOURCC DWORD value. Note that if you construct a FOURCCMap object from a GUID that was not originally derived from FOURCC, the return value will be essentially random.

###

FOURCCMap::SetFOURCC

FOURCCMap Class

Sets the FOURCC portion of the FOURCCMap object.

void SetFOURCC(
const GUID * pguid
);

##### Parameters

pguid
  Pointer to the returned globally unique identifier (GUID) part of the FOURCCMap object.

##### Return Values

No return value.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.