forked from FMXExpress/ios-object-pascal-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iOSapi.CoreVideo.pas
1571 lines (1413 loc) · 67.2 KB
/
iOSapi.CoreVideo.pas
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{ *********************************************************** }
{ }
{ CodeGear Delphi Runtime Library }
{ }
{ Copyright(c) 2012-2014 Embarcadero Technologies, Inc. }
{ }
{ *********************************************************** }
//
// Delphi-Objective-C Bridge
// Interfaces for Cocoa framework CoreVideo
//
unit iOSapi.CoreVideo;
interface
uses
Macapi.CoreFoundation,
Macapi.CoreServices,
Macapi.Dispatch,
Macapi.Foundation,
Macapi.Mach,
Macapi.ObjCRuntime,
Macapi.ObjectiveC,
Macapi.QuartzCore,
iOSapi.CocoaTypes,
iOSapi.CoreGraphics,
iOSapi.Foundation,
iOSapi.Metal,
iOSapi.OpenGLES;
const
kCVSMPTETimeType24 = 0;
kCVSMPTETimeType25 = 1;
kCVSMPTETimeType30Drop = 2;
kCVSMPTETimeType30 = 3;
kCVSMPTETimeType2997 = 4;
kCVSMPTETimeType2997Drop = 5;
kCVSMPTETimeType60 = 6;
kCVSMPTETimeType5994 = 7;
kCVSMPTETimeValid = (1 shl 0);
kCVSMPTETimeRunning = (1 shl 1);
kCVTimeIsIndefinite = 1 shl 0;
kCVTimeStampVideoTimeValid = (1 shl 0);
kCVTimeStampHostTimeValid = (1 shl 1);
kCVTimeStampSMPTETimeValid = (1 shl 2);
kCVTimeStampVideoRefreshPeriodValid = (1 shl 3);
kCVTimeStampRateScalarValid = (1 shl 4);
kCVTimeStampTopField = (1 shl 16);
kCVTimeStampBottomField = (1 shl 17);
kCVTimeStampVideoHostTimeValid = (kCVTimeStampVideoTimeValid or
kCVTimeStampHostTimeValid);
kCVTimeStampIsInterlaced = (kCVTimeStampTopField or kCVTimeStampBottomField);
kCVReturnSuccess = 0;
kCVReturnFirst = -6660;
kCVReturnError = kCVReturnFirst;
kCVReturnInvalidArgument = -6661;
kCVReturnAllocationFailed = -6662;
kCVReturnUnsupported = -6663;
kCVReturnInvalidDisplay = -6670;
kCVReturnDisplayLinkAlreadyRunning = -6671;
kCVReturnDisplayLinkNotRunning = -6672;
kCVReturnDisplayLinkCallbacksNotSet = -6673;
kCVReturnInvalidPixelFormat = -6680;
kCVReturnInvalidSize = -6681;
kCVReturnInvalidPixelBufferAttributes = -6682;
kCVReturnPixelBufferNotOpenGLCompatible = -6683;
kCVReturnPixelBufferNotMetalCompatible = -6684;
kCVReturnWouldExceedAllocationThreshold = -6689;
kCVReturnPoolAllocationFailed = -6690;
kCVReturnInvalidPoolAttributes = -6691;
kCVReturnLast = -6699;
kCVAttachmentMode_ShouldNotPropagate = 0;
kCVAttachmentMode_ShouldPropagate = 1;
kCVPixelFormatType_1Monochrome = 1;
kCVPixelFormatType_2Indexed = 2;
kCVPixelFormatType_4Indexed = 4;
kCVPixelFormatType_8Indexed = 8;
kCVPixelFormatType_1IndexedGray_WhiteIsZero = 33;
kCVPixelFormatType_2IndexedGray_WhiteIsZero = 34;
kCVPixelFormatType_4IndexedGray_WhiteIsZero = 36;
kCVPixelFormatType_8IndexedGray_WhiteIsZero = 40;
kCVPixelFormatType_16BE555 = 16;
kCVPixelFormatType_16LE555 = 1278555445;
kCVPixelFormatType_16LE5551 = 892679473;
kCVPixelFormatType_16BE565 = 1110783541;
kCVPixelFormatType_16LE565 = 1278555701;
kCVPixelFormatType_24RGB = 24;
kCVPixelFormatType_24BGR = 842285639;
kCVPixelFormatType_32ARGB = 32;
kCVPixelFormatType_32BGRA = 1111970369;
kCVPixelFormatType_32ABGR = 1094862674;
kCVPixelFormatType_32RGBA = 1380401729;
kCVPixelFormatType_64ARGB = 1647719521;
kCVPixelFormatType_48RGB = 1647589490;
kCVPixelFormatType_32AlphaGray = 1647522401;
kCVPixelFormatType_16Gray = 1647392359;
kCVPixelFormatType_30RGB = 1378955371;
kCVPixelFormatType_422YpCbCr8 = 846624121;
kCVPixelFormatType_4444YpCbCrA8 = 1983131704;
kCVPixelFormatType_4444YpCbCrA8R = 1916022840;
kCVPixelFormatType_4444AYpCbCr8 = 2033463352;
kCVPixelFormatType_4444AYpCbCr16 = 2033463606;
kCVPixelFormatType_444YpCbCr8 = 1983066168;
kCVPixelFormatType_422YpCbCr16 = 1983000886;
kCVPixelFormatType_422YpCbCr10 = 1983000880;
kCVPixelFormatType_444YpCbCr10 = 1983131952;
kCVPixelFormatType_420YpCbCr8Planar = 2033463856;
kCVPixelFormatType_420YpCbCr8PlanarFullRange = 1714696752;
kCVPixelFormatType_422YpCbCr_4A_8BiPlanar = 1630697081;
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange = 875704438;
kCVPixelFormatType_420YpCbCr8BiPlanarFullRange = 875704422;
kCVPixelFormatType_422YpCbCr8_yuvs = 2037741171;
kCVPixelFormatType_422YpCbCr8FullRange = 2037741158;
kCVPixelFormatType_OneComponent8 = 1278226488;
kCVPixelFormatType_TwoComponent8 = 843264056;
kCVPixelFormatType_OneComponent16Half = 1278226536;
kCVPixelFormatType_OneComponent32Float = 1278226534;
kCVPixelFormatType_TwoComponent16Half = 843264104;
kCVPixelFormatType_TwoComponent32Float = 843264102;
kCVPixelFormatType_64RGBAHalf = 1380411457;
kCVPixelFormatType_128RGBAFloat = 1380410945;
kCVPixelBufferLock_ReadOnly = 1;
kCVPixelBufferPoolFlushExcessBuffers = 1;
type
// ===== Forward declarations =====
{$M+}
MTLTexture = interface;
MTLDevice = interface;
// ===== Framework typedefs =====
{$M+}
CVOptionFlags = UInt64;
CVSMPTETime = record
subframes: Int16;
subframeDivisor: Int16;
counter: UInt32;
&type: UInt32;
flags: UInt32;
hours: Int16;
minutes: Int16;
seconds: Int16;
frames: Int16;
end;
PCVSMPTETime = ^CVSMPTETime;
CVTime = record
timeValue: Int64;
timeScale: Int32;
flags: Int32;
end;
PCVTime = ^CVTime;
CVTimeStamp = record
version: LongWord;
videoTimeScale: Int32;
videoTime: Int64;
hostTime: UInt64;
rateScalar: Double;
videoRefreshPeriod: Int64;
smpteTime: CVSMPTETime;
flags: UInt64;
reserved: UInt64;
end;
PCVTimeStamp = ^CVTimeStamp;
CVReturn = Int32;
CFStringRef = Pointer;
CVAttachmentMode = LongWord;
CVBufferRef = Pointer;
CFTypeRef = Pointer;
CFDictionaryRef = Pointer;
CVImageBufferRef = CVBufferRef;
CGFloat = Single;
CGSize = CGSize = record width: CGFloat;
height:
CGFloat;
end;
PCGSize = ^CGSize;;
CGPoint = CGPoint = record x: CGFloat;
y:
CGFloat;
end;
PCGPoint = ^CGPoint;;
CGRect = CGRect = record origin: CGPoint;
size:
CGSize;
end;
PCGRect = ^CGRect;;
Boolean = Byte;
CVPixelBufferLockFlags = CVOptionFlags;
CVPlanarComponentInfo = record offset: Int32;
rowBytes:
LongWord;
end;
PCVPlanarComponentInfo = ^CVPlanarComponentInfo;
CVPlanarPixelBufferInfo = record componentInfo: array [0 .. 0]
of CVPlanarComponentInfo;
end;
PCVPlanarPixelBufferInfo = ^CVPlanarPixelBufferInfo;
CVPlanarPixelBufferInfo_YCbCrPlanar = record componentInfoY
: CVPlanarComponentInfo;
componentInfoCb:
CVPlanarComponentInfo;
componentInfoCr:
CVPlanarComponentInfo;
end;
PCVPlanarPixelBufferInfo_YCbCrPlanar = ^CVPlanarPixelBufferInfo_YCbCrPlanar;
CVPlanarPixelBufferInfo_YCbCrBiPlanar = record componentInfoY
: CVPlanarComponentInfo;
componentInfoCbCr:
CVPlanarComponentInfo;
end;
PCVPlanarPixelBufferInfo_YCbCrBiPlanar = ^CVPlanarPixelBufferInfo_YCbCrBiPlanar;
CVPixelBufferRef = CVImageBufferRef;
CFTypeID = LongWord;
CFAllocatorRef = Pointer;
CFArrayRef = Pointer;
__darwin_size_t = LongWord;
FourCharCode = UInt32;
OSType = FourCharCode;
CVPixelBufferReleaseBytesCallback =
procedure(param1: Pointer; param2: Pointer);
cdecl;
CVPixelBufferReleasePlanarBytesCallback =
procedure(param1: Pointer; param2: Pointer; param3: LongWord; param4: LongWord;
param5: Pointer);
cdecl;
CVPixelBufferPoolRef = Pointer;
CVPixelBufferPoolFlushFlags = CVOptionFlags;
CVOpenGLESTextureRef = CVImageBufferRef;
GLenum = LongWord;
GLuint = LongWord;
GLfloat = Single;
CVOpenGLESTextureCacheRef = Pointer;
CVEAGLContext = EAGLContext;
GLint = Int32;
GLsizei = Int32;
CVFillExtendedPixelsCallBack =
function(param1: CVPixelBufferRef; param2: Pointer): Boolean;
cdecl;
CFIndex = LongInt;
CVFillExtendedPixelsCallBackData = record version: CFIndex;
fillCallBack:
CVFillExtendedPixelsCallBack;
refCon:
Pointer;
end;
PCVFillExtendedPixelsCallBackData = ^CVFillExtendedPixelsCallBackData;
CVMetalTextureRef = CVImageBufferRef;
CVMetalTextureCacheRef = Pointer;
NSUInteger = Cardinal;
MTLPixelFormat = NSUInteger;
// ===== Protocol declarations =====
MTLTexture = interface(IObjectiveC)['{F1B1A78E-D3AF-459D-BF41-140F0F768A78}']
end;
MTLDevice = interface(IObjectiveC)['{B1FE4040-9F7A-43B8-9823-804328771B94}']
end;
// ===== Exported string consts =====
function kCVZeroTime: Pointer;
function kCVIndefiniteTime: Pointer;
function kCVBufferPropagatedAttachmentsKey: Pointer;
function kCVBufferNonPropagatedAttachmentsKey: Pointer;
function kCVBufferMovieTimeKey: Pointer;
function kCVBufferTimeValueKey: Pointer;
function kCVBufferTimeScaleKey: Pointer;
function kCVImageBufferCGColorSpaceKey: Pointer;
function kCVImageBufferCleanApertureKey: Pointer;
function kCVImageBufferCleanApertureWidthKey: Pointer;
function kCVImageBufferCleanApertureHeightKey: Pointer;
function kCVImageBufferCleanApertureHorizontalOffsetKey
: Pointer;
function kCVImageBufferCleanApertureVerticalOffsetKey
: Pointer;
function kCVImageBufferPreferredCleanApertureKey
: Pointer;
function kCVImageBufferFieldCountKey: Pointer;
function kCVImageBufferFieldDetailKey: Pointer;
function kCVImageBufferFieldDetailTemporalTopFirst
: Pointer;
function kCVImageBufferFieldDetailTemporalBottomFirst
: Pointer;
function kCVImageBufferFieldDetailSpatialFirstLineEarly
: Pointer;
function kCVImageBufferFieldDetailSpatialFirstLineLate
: Pointer;
function kCVImageBufferPixelAspectRatioKey
: Pointer;
function kCVImageBufferPixelAspectRatioHorizontalSpacingKey
: Pointer;
function kCVImageBufferPixelAspectRatioVerticalSpacingKey
: Pointer;
function kCVImageBufferDisplayDimensionsKey
: Pointer;
function kCVImageBufferDisplayWidthKey
: Pointer;
function kCVImageBufferDisplayHeightKey
: Pointer;
function kCVImageBufferGammaLevelKey
: Pointer;
function kCVImageBufferICCProfileKey
: Pointer;
function kCVImageBufferYCbCrMatrixKey
: Pointer;
function kCVImageBufferYCbCrMatrix_ITU_R_709_2
: Pointer;
function kCVImageBufferYCbCrMatrix_ITU_R_601_4
: Pointer;
function kCVImageBufferYCbCrMatrix_SMPTE_240M_1995
: Pointer;
function kCVImageBufferYCbCrMatrix_DCI_P3
: Pointer;
function kCVImageBufferYCbCrMatrix_P3_D65
: Pointer;
function kCVImageBufferYCbCrMatrix_ITU_R_2020
: Pointer;
function kCVImageBufferColorPrimariesKey
: Pointer;
function kCVImageBufferColorPrimaries_ITU_R_709_2
: Pointer;
function kCVImageBufferColorPrimaries_EBU_3213
: Pointer;
function kCVImageBufferColorPrimaries_SMPTE_C
: Pointer;
function kCVImageBufferColorPrimaries_P22
: Pointer;
function kCVImageBufferColorPrimaries_DCI_P3
: Pointer;
function kCVImageBufferColorPrimaries_P3_D65
: Pointer;
function kCVImageBufferColorPrimaries_ITU_R_2020
: Pointer;
function kCVImageBufferTransferFunctionKey
: Pointer;
function kCVImageBufferTransferFunction_ITU_R_709_2
: Pointer;
function kCVImageBufferTransferFunction_SMPTE_240M_1995
: Pointer;
function kCVImageBufferTransferFunction_UseGamma
: Pointer;
function kCVImageBufferTransferFunction_EBU_3213
: Pointer;
function kCVImageBufferTransferFunction_SMPTE_C
: Pointer;
function kCVImageBufferTransferFunction_ITU_R_2020
: Pointer;
function kCVImageBufferChromaLocationTopFieldKey
: Pointer;
function kCVImageBufferChromaLocationBottomFieldKey
: Pointer;
function kCVImageBufferChromaLocation_Left
: Pointer;
function kCVImageBufferChromaLocation_Center
: Pointer;
function kCVImageBufferChromaLocation_TopLeft
: Pointer;
function kCVImageBufferChromaLocation_Top
: Pointer;
function kCVImageBufferChromaLocation_BottomLeft
: Pointer;
function kCVImageBufferChromaLocation_Bottom
: Pointer;
function kCVImageBufferChromaLocation_DV420
: Pointer;
function kCVImageBufferChromaSubsamplingKey
: Pointer;
function kCVImageBufferChromaSubsampling_420
: Pointer;
function kCVImageBufferChromaSubsampling_422
: Pointer;
function kCVImageBufferChromaSubsampling_411
: Pointer;
function kCVImageBufferAlphaChannelIsOpaque
: Pointer;
function kCVPixelBufferPixelFormatTypeKey
: Pointer;
function kCVPixelBufferMemoryAllocatorKey
: Pointer;
function kCVPixelBufferWidthKey
: Pointer;
function kCVPixelBufferHeightKey
: Pointer;
function kCVPixelBufferExtendedPixelsLeftKey
: Pointer;
function kCVPixelBufferExtendedPixelsTopKey
: Pointer;
function kCVPixelBufferExtendedPixelsRightKey
: Pointer;
function kCVPixelBufferExtendedPixelsBottomKey
: Pointer;
function kCVPixelBufferBytesPerRowAlignmentKey
: Pointer;
function kCVPixelBufferCGBitmapContextCompatibilityKey
: Pointer;
function kCVPixelBufferCGImageCompatibilityKey
: Pointer;
function kCVPixelBufferOpenGLCompatibilityKey
: Pointer;
function kCVPixelBufferPlaneAlignmentKey
: Pointer;
function kCVPixelBufferIOSurfacePropertiesKey
: Pointer;
function kCVPixelBufferOpenGLESCompatibilityKey
: Pointer;
function kCVPixelBufferMetalCompatibilityKey
: Pointer;
function kCVPixelBufferOpenGLTextureCacheCompatibilityKey
: Pointer;
function kCVPixelBufferOpenGLESTextureCacheCompatibilityKey
: Pointer;
function kCVPixelBufferPoolMinimumBufferCountKey
: Pointer;
function kCVPixelBufferPoolMaximumBufferAgeKey
: Pointer;
function kCVPixelBufferPoolAllocationThresholdKey
: Pointer;
function kCVPixelBufferPoolFreeBufferNotification
: Pointer;
function kCVOpenGLESTextureCacheMaximumTextureAgeKey
: Pointer;
function kCVPixelFormatName: Pointer;
function kCVPixelFormatConstant
: Pointer;
function kCVPixelFormatCodecType
: Pointer;
function kCVPixelFormatFourCC: Pointer;
function kCVPixelFormatContainsAlpha
: Pointer;
function kCVPixelFormatContainsYCbCr
: Pointer;
function kCVPixelFormatContainsRGB
: Pointer;
function kCVPixelFormatComponentRange
: Pointer;
function kCVPixelFormatComponentRange_VideoRange
: Pointer;
function kCVPixelFormatComponentRange_FullRange
: Pointer;
function kCVPixelFormatComponentRange_WideRange
: Pointer;
function kCVPixelFormatPlanes: Pointer;
function kCVPixelFormatBlockWidth
: Pointer;
function kCVPixelFormatBlockHeight
: Pointer;
function kCVPixelFormatBitsPerBlock
: Pointer;
function kCVPixelFormatBlockHorizontalAlignment
: Pointer;
function kCVPixelFormatBlockVerticalAlignment
: Pointer;
function kCVPixelFormatBlackBlock
: Pointer;
function kCVPixelFormatHorizontalSubsampling
: Pointer;
function kCVPixelFormatVerticalSubsampling
: Pointer;
function kCVPixelFormatOpenGLFormat
: Pointer;
function kCVPixelFormatOpenGLType
: Pointer;
function kCVPixelFormatOpenGLInternalFormat
: Pointer;
function kCVPixelFormatCGBitmapInfo
: Pointer;
function kCVPixelFormatQDCompatibility
: Pointer;
function kCVPixelFormatCGBitmapContextCompatibility
: Pointer;
function kCVPixelFormatCGImageCompatibility
: Pointer;
function kCVPixelFormatOpenGLCompatibility
: Pointer;
function kCVPixelFormatOpenGLESCompatibility
: Pointer;
function kCVPixelFormatFillExtendedPixelsCallback
: Pointer;
function kCVMetalTextureCacheMaximumTextureAgeKey
: Pointer;
// ===== External functions =====
const
libCoreVideo =
'/System/Library/Frameworks/CoreVideo.framework/CoreVideo';
function CVBufferRetain
(buffer: CVBufferRef): CVBufferRef;
cdecl; external libCoreVideo name _PU +
'CVBufferRetain';
procedure CVBufferRelease
(buffer: CVBufferRef); cdecl;
external libCoreVideo name _PU +
'CVBufferRelease';
procedure CVBufferSetAttachment
(buffer: CVBufferRef; key: CFStringRef;
value: CFTypeRef;
attachmentMode: CVAttachmentMode);
cdecl; external libCoreVideo name _PU +
'CVBufferSetAttachment';
function CVBufferGetAttachment
(buffer: CVBufferRef; key: CFStringRef;
attachmentMode: PLongWord): CFTypeRef;
cdecl; external libCoreVideo name _PU +
'CVBufferGetAttachment';
procedure CVBufferRemoveAttachment
(buffer: CVBufferRef; key: CFStringRef);
cdecl; external libCoreVideo name _PU +
'CVBufferRemoveAttachment';
procedure CVBufferRemoveAllAttachments
(buffer: CVBufferRef); cdecl;
external libCoreVideo name _PU +
'CVBufferRemoveAllAttachments';
function CVBufferGetAttachments
(buffer: CVBufferRef;
attachmentMode: CVAttachmentMode)
: CFDictionaryRef; cdecl;
external libCoreVideo name _PU +
'CVBufferGetAttachments';
procedure CVBufferSetAttachments
(buffer: CVBufferRef;
theAttachments: CFDictionaryRef;
attachmentMode: CVAttachmentMode);
cdecl; external libCoreVideo name _PU +
'CVBufferSetAttachments';
procedure CVBufferPropagateAttachments
(sourceBuffer: CVBufferRef;
destinationBuffer: CVBufferRef); cdecl;
external libCoreVideo name _PU +
'CVBufferPropagateAttachments';
function CVImageBufferGetEncodedSize
(imageBuffer: CVImageBufferRef): CGSize;
cdecl; external libCoreVideo name _PU +
'CVImageBufferGetEncodedSize';
function CVImageBufferGetDisplaySize
(imageBuffer: CVImageBufferRef): CGSize;
cdecl; external libCoreVideo name _PU +
'CVImageBufferGetDisplaySize';
function CVImageBufferGetCleanRect
(imageBuffer: CVImageBufferRef): CGRect;
cdecl; external libCoreVideo name _PU +
'CVImageBufferGetCleanRect';
function CVImageBufferIsFlipped
(imageBuffer: CVImageBufferRef)
: Boolean; cdecl;
external libCoreVideo name _PU +
'CVImageBufferIsFlipped';
function CVPixelBufferGetTypeID
: CFTypeID; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetTypeID';
function CVPixelBufferRetain
(texture: CVPixelBufferRef)
: CVPixelBufferRef; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferRetain';
procedure CVPixelBufferRelease
(texture: CVPixelBufferRef); cdecl;
external libCoreVideo name _PU +
'CVPixelBufferRelease';
function CVPixelBufferCreateResolvedAttributesDictionary
(allocator: CFAllocatorRef;
attributes: CFArrayRef;
resolvedDictionaryOut: Pointer)
: CVReturn; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferCreateResolvedAttributesDictionary';
function CVPixelBufferCreate
(allocator: CFAllocatorRef;
width: LongWord; height: LongWord;
pixelFormatType: OSType;
pixelBufferAttributes: CFDictionaryRef;
pixelBufferOut: Pointer): CVReturn;
cdecl; external libCoreVideo name _PU +
'CVPixelBufferCreate';
function CVPixelBufferCreateWithBytes
(allocator: CFAllocatorRef;
width: LongWord; height: LongWord;
pixelFormatType: OSType;
baseAddress: Pointer;
bytesPerRow: LongWord;
releaseCallback
: CVPixelBufferReleaseBytesCallback;
releaseRefCon: Pointer;
pixelBufferAttributes: CFDictionaryRef;
pixelBufferOut: Pointer): CVReturn;
cdecl; external libCoreVideo name _PU +
'CVPixelBufferCreateWithBytes';
function CVPixelBufferCreateWithPlanarBytes
(allocator: CFAllocatorRef;
width: LongWord; height: LongWord;
pixelFormatType: OSType;
dataPtr: Pointer; dataSize: LongWord;
numberOfPlanes: LongWord;
planeBaseAddress: Pointer;
planeWidth: LongWord;
planeHeight: LongWord;
planeBytesPerRow: LongWord;
releaseCallback
: CVPixelBufferReleasePlanarBytesCallback;
releaseRefCon: Pointer;
pixelBufferAttributes: CFDictionaryRef;
pixelBufferOut: Pointer): CVReturn;
cdecl; external libCoreVideo name _PU +
'CVPixelBufferCreateWithPlanarBytes';
function CVPixelBufferLockBaseAddress
(pixelBuffer: CVPixelBufferRef;
lockFlags: CVPixelBufferLockFlags)
: CVReturn; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferLockBaseAddress';
function CVPixelBufferUnlockBaseAddress
(pixelBuffer: CVPixelBufferRef;
unlockFlags: CVPixelBufferLockFlags)
: CVReturn; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferUnlockBaseAddress';
function CVPixelBufferGetWidth
(pixelBuffer: CVPixelBufferRef)
: LongWord; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetWidth';
function CVPixelBufferGetHeight
(pixelBuffer: CVPixelBufferRef)
: LongWord; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetHeight';
function CVPixelBufferGetPixelFormatType
(pixelBuffer: CVPixelBufferRef): OSType;
cdecl; external libCoreVideo name _PU +
'CVPixelBufferGetPixelFormatType';
function CVPixelBufferGetBaseAddress
(pixelBuffer: CVPixelBufferRef)
: Pointer; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetBaseAddress';
function CVPixelBufferGetBytesPerRow
(pixelBuffer: CVPixelBufferRef)
: LongWord; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetBytesPerRow';
function CVPixelBufferGetDataSize
(pixelBuffer: CVPixelBufferRef)
: LongWord; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetDataSize';
function CVPixelBufferIsPlanar
(pixelBuffer: CVPixelBufferRef)
: Boolean; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferIsPlanar';
function CVPixelBufferGetPlaneCount
(pixelBuffer: CVPixelBufferRef)
: LongWord; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetPlaneCount';
function CVPixelBufferGetWidthOfPlane
(pixelBuffer: CVPixelBufferRef;
planeIndex: LongWord): LongWord; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetWidthOfPlane';
function CVPixelBufferGetHeightOfPlane
(pixelBuffer: CVPixelBufferRef;
planeIndex: LongWord): LongWord; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetHeightOfPlane';
function CVPixelBufferGetBaseAddressOfPlane
(pixelBuffer: CVPixelBufferRef;
planeIndex: LongWord): Pointer; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetBaseAddressOfPlane';
function CVPixelBufferGetBytesPerRowOfPlane
(pixelBuffer: CVPixelBufferRef;
planeIndex: LongWord): LongWord; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetBytesPerRowOfPlane';
procedure CVPixelBufferGetExtendedPixels
(pixelBuffer: CVPixelBufferRef;
extraColumnsOnLeft: PLongWord;
extraColumnsOnRight: PLongWord;
extraRowsOnTop: PLongWord;
extraRowsOnBottom: PLongWord); cdecl;
external libCoreVideo name _PU +
'CVPixelBufferGetExtendedPixels';
function CVPixelBufferFillExtendedPixels
(pixelBuffer: CVPixelBufferRef)
: CVReturn; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferFillExtendedPixels';
function CVPixelBufferPoolGetTypeID
: CFTypeID; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferPoolGetTypeID';
function CVPixelBufferPoolRetain
(pixelBufferPool: CVPixelBufferPoolRef)
: CVPixelBufferPoolRef; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferPoolRetain';
procedure CVPixelBufferPoolRelease
(pixelBufferPool: CVPixelBufferPoolRef);
cdecl; external libCoreVideo name _PU +
'CVPixelBufferPoolRelease';
function CVPixelBufferPoolCreate
(allocator: CFAllocatorRef;
poolAttributes: CFDictionaryRef;
pixelBufferAttributes: CFDictionaryRef;
poolOut: Pointer): CVReturn; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferPoolCreate';
function CVPixelBufferPoolGetAttributes
(pool: CVPixelBufferPoolRef)
: CFDictionaryRef; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferPoolGetAttributes';
function CVPixelBufferPoolGetPixelBufferAttributes
(pool: CVPixelBufferPoolRef)
: CFDictionaryRef; cdecl;
external libCoreVideo name _PU +
'CVPixelBufferPoolGetPixelBufferAttributes';
function CVPixelBufferPoolCreatePixelBuffer
(allocator: CFAllocatorRef;
pixelBufferPool: CVPixelBufferPoolRef;
pixelBufferOut: Pointer): CVReturn;
cdecl; external libCoreVideo name _PU +
'CVPixelBufferPoolCreatePixelBuffer';
function CVPixelBufferPoolCreatePixelBufferWithAuxAttributes
(allocator: CFAllocatorRef;
pixelBufferPool: CVPixelBufferPoolRef;
auxAttributes: CFDictionaryRef;
pixelBufferOut: Pointer): CVReturn;
cdecl; external libCoreVideo name _PU +
'CVPixelBufferPoolCreatePixelBufferWithAuxAttributes';
procedure CVPixelBufferPoolFlush
(pool: CVPixelBufferPoolRef;
options: CVPixelBufferPoolFlushFlags);
cdecl; external libCoreVideo name _PU +
'CVPixelBufferPoolFlush';
function CVOpenGLESTextureGetTypeID
: CFTypeID; cdecl;
external libCoreVideo name _PU +
'CVOpenGLESTextureGetTypeID';
function CVOpenGLESTextureGetTarget
(image: CVOpenGLESTextureRef): GLenum;
cdecl; external libCoreVideo name _PU +
'CVOpenGLESTextureGetTarget';
function CVOpenGLESTextureGetName
(image: CVOpenGLESTextureRef): GLuint;
cdecl; external libCoreVideo name _PU +
'CVOpenGLESTextureGetName';
function CVOpenGLESTextureIsFlipped
(image: CVOpenGLESTextureRef): Boolean;
cdecl; external libCoreVideo name _PU +
'CVOpenGLESTextureIsFlipped';
procedure CVOpenGLESTextureGetCleanTexCoords
(image: CVOpenGLESTextureRef;
lowerLeft: GLfloat; lowerRight: GLfloat;
upperRight: GLfloat;
upperLeft: GLfloat); cdecl;
external libCoreVideo name _PU +
'CVOpenGLESTextureGetCleanTexCoords';
function CVOpenGLESTextureCacheGetTypeID
: CFTypeID; cdecl;
external libCoreVideo name _PU +
'CVOpenGLESTextureCacheGetTypeID';
function CVOpenGLESTextureCacheCreate
(allocator: CFAllocatorRef;
cacheAttributes: CFDictionaryRef;
EAGLContext: Pointer { CVEAGLContext };
textureAttributes: CFDictionaryRef;
cacheOut: Pointer): CVReturn; cdecl;
external libCoreVideo name _PU +
'CVOpenGLESTextureCacheCreate';
function CVOpenGLESTextureCacheCreateTextureFromImage
(allocator: CFAllocatorRef;
textureCache: CVOpenGLESTextureCacheRef;
sourceImage: CVImageBufferRef;
textureAttributes: CFDictionaryRef;
target: GLenum; internalFormat: GLint;
width: GLsizei; height: GLsizei;
format: GLenum; &type: GLenum;
planeIndex: LongWord;
textureOut: Pointer): CVReturn; cdecl;
external libCoreVideo name _PU +
'CVOpenGLESTextureCacheCreateTextureFromImage';
procedure CVOpenGLESTextureCacheFlush
(textureCache
: CVOpenGLESTextureCacheRef;
options: CVOptionFlags); cdecl;
external libCoreVideo name _PU +
'CVOpenGLESTextureCacheFlush';
function CVPixelFormatDescriptionCreateWithPixelFormatType
(allocator: CFAllocatorRef;
pixelFormat: OSType): CFDictionaryRef;
cdecl; external libCoreVideo name _PU +
'CVPixelFormatDescriptionCreateWithPixelFormatType';
function CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes
(allocator: CFAllocatorRef): CFArrayRef;
cdecl; external libCoreVideo name _PU +
'CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes';
procedure CVPixelFormatDescriptionRegisterDescriptionWithPixelFormatType
(description: CFDictionaryRef;
pixelFormat: OSType); cdecl;
external libCoreVideo name _PU +
'CVPixelFormatDescriptionRegisterDescriptionWithPixelFormatType';
function CVMetalTextureGetTypeID
: CFTypeID; cdecl;
external libCoreVideo name _PU +
'CVMetalTextureGetTypeID';
function CVMetalTextureGetTexture
(image: CVMetalTextureRef): Pointer;
cdecl; external libCoreVideo name _PU +
'CVMetalTextureGetTexture';
function CVMetalTextureIsFlipped
(image: CVMetalTextureRef): Boolean;
cdecl; external libCoreVideo name _PU +
'CVMetalTextureIsFlipped';
procedure CVMetalTextureGetCleanTexCoords
(image: CVMetalTextureRef;
lowerLeft: Single; lowerRight: Single;
upperRight: Single; upperLeft: Single);
cdecl; external libCoreVideo name _PU +
'CVMetalTextureGetCleanTexCoords';
function CVMetalTextureCacheGetTypeID
: CFTypeID; cdecl;
external libCoreVideo name _PU +
'CVMetalTextureCacheGetTypeID';
function CVMetalTextureCacheCreate
(allocator: CFAllocatorRef;
cacheAttributes: CFDictionaryRef;
metalDevice: Pointer;
textureAttributes: CFDictionaryRef;
cacheOut: Pointer): CVReturn; cdecl;
external libCoreVideo name _PU +
'CVMetalTextureCacheCreate';
function CVMetalTextureCacheCreateTextureFromImage
(allocator: CFAllocatorRef;
textureCache: CVMetalTextureCacheRef;
sourceImage: CVImageBufferRef;
textureAttributes: CFDictionaryRef;
pixelFormat: MTLPixelFormat;
width: LongWord; height: LongWord;
planeIndex: LongWord;
textureOut: Pointer): CVReturn; cdecl;
external libCoreVideo name _PU +
'CVMetalTextureCacheCreateTextureFromImage';
procedure CVMetalTextureCacheFlush
(textureCache: CVMetalTextureCacheRef;
options: CVOptionFlags); cdecl;
external libCoreVideo name _PU +
'CVMetalTextureCacheFlush';
function CVGetCurrentHostTime: UInt64;
cdecl; external libCoreVideo name _PU +
'CVGetCurrentHostTime';
function CVGetHostClockFrequency
: Double; cdecl;
external libCoreVideo name _PU +
'CVGetHostClockFrequency';
function CVGetHostClockMinimumTimeDelta
: LongWord; cdecl;
external libCoreVideo name _PU +
'CVGetHostClockMinimumTimeDelta';
implementation
{$IF defined(IOS) and NOT defined(CPUARM)}
uses
Posix.Dlfcn;
var
CoreVideoModule: THandle;
{$ENDIF IOS}
function kCVZeroTime: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVZeroTime');
end;
function kCVIndefiniteTime: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVIndefiniteTime');
end;
function kCVBufferPropagatedAttachmentsKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVBufferPropagatedAttachmentsKey');
end;
function kCVBufferNonPropagatedAttachmentsKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVBufferNonPropagatedAttachmentsKey');
end;
function kCVBufferMovieTimeKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVBufferMovieTimeKey');
end;
function kCVBufferTimeValueKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVBufferTimeValueKey');
end;
function kCVBufferTimeScaleKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVBufferTimeScaleKey');
end;
function kCVImageBufferCGColorSpaceKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVImageBufferCGColorSpaceKey');
end;
function kCVImageBufferCleanApertureKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVImageBufferCleanApertureKey');
end;
function kCVImageBufferCleanApertureWidthKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVImageBufferCleanApertureWidthKey');
end;
function kCVImageBufferCleanApertureHeightKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVImageBufferCleanApertureHeightKey');
end;
function kCVImageBufferCleanApertureHorizontalOffsetKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVImageBufferCleanApertureHorizontalOffsetKey');
end;
function kCVImageBufferCleanApertureVerticalOffsetKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVImageBufferCleanApertureVerticalOffsetKey');
end;
function kCVImageBufferPreferredCleanApertureKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVImageBufferPreferredCleanApertureKey');
end;
function kCVImageBufferFieldCountKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVImageBufferFieldCountKey');
end;
function kCVImageBufferFieldDetailKey: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo, 'kCVImageBufferFieldDetailKey');
end;
function kCVImageBufferFieldDetailTemporalTopFirst: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVImageBufferFieldDetailTemporalTopFirst');
end;
function kCVImageBufferFieldDetailTemporalBottomFirst: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVImageBufferFieldDetailTemporalBottomFirst');
end;
function kCVImageBufferFieldDetailSpatialFirstLineEarly: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,
'kCVImageBufferFieldDetailSpatialFirstLineEarly');
end;
function kCVImageBufferFieldDetailSpatialFirstLineLate: Pointer;
begin
Result := CocoaPointerConst(libCoreVideo,