forked from acidanthera/OpenCorePkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Riff.h
105 lines (93 loc) · 2.81 KB
/
Riff.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* File: Riff.h
*
* Description: Resource Interchange File Format format definition.
*
* Copyright (c) 2018 John Davis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef EFI_RIFF_H
#define EFI_RIFF_H
/**
See http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html.
**/
#include <Uefi.h>
//
// RIFF chunk IDs.
//
#define RIFF_CHUNK_ID_SIZE 4
#define RIFF_CHUNK_ID "RIFF"
#define LIST_CHUNK_ID "LIST"
#define PAL_CHUNK_ID "PAL "
#define RDIB_CHUNK_ID "RDIB"
#define RMID_CHUNK_ID "RMID"
#define RMMP_CHUNK_ID "RMMP"
//
// WAVE chunk IDs.
//
#define WAVE_CHUNK_ID "WAVE"
#define WAVE_CUE_CHUNK_ID "cue "
#define WAVE_DATA_CHUNK_ID "data"
#define WAVE_FACT_CHUNK_ID "fact"
#define WAVE_FILE_CHUNK_ID "file"
#define WAVE_FORMAT_CHUNK_ID "fmt "
#define WAVE_LABEL_CHUNK_ID "labl"
#define WAVE_NOTE_CHUNK_ID "note"
#define WAVE_PLAYLIST_CHUNK_ID "plst"
#define WAVE_SILENCE_CHUNK_ID "slnt"
#define WAVE_TEXT_DATA_CHUNK_ID "ltxt"
#define WAVE_WAVE_LIST_CHUNK_ID "wavl"
//
// WAVE format types.
//
#define WAVE_FORMAT_PCM 0x0001
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE
#pragma pack(1)
/**
RIFF chunk.
**/
typedef struct {
CHAR8 Id[RIFF_CHUNK_ID_SIZE];
UINT32 Size;
UINT8 Data[];
} RIFF_CHUNK;
/**
WAVE format data.
**/
typedef struct {
UINT16 FormatTag;
UINT16 Channels;
UINT32 SamplesPerSec;
UINT32 AvgBytesPerSec;
UINT16 BlockAlign;
UINT16 BitsPerSample;
} WAVE_FORMAT_DATA;
/**
WAVE format data extended.
**/
typedef struct {
WAVE_FORMAT_DATA Header;
UINT16 ExtensionSize;
UINT16 ValidBitsPerSample;
UINT32 ChannelMask;
GUID SubFormat;
} WAVE_FORMAT_DATA_EX;
#pragma pack()
#endif // EFI_RIFF_H