This repository has been archived by the owner on Jul 30, 2022. It is now read-only.
mirrored from https://chromium.googlesource.com/webm/webmquicktime
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathVP8CodecUniversal.r
307 lines (263 loc) · 7.31 KB
/
VP8CodecUniversal.r
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
// Copyright (c) 2010 The WebM project authors. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
// Set to 1 == building Mac OS X
#define TARGET_REZ_CARBON_MACHO 1
#if TARGET_REZ_CARBON_MACHO
#if defined(ppc_YES)
// PPC architecture
#error ppc not supported
#define TARGET_REZ_MAC_PPC 1
#else
#define TARGET_REZ_MAC_PPC 0
#endif
#if defined(i386_YES)
// x86 architecture
#define TARGET_REZ_MAC_X86 1
#else
#error
#define TARGET_REZ_MAC_X86 0
#endif
#define TARGET_REZ_WIN32 0
#else
#error Must be building on Windows
#define TARGET_REZ_WIN32 1
#endif
#define thng_RezTemplateVersion 2
#if TARGET_REZ_CARBON_MACHO
#include <Carbon/Carbon.r>
#include <QuickTime/QuickTime.r>
#else
#include "ConditionalMacros.r"
#include "MacTypes.r"
#include "Components.r"
#include "ImageCodec.r"
#endif
#include "VP8CodecVersion.h"
#include "WebMExportVersions.h"
// These flags specify information about the capabilities of the component
// Works with 32-bit Pixel Maps
#define kCompressorFlags ( codecInfoDoes32 | codecInfoDoesTemporal | codecInfoDoesReorder | codecInfoDoesRateConstrain )
#define kDecompressorFlags ( codecInfoDoes32 | codecInfoDoesTemporal )
// These flags specify the possible format of compressed data produced by the component
// and the format of compressed files that the component can handle during decompression
// The component can decompress from files at 24-bit depths
#define kFormatFlags ( codecInfoDepth24 )
// Component Description
resource 'cdci' (255) {
kCodecFormatName, // Type
1, // Version
1, // Revision level
kGoogManufacturer, // Manufacturer
kDecompressorFlags, // Decompression Flags
kCompressorFlags, // Compression Flags
kFormatFlags, // Format Flags
128, // Compression Accuracy
128, // Decomression Accuracy
200, // Compression Speed
200, // Decompression Speed
128, // Compression Level
0, // Reserved
1, // Minimum Height
1, // Minimum Width
0, // Decompression Pipeline Latency
0, // Compression Pipeline Latency
0 // Private Data
};
// Component Name
resource 'STR ' (256) {
"VP8"
};
resource 'thng' (256) {
decompressorComponentType, // Type
kVP8CodecFormatType, // SubType
kGoogManufacturer, // Manufacturer
0, // - use componentHasMultiplePlatforms
0,
0,
0,
'STR ', // Name Type
256, // Name ID
'STR ', // Info Type
257, // Info ID
0, // Icon Type
0, // Icon ID
kDecompressorVersion,
componentHasMultiplePlatforms + // Registration Flags
componentDoAutoVersion,
0, // Resource ID of Icon Family
{
#if TARGET_REZ_CARBON_MACHO
#if !(TARGET_REZ_MAC_PPC || TARGET_REZ_MAC_X86)
#error "Platform architecture not defined, TARGET_REZ_MAC_PPC and/or TARGET_REZ_MAC_X86 must be defined!"
#endif
#if TARGET_REZ_MAC_PPC
kDecompressorFlags | cmpThreadSafe,
'dlle',
256,
platformPowerPCNativeEntryPoint,
#endif
#if TARGET_REZ_MAC_X86
kDecompressorFlags | cmpThreadSafe,
'dlle',
256,
platformIA32NativeEntryPoint,
#endif
#endif
#if TARGET_OS_WIN32
#error "Windows build is not yet set up"
kDecompressorFlags,
'dlle',
256,
platformWin32,
#endif
},
0, 0;
};
// Component Information
resource 'STR ' (257) {
"VP8 Decompressor."
};
// Code Entry Point for Mach-O and Windows
resource 'dlle' (256) {
"VP8_Decoder_ComponentDispatch"
};
resource 'thng' (258) {
compressorComponentType, // Type
kVP8CodecFormatType, // SubType
kGoogManufacturer, // Manufacturer
0, // - use componentHasMultiplePlatforms
0,
0,
0,
'STR ', // Name Type
256, // Name ID
'STR ', // Info Type
258, // Info ID
0, // Icon Type
0, // Icon ID
kVP8CompressorVersion,
componentHasMultiplePlatforms + // Registration Flags
componentDoAutoVersion,
0, // Resource ID of Icon Family
{
#if TARGET_REZ_CARBON_MACHO
#if !(TARGET_REZ_MAC_PPC || TARGET_REZ_MAC_X86)
#error "Platform architecture not defined, TARGET_REZ_MAC_PPC and/or TARGET_REZ_MAC_X86 must be defined!"
#endif
#if TARGET_REZ_MAC_PPC
kCompressorFlags | cmpThreadSafe,
'dlle',
258,
platformPowerPCNativeEntryPoint,
#endif
#if TARGET_REZ_MAC_X86
kCompressorFlags | cmpThreadSafe,
'dlle',
258,
platformIA32NativeEntryPoint,
#endif
#endif
#if TARGET_OS_WIN32
kCompressorFlags,
'dlle',
258,
platformWin32,
#endif
},
0, 0;
};
// Component Information
resource 'STR ' (258) {
"VP8 Encoder."
};
// Code Entry Point for Mach-O and Windows
resource 'dlle' (258) {
"VP8_Encoder_ComponentDispatch"
};
#define kVP8_EncoderDITLResID 129
#define TEXT_HEIGHT 16
#define INTER_CONTROL_SPACING 12
#define POPUP_CONTROL_HEIGHT 22
resource 'DITL' (kVP8_EncoderDITLResID, "Compressor Options") {
{
//I think its {top, left, bottom, right}
//control 1
{0, 0, TEXT_HEIGHT, 100},
RadioButton { enabled, "One Pass " },
//control 2
/*{TEXT_HEIGHT + INTER_CONTROL_SPACING, 0,
TEXT_HEIGHT + INTER_CONTROL_SPACING + POPUP_CONTROL_HEIGHT, 165},
Control { enabled, kMyCodecPopupCNTLResID },*/
//control 3
{0, 100, TEXT_HEIGHT, 200},
RadioButton { enabled, "Two Pass " },
{TEXT_HEIGHT + INTER_CONTROL_SPACING, 0,
TEXT_HEIGHT + INTER_CONTROL_SPACING + POPUP_CONTROL_HEIGHT, 130},
Button{ enabled, "Advanced" },
};
};
#define kExporterFlags canMovieExportFiles | canMovieExportValidateMovie | \
canMovieExportFromProcedures | movieExportMustGetSourceMediaType | \
hasMovieExportUserInterface | cmpThreadSafe
//name
resource 'STR ' (260) {
"WebM"
};
resource 'thng' (262) {
'spit', // Type
'WebM', // SubType
kGoogManufacturer, // Manufacturer
0, // - use componentHasMultiplePlatforms
0,
0,
0,
'STR ', // Name Type
260, // Name ID
'STR ', // Info Type
262, // Info ID
0, // Icon Type
0, // Icon ID
kExporterFlags,
componentHasMultiplePlatforms + // Registration Flags
componentDoAutoVersion,
0, // Resource ID of Icon Family
{
#if TARGET_REZ_CARBON_MACHO
#if !(TARGET_REZ_MAC_PPC || TARGET_REZ_MAC_X86)
#error "Platform architecture not defined, TARGET_REZ_MAC_PPC and/or TARGET_REZ_MAC_X86 must be defined!"
#endif
#if TARGET_REZ_MAC_PPC
kExporterFlags | cmpThreadSafe,
'dlle',
262,
platformPowerPCNativeEntryPoint,
#endif
#if TARGET_REZ_MAC_X86
kExporterFlags | cmpThreadSafe,
'dlle',
262,
platformIA32NativeEntryPoint,
#endif
#endif
#if TARGET_OS_WIN32
kExporterFlags,
'dlle',
262,
platformWin32,
#endif
},
0, 0;
};
// Component Information
resource 'STR ' (262) {
"WebM"
};
// Code Entry Point for Mach-O and Windows
resource 'dlle' (262) {
"WebMExportComponentDispatch"
};