Update UNRAR.H
[xy_vsfilter.git] / src / filters / BaseClasses / fourcc.h
blob3c44c5d36c0d3dffde4f8f6226f0823ef4787a1b
1 //------------------------------------------------------------------------------
2 // File: FourCC.h
3 //
4 // Desc: DirectShow base classes.
5 //
6 // Copyright (c) 1992-2002 Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
10 // FOURCCMap
12 // provides a mapping between old-style multimedia format DWORDs
13 // and new-style GUIDs.
15 // A range of 4 billion GUIDs has been allocated to ensure that this
16 // mapping can be done straightforwardly one-to-one in both directions.
18 // January 95
21 #ifndef __FOURCC__
22 #define __FOURCC__
25 // Multimedia format types are marked with DWORDs built from four 8-bit
26 // chars and known as FOURCCs. New multimedia AM_MEDIA_TYPE definitions include
27 // a subtype GUID. In order to simplify the mapping, GUIDs in the range:
28 // XXXXXXXX-0000-0010-8000-00AA00389B71
29 // are reserved for FOURCCs.
31 class FOURCCMap : public GUID
34 public:
35 FOURCCMap();
36 FOURCCMap(DWORD Fourcc);
37 FOURCCMap(const GUID *);
40 DWORD GetFOURCC(void);
41 void SetFOURCC(DWORD fourcc);
42 void SetFOURCC(const GUID *);
44 private:
45 void InitGUID();
48 #define GUID_Data2 0
49 #define GUID_Data3 0x10
50 #define GUID_Data4_1 0xaa000080
51 #define GUID_Data4_2 0x719b3800
53 inline void
54 FOURCCMap::InitGUID() {
55 Data2 = GUID_Data2;
56 Data3 = GUID_Data3;
57 ((DWORD *)Data4)[0] = GUID_Data4_1;
58 ((DWORD *)Data4)[1] = GUID_Data4_2;
61 inline
62 FOURCCMap::FOURCCMap() {
63 InitGUID();
64 SetFOURCC( DWORD(0));
67 inline
68 FOURCCMap::FOURCCMap(DWORD fourcc)
70 InitGUID();
71 SetFOURCC(fourcc);
74 inline
75 FOURCCMap::FOURCCMap(const GUID * pGuid)
77 InitGUID();
78 SetFOURCC(pGuid);
81 inline void
82 FOURCCMap::SetFOURCC(const GUID * pGuid)
84 FOURCCMap * p = (FOURCCMap*) pGuid;
85 SetFOURCC(p->GetFOURCC());
88 inline void
89 FOURCCMap::SetFOURCC(DWORD fourcc)
91 Data1 = fourcc;
94 inline DWORD
95 FOURCCMap::GetFOURCC(void)
97 return Data1;
100 #endif /* __FOURCC__ */