forked from btrask/EasyCapViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathECVComponent.m
476 lines (441 loc) · 18 KB
/
ECVComponent.m
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
/* Copyright (c) 2010-2011, Ben Trask
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY BEN TRASK ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL BEN TRASK BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
#import <objc/objc-runtime.h>
// Models
#import "ECVVideoStorage.h"
#import "ECVDeinterlacingMode.h"
#import "ECVVideoFrame.h"
// Video Devices
#import "ECVCaptureDevice.h"
// Other Sources
#import "ECVDebug.h"
#import "ECVComponentConfiguring.h"
typedef struct {
ECVCaptureDevice<ECVComponentConfiguring> *device;
CFMutableDictionaryRef frameByBuffer;
NSMutableArray *inputCombinations;
TimeBase timeBase;
} ECVCStorage;
#define VD_BASENAME() ECV
#define VD_GLOBALS() ECVCStorage *
#define COMPONENT_DISPATCH_FILE "ECVComponentDispatch.h"
#define CALLCOMPONENT_BASENAME() VD_BASENAME()
#define CALLCOMPONENT_GLOBALS() VD_GLOBALS() storage
#define COMPONENT_UPP_SELECT_ROOT() VD
#include <CoreServices/Components.k.h>
#include <QuickTime/QuickTimeComponents.k.h>
#include <QuickTime/ComponentDispatchHelper.c>
#if defined(__i386__)
#define ECV_objc_msgSend_CGFloat objc_msgSend_fpret
#else
#define ECV_objc_msgSend_CGFloat objc_msgSend
#endif
#define ECV_CALLCOMPONENT_FUNCTION(name, args...) pascal ComponentResult ADD_CALLCOMPONENT_BASENAME(name)(VD_GLOBALS() self, ##args)
#define ECV_VDIG_FUNCTION(name, args...) pascal VideoDigitizerError ADD_CALLCOMPONENT_BASENAME(name)(VD_GLOBALS() self, ##args)
#define ECV_VDIG_FUNCTION_UNIMPLEMENTED(name, args...) ECV_VDIG_FUNCTION(name, ##args) { ECV_DEBUG_LOG(); return digiUnimpErr; }
#define ECV_VDIG_PROPERTY_UNIMPLEMENTED(prop) \
ECV_VDIG_FUNCTION_UNIMPLEMENTED(Get ## prop, unsigned short *v)\
ECV_VDIG_FUNCTION_UNIMPLEMENTED(Set ## prop, unsigned short *v)
#define ECV_VDIG_PROPERTY(prop, getterSel, setterSel) \
ECV_VDIG_FUNCTION(Get ## prop, unsigned short *v)\
{\
ECV_DEBUG_LOG();\
if(![self->device respondsToSelector:getterSel]) return digiUnimpErr;\
*v = ((CGFloat (*)(id, SEL))ECV_objc_msgSend_CGFloat)(self->device, getterSel) * USHRT_MAX;\
return noErr;\
}\
ECV_VDIG_FUNCTION(Set ## prop, unsigned short *v)\
{\
ECV_DEBUG_LOG();\
if(![self->device respondsToSelector:setterSel]) return digiUnimpErr;\
((void (*)(id, SEL, CGFloat))objc_msgSend)(self->device, setterSel, (CGFloat)*v / USHRT_MAX);\
return noErr;\
}
static NSString *const ECVVideoSourceObject = @"ECVVideoSourceObjectKey";
static NSString *const ECVVideoFormatObject = @"ECVVideoFormatObjectKey";
static Rect ECVNSRectToRect(NSRect r)
{
return (Rect){NSMinX(r), NSMinY(r), NSMaxX(r), NSMaxY(r)};
}
ECV_CALLCOMPONENT_FUNCTION(Open, ComponentInstance instance)
{
ECV_DEBUG_LOG();
if(CountComponentInstances((Component)self) > 1) return -1;
if(!self) {
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
Class const class = [[ECVCaptureDevice deviceClasses] lastObject];
NSDictionary *const matchingDict = [class matchingDictionary];
if(![class conformsToProtocol:@protocol(ECVComponentConfiguring)]) {
[pool drain];
return -1;
}
self = calloc(1, sizeof(ECVCStorage));
self->device = [[class alloc] initWithService:IOServiceGetMatchingService(kIOMasterPortDefault, (CFDictionaryRef)[matchingDict retain]) error:NULL];
if(!self->device) {
ECV_DEBUG_LOG();
free(self);
[pool drain];
return internalComponentErr;
}
[self->device setDeinterlacingMode:[ECVDropDeinterlacingMode class]];
self->frameByBuffer = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, &kCFTypeDictionaryValueCallBacks);
SetComponentInstanceStorage(instance, (Handle)self);
[pool drain];
}
return noErr;
}
ECV_CALLCOMPONENT_FUNCTION(Close, ComponentInstance instance)
{
ECV_DEBUG_LOG();
if(!self) return noErr;
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
[self->device release];
CFRelease(self->frameByBuffer);
[self->inputCombinations release];
free(self);
[pool drain];
return noErr;
}
ECV_CALLCOMPONENT_FUNCTION(Version)
{
ECV_DEBUG_LOG();
return vdigInterfaceRev << 16;
}
ECV_VDIG_FUNCTION(GetDigitizerInfo, DigitizerInfo *info)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
ECVIntegerSize const s = [self->device captureSize];
[pool drain];
*info = (DigitizerInfo){};
info->vdigType = vdTypeBasic;
info->inputCapabilityFlags = kNilOptions;
// We lie because many applications don't respect these options, and NTSC/PAL/SECAM is more limited than what we actually support.
// digiInDoesNTSC | digiInDoesPAL | digiInDoesSECAM | digiInDoesColor | digiInDoesComposite | digiInDoesSVideo
info->outputCapabilityFlags = digiOutDoes32 | digiOutDoesCompress | digiOutDoesCompressOnly | digiOutDoesNotNeedCopyOfCompressData;
info->inputCurrentFlags = info->inputCapabilityFlags;
info->outputCurrentFlags = info->outputCapabilityFlags;
info->minDestWidth = 0;
info->minDestHeight = 0;
info->maxDestWidth = s.width;
info->maxDestHeight = s.height;
return noErr;
}
ECV_VDIG_FUNCTION(GetCurrentFlags, long *inputCurrentFlag, long *outputCurrentFlag)
{
ECV_DEBUG_LOG();
DigitizerInfo info;
if(noErr != ADD_CALLCOMPONENT_BASENAME(GetDigitizerInfo)(self, &info)) return -1;
*inputCurrentFlag = info.inputCurrentFlags;
*outputCurrentFlag = info.outputCurrentFlags;
return noErr;
}
ECV_VDIG_FUNCTION(GetNumberOfInputs, short *inputs)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
[self->inputCombinations release];
self->inputCombinations = [[NSMutableArray alloc] init];
for(id const source in [self->device allVideoSourceObjects]) {
if(![self->device isValidVideoSourceObject:source]) continue;
for(id const format in [self->device allVideoFormatObjects]) {
if(![self->device isValidVideoFormatObject:format]) continue;
[self->inputCombinations addObject:[NSDictionary dictionaryWithObjectsAndKeys:
source, ECVVideoSourceObject,
format, ECVVideoFormatObject,
nil]];
}
}
*inputs = MIN(SHRT_MAX, [self->inputCombinations count] - 1);
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(GetInputFormat, short input, short *format)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
*format = [self->device inputFormatForVideoSourceObject:[[self->inputCombinations objectAtIndex:input] objectForKey:ECVVideoSourceObject]];
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(GetInputName, long videoInput, Str255 name)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
NSDictionary *const inputCombination = [self->inputCombinations objectAtIndex:videoInput];
NSString *const sourceLabel = [self->device localizedStringForVideoSourceObject:[inputCombination objectForKey:ECVVideoSourceObject]];
NSString *const formatLabel = [self->device localizedStringForVideoFormatObject:[inputCombination objectForKey:ECVVideoFormatObject]];
CFStringGetPascalString((CFStringRef)[NSString stringWithFormat:@"%@ - %@", sourceLabel, formatLabel], name, 256, kCFStringEncodingUTF8);
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(GetInput, short *input)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
NSDictionary *const inputCombination = [NSDictionary dictionaryWithObjectsAndKeys:
[self->device videoSourceObject], ECVVideoSourceObject,
[self->device videoFormatObject], ECVVideoFormatObject,
nil];
NSUInteger i = [self->inputCombinations indexOfObject:inputCombination];
if(NSNotFound == i) i = 0;
*input = MIN(SHRT_MAX, i);
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(SetInput, short input)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
NSDictionary *const inputCombination = [self->inputCombinations objectAtIndex:input];
[self->device setVideoSourceObject:[inputCombination objectForKey:ECVVideoSourceObject]];
[self->device setVideoFormatObject:[inputCombination objectForKey:ECVVideoFormatObject]];
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(SetInputStandard, short inputStandard)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
[self->device setInputStandard:inputStandard];
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(GetDeviceNameAndFlags, Str255 outName, UInt32 *outNameFlags)
{
ECV_DEBUG_LOG();
*outNameFlags = kNilOptions;
CFStringGetPascalString((CFStringRef)@"ECVComponent", outName, 256, kCFStringEncodingUTF8);
// TODO: Enumerate the devices and register vdigs for each. Use vdDeviceFlagHideDevice for ourself. Not sure if this is actually necessary (?)
return noErr;
}
ECV_VDIG_FUNCTION(GetCompressionTime, OSType compressionType, short depth, Rect *srcRect, CodecQ *spatialQuality, CodecQ *temporalQuality, unsigned long *compressTime)
{
ECV_DEBUG_LOG();
if(compressionType && [self->device pixelFormatType] != compressionType) return noCodecErr;
*spatialQuality = codecLosslessQuality;
*temporalQuality = 0;
*compressTime = 0;
return noErr;
}
ECV_VDIG_FUNCTION(GetCompressionTypes, VDCompressionListHandle h)
{
ECV_DEBUG_LOG();
SInt8 const handleState = HGetState((Handle)h);
HUnlock((Handle)h);
SetHandleSize((Handle)h, sizeof(VDCompressionList));
HLock((Handle)h);
CodecType const codec = [self->device pixelFormatType];
ComponentDescription cd = {compressorComponentType, codec, 0, kNilOptions, kAnyComponentFlagsMask};
VDCompressionListPtr const p = *h;
p[0] = (VDCompressionList){
.codec = FindNextComponent(NULL, &cd),
.cType = codec,
.formatFlags = codecInfoDepth24,
.compressFlags = codecInfoDoes32,
};
CFStringGetPascalString((CFStringRef)@"Native Output", p[0].typeName, 64, kCFStringEncodingUTF8);
CFStringGetPascalString((CFStringRef)@"Test Name", p[0].name, 64, kCFStringEncodingUTF8);
HSetState((Handle)h, handleState);
return noErr;
}
ECV_VDIG_FUNCTION(SetCompressionOnOff, Boolean state)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
[self->device setPlaying:!!state];
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(SetCompression, OSType compressType, short depth, Rect *bounds, CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate)
{
ECV_DEBUG_LOG();
if(compressType && [self->device pixelFormatType] != compressType) return noCodecErr;
// TODO: Most of these settings don't apply to us...
return noErr;
}
ECV_VDIG_FUNCTION(ResetCompressSequence)
{
ECV_DEBUG_LOG();
return noErr;
}
ECV_VDIG_FUNCTION(CompressOneFrameAsync)
{
// ECV_DEBUG_LOG();
if(![self->device isPlaying]) return badCallOrderErr;
return noErr;
}
ECV_VDIG_FUNCTION(CompressDone, UInt8 *queuedFrameCount, Ptr *theData, long *dataSize, UInt8 *similarity, TimeRecord *t)
{
// ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
ECVVideoStorage *const vs = [self->device videoStorage];
ECVVideoFrame *const frame = [vs currentFrame];
*queuedFrameCount = 1;
if(frame) {
void const *const bytes = [frame bytes];
CFDictionaryAddValue(self->frameByBuffer, bytes, frame);
*theData = (Ptr)bytes;
*dataSize = [[frame videoStorage] bufferSize];
GetTimeBaseTime(self->timeBase, [self->device frameRate].timeScale, t);
} else {
*theData = NULL;
*dataSize = 0;
}
*similarity = 0;
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(ReleaseCompressBuffer, Ptr bufferAddr)
{
// ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
CFDictionaryRemoveValue(self->frameByBuffer, bufferAddr);
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(GetImageDescription, ImageDescriptionHandle desc)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
ECVVideoStorage *const videoStorage = [self->device videoStorage];
if(!videoStorage) {
[pool drain];
return badCallOrderErr;
}
ECVIntegerSize const captureSize = [videoStorage captureSize];
ECVIntegerSize const pixelSize = [videoStorage pixelSize];
[pool drain];
ImageDescriptionPtr const descPtr = *desc;
SetHandleSize((Handle)desc, sizeof(ImageDescription));
*descPtr = (ImageDescription){
.idSize = sizeof(ImageDescription),
.cType = [self->device pixelFormatType],
.version = 2,
.spatialQuality = codecLosslessQuality,
.width = captureSize.width,
.height = captureSize.height,
.hRes = Long2Fix(72),
.vRes = Long2Fix(72),
.frameCount = 1,
.depth = 24,
.clutID = -1,
};
FieldInfoImageDescriptionExtension2 const fieldInfo = {kQTFieldsProgressiveScan, kQTFieldDetailUnknown};
ECVOSStatus(ICMImageDescriptionSetProperty(desc, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_FieldInfo, sizeof(FieldInfoImageDescriptionExtension2), &fieldInfo));
CleanApertureImageDescriptionExtension const cleanAperture = {
pixelSize.width, 1,
pixelSize.height, 1,
0, 1,
0, 1,
};
ECVOSStatus(ICMImageDescriptionSetProperty(desc, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_CleanAperture, sizeof(CleanApertureImageDescriptionExtension), &cleanAperture));
PixelAspectRatioImageDescriptionExtension const pixelAspectRatio = {captureSize.height, 540};
ECVOSStatus(ICMImageDescriptionSetProperty(desc, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_PixelAspectRatio, sizeof(PixelAspectRatioImageDescriptionExtension), &pixelAspectRatio));
NCLCColorInfoImageDescriptionExtension const colorInfo = {
kVideoColorInfoImageDescriptionExtensionType,
kQTPrimaries_SMPTE_C,
kQTTransferFunction_ITU_R709_2,
kQTMatrix_ITU_R_601_4
};
ECVOSStatus(ICMImageDescriptionSetProperty(desc, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_NCLCColorInfo, sizeof(NCLCColorInfoImageDescriptionExtension), &colorInfo));
ECVOSStatus(ICMImageDescriptionSetProperty(desc, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_EncodedWidth, sizeof(pixelSize.width), &pixelSize.width));
ECVOSStatus(ICMImageDescriptionSetProperty(desc, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_EncodedHeight, sizeof(pixelSize.height), &pixelSize.height));
return noErr;
}
ECV_VDIG_FUNCTION(GetVBlankRect, short inputStd, Rect *vBlankRect)
{
ECV_DEBUG_LOG();
if(vBlankRect) *vBlankRect = (Rect){};
return noErr;
}
ECV_VDIG_FUNCTION(GetMaxSrcRect, short inputStd, Rect *maxSrcRect)
{
ECV_DEBUG_LOG();
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
ECVIntegerSize const s = [self->device captureSize];
[pool drain];
if(!s.width || !s.height) return badCallOrderErr;
if(maxSrcRect) *maxSrcRect = ECVNSRectToRect((NSRect){NSZeroPoint, ECVIntegerSizeToNSSize(s)});
return noErr;
}
ECV_VDIG_FUNCTION(GetActiveSrcRect, short inputStd, Rect *activeSrcRect)
{
ECV_DEBUG_LOG();
return ADD_CALLCOMPONENT_BASENAME(GetMaxSrcRect)(self, inputStd, activeSrcRect);
}
ECV_VDIG_FUNCTION(GetDigitizerRect, Rect *digitizerRect)
{
ECV_DEBUG_LOG();
return ADD_CALLCOMPONENT_BASENAME(GetMaxSrcRect)(self, ntscIn, digitizerRect);
}
ECV_VDIG_FUNCTION(GetDataRate, long *milliSecPerFrame, Fixed *framesPerSecond, long *bytesPerSecond)
{
ECV_DEBUG_LOG();
*milliSecPerFrame = 0;
NSTimeInterval frameRate = 1.0f / 60.0f;
if(QTGetTimeInterval([self->device frameRate], &frameRate)) *framesPerSecond = X2Fix(frameRate);
else *framesPerSecond = 0;
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
*bytesPerSecond = (1.0f / frameRate) * [[self->device videoStorage] bufferSize];
[pool drain];
return noErr;
}
ECV_VDIG_FUNCTION(GetPreferredTimeScale, TimeScale *preferred)
{
ECV_DEBUG_LOG();
*preferred = [self->device frameRate].timeScale;
return noErr;
}
ECV_VDIG_FUNCTION(SetTimeBase, TimeBase t)
{
ECV_DEBUG_LOG();
self->timeBase = t;
return noErr;
}
ECV_VDIG_FUNCTION(GetVideoDefaults, unsigned short *blackLevel, unsigned short *whiteLevel, unsigned short *brightness, unsigned short *hue, unsigned short *saturation, unsigned short *contrast, unsigned short *sharpness)
{
ECV_DEBUG_LOG();
*blackLevel = 0;
*whiteLevel = 0;
*brightness = round(0.5f * USHRT_MAX);
*hue = round(0.5f * USHRT_MAX);
*saturation = round(0.5f * USHRT_MAX);
*contrast = round(0.5f * USHRT_MAX);
*sharpness = 0;
return noErr;
}
ECV_VDIG_PROPERTY_UNIMPLEMENTED(BlackLevelValue);
ECV_VDIG_PROPERTY_UNIMPLEMENTED(WhiteLevelValue);
ECV_VDIG_PROPERTY(Brightness, @selector(brightness), @selector(setBrightness:));
ECV_VDIG_PROPERTY(Hue, @selector(hue), @selector(setHue:));
ECV_VDIG_PROPERTY(Saturation, @selector(saturation), @selector(setSaturation:));
ECV_VDIG_PROPERTY(Contrast, @selector(contrast), @selector(setContrast:));
ECV_VDIG_PROPERTY_UNIMPLEMENTED(Sharpness);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(CaptureStateChanging, UInt32 inStateFlags);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(GetPLLFilterType, short *pllType);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(SetPLLFilterType, short pllType);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(SetDigitizerRect, Rect *digitizerRect);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(GetPreferredImageDimensions, long *width, long *height);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(SetDataRate, long bytesPerSecond);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(GetUniqueIDs, UInt64 *outDeviceID, UInt64 * outInputID);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(SelectUniqueIDs, const UInt64 *inDeviceID, const UInt64 *inInputID);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(GetTimeCode, TimeRecord *atTime, void *timeCodeFormat, void *timeCodeTime);
ECV_VDIG_FUNCTION_UNIMPLEMENTED(SetFrameRate, Fixed framesPerSecond);