-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCoreVideo.framework.h
2287 lines (1918 loc) · 119 KB
/
CoreVideo.framework.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
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
// ========== CoreVideo.framework/Headers/CVBuffer.h
/*
* CVBuffer.h
* CoreVideo
*
* Copyright (c) 2004-2015 Apple Inc. All rights reserved.
*
*/
/*! @header CVBuffer.h
@copyright 2004-2015 Apple Inc. All rights reserved.
@availability Mac OS X 10.4 or later, and iOS 4.0 or later
@discussion CVBufferRef types are abstract and only define ways to attach meta data to buffers (such as timestamps,
colorspace information, etc.). CVBufferRefs do not imply any particular kind of data storage. It could
be compressed data, image data, etc.
*/
#if !defined(__COREVIDEO_CVBUFFER_H__)
#define __COREVIDEO_CVBUFFER_H__ 1
#include <TargetConditionals.h>
#include <Availability.h>
#include <AvailabilityMacros.h>
#include <CoreVideo/CVBase.h>
#include <CoreVideo/CVReturn.h>
#include <CoreFoundation/CFDictionary.h>
#if TARGET_OS_MAC
#include <stddef.h>
#include <stdint.h>
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#pragma mark CVBufferRef attribute keys
/* The following two keys are useful with the CoreVideo pool and texture cache APIs so that you can specify
an initial set of default buffer attachments to automatically be attached to the buffer when it is created. */
CV_EXPORT const CFStringRef CV_NONNULL kCVBufferPropagatedAttachmentsKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVBufferNonPropagatedAttachmentsKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
#pragma mark CVBufferRef attachment keys
CV_EXPORT const CFStringRef CV_NONNULL kCVBufferMovieTimeKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // Generally only available for frames emitted by QuickTime; CFDictionary containing these two keys:
CV_EXPORT const CFStringRef CV_NONNULL kCVBufferTimeValueKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVBufferTimeScaleKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
#pragma mark CVBufferRef
typedef CF_ENUM(uint32_t, CVAttachmentMode)
{
kCVAttachmentMode_ShouldNotPropagate = 0,
kCVAttachmentMode_ShouldPropagate = 1
};
/*!
@typedef CVBufferRef
@abstract Base type for all CoreVideo buffers
*/
typedef struct CV_BRIDGED_TYPE(id) __CVBuffer *CVBufferRef;
/*!
@function CVBufferRetain
@abstract Retains a CVBuffer object
@discussion Like CFRetain CVBufferRetain increments the retain count of a CVBuffer object. In contrast to the CF call it is NULL safe.
@param buffer A CVBuffer object that you want to retain.
@result A CVBuffer object that is the same as the passed in buffer.
*/
CV_EXPORT CVBufferRef CV_NULLABLE CVBufferRetain( CVBufferRef CV_NULLABLE buffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVBufferRelease
@abstract Release a CVBuffer object
@discussion Like CFRetain CVBufferRetain decrements the retain count of a CVBuffer object. If that count consequently becomes zero the memory allocated to the object is deallocated and the object is destroyed. In contrast to the CF call it is NULL safe.
@param buffer A CVBuffer object that you want to release.
*/
CV_EXPORT void CVBufferRelease( CV_RELEASES_ARGUMENT CVBufferRef CV_NULLABLE buffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
#pragma mark CVBufferAttachment
/*!
@function CVBufferSetAttachment
@abstract Sets or adds a attachment of a CVBuffer object
@discussion You can attach any CF object to a CVBuffer object to store additional information. CVBufferGetAttachment stores an attachement identified by a key. If the key doesn't exist, the attachment will be added. If the key does exist, the existing attachment will be replaced. In bouth cases the retain count of the attachment will be incremented. The value can be any CFType but nil has no defined behavior.
@param buffer Target CVBuffer object.
@param key Key in form of a CFString identifying the desired attachment.
@param value Attachment in form af a CF object.
@param attachmentMode Specifies which attachment mode is desired for this attachment. A particular attachment key may only exist in
a single mode at a time.
*/
CV_EXPORT void CVBufferSetAttachment( CVBufferRef CV_NONNULL buffer, CFStringRef CV_NONNULL key, CFTypeRef CV_NONNULL value, CVAttachmentMode attachmentMode ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVBufferGetAttachment
@abstract Returns a specific attachment of a CVBuffer object
@discussion You can attach any CF object to a CVBuffer object to store additional information. CVBufferGetAttachment retrieves an attachement identified by a key.
@param buffer Target CVBuffer object.
@param key Key in form of a CFString identifying the desired attachment.
@param attachmentMode. Returns the mode of the attachment, if desired. May be NULL.
@result If found the attachment object
*/
CV_EXPORT CFTypeRef CV_NULLABLE CVBufferGetAttachment( CVBufferRef CV_NONNULL buffer, CFStringRef CV_NONNULL key, CVAttachmentMode * CV_NULLABLE attachmentMode ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVBufferRemoveAttachment
@abstract Removes a specific attachment of a CVBuffer object
@discussion CVBufferRemoveAttachment removes an attachement identified by a key. If found the attachement is removed and the retain count decremented.
@param buffer Target CVBuffer object.
@param key Key in form of a CFString identifying the desired attachment.
*/
CV_EXPORT void CVBufferRemoveAttachment( CVBufferRef CV_NONNULL buffer, CFStringRef CV_NONNULL key ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVBufferRemoveAllAttachments
@abstract Removes all attachments of a CVBuffer object
@discussion While CVBufferRemoveAttachment removes a specific attachement identified by a key CVBufferRemoveAllAttachments removes all attachments of a buffer and decrements their retain counts.
@param buffer Target CVBuffer object.
*/
CV_EXPORT void CVBufferRemoveAllAttachments( CVBufferRef CV_NONNULL buffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVBufferGetAttachments
@abstract Returns all attachments of a CVBuffer object
@discussion CVBufferGetAttachments is a convenience call that returns all attachments with their corresponding keys in a CFDictionary.
@param buffer Target CVBuffer object.
@result A CFDictionary with all buffer attachments identified by there keys. If no attachment is present, the dictionary is empty. Returns NULL
for invalid attachment mode.
*/
CV_EXPORT CFDictionaryRef CF_RETURNS_NOT_RETAINED CV_NULLABLE CVBufferGetAttachments( CVBufferRef CV_NONNULL buffer, CVAttachmentMode attachmentMode ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVBufferSetAttachments
@abstract Sets a set of attachments for a CVBuffer
@discussion CVBufferSetAttachments is a convenience call that in turn calls CVBufferSetAttachment for each key and value in the given dictionary. All key value pairs must be in the root level of the dictionary.
@param buffer Target CVBuffer object.
*/
CV_EXPORT void CVBufferSetAttachments( CVBufferRef CV_NONNULL buffer, CFDictionaryRef CV_NONNULL theAttachments, CVAttachmentMode attachmentMode ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVBufferPropagateAttachments
@abstract Copy all propagatable attachments from one buffer to another.
@discussion CVBufferPropagateAttachments is a convenience call that copies all attachments with a mode of kCVAttachmentMode_ShouldPropagate from one
buffer to another.
@param sourceBuffer CVBuffer to copy attachments from.
@param destinationBuffer CVBuffer to copy attachments to.
*/
CV_EXPORT void CVBufferPropagateAttachments( CVBufferRef CV_NONNULL sourceBuffer, CVBufferRef CV_NONNULL destinationBuffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
#if defined(__cplusplus)
}
#endif
#endif
// ========== CoreVideo.framework/Headers/CVOpenGLESTextureCache.h
/*
* CVOpenGLESTextureCache.h
* CoreVideo
*
* Copyright 2011-2015 Apple Inc. All rights reserved.
*
*/
/*! @header CVOpenGLESTextureCache.h
@copyright 2011-2015 Apple Inc. All rights reserved.
@availability iOS 5.0 or later
@discussion A CoreVideo TextureCache is used to cache and manage CVOpenGLESTextures.
*/
#if !defined(__COREVIDEO__CVOPENGLESTEXTURECACHE_H__)
#define __COREVIDEO__CVOPENGLESTEXTURECACHE_H__ 1
#include <CoreVideo/CVBase.h>
#include <CoreVideo/CVReturn.h>
#include <CoreVideo/CVBuffer.h>
#include <CoreVideo/CVOpenGLESTexture.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*!
@typedef CVOpenGLESTextureCacheRef
@abstract CoreVideo OpenGLES Texture Cache
*/
typedef struct CV_BRIDGED_TYPE(id) __CVOpenGLESTextureCache *CVOpenGLESTextureCacheRef;
#ifndef COREVIDEO_USE_EAGLCONTEXT_CLASS_IN_API
#define COREVIDEO_USE_EAGLCONTEXT_CLASS_IN_API 1
#endif
#if defined(__OBJC__) && COREVIDEO_USE_EAGLCONTEXT_CLASS_IN_API
@class EAGLContext;
typedef EAGLContext *CVEAGLContext;
#else
typedef void *CVEAGLContext;
#endif
//
// cacheAttributes
//
// By default, textures will age out after one second. Setting a maximum
// texture age of zero will disable the age-out mechanism completely.
// CVOpenGLESTextureCacheFlush() can be used to force eviction in either case.
CV_EXPORT const CFStringRef CV_NONNULL kCVOpenGLESTextureCacheMaximumTextureAgeKey COREVIDEO_GL_DEPRECATED(ios, 5.0, 12.0) COREVIDEO_GL_DEPRECATED(tvos, 9.0, 12.0) API_UNAVAILABLE(macosx) __WATCHOS_PROHIBITED;
//
// textureAttributes - reserved for future use
CV_EXPORT CFTypeID CVOpenGLESTextureCacheGetTypeID(void) COREVIDEO_GL_DEPRECATED(ios, 5.0, 12.0) COREVIDEO_GL_DEPRECATED(tvos, 9.0, 12.0) API_UNAVAILABLE(macosx) __WATCHOS_PROHIBITED;
/*!
@function CVOpenGLESTextureCacheCreate
@abstract Creates a new Texture Cache.
@param allocator The CFAllocatorRef to use for allocating the cache. May be NULL.
@param cacheAttributes A CFDictionaryRef containing the attributes of the cache itself. May be NULL.
@param eaglContext The OpenGLES 2.0 context into which the texture objects will be created. OpenGLES 1.x contexts are not supported.
@param textureAttributes A CFDictionaryRef containing the attributes to be used for creating the CVOpenGLESTexture objects. May be NULL.
@param cacheOut The newly created texture cache will be placed here
@result Returns kCVReturnSuccess on success
*/
CV_EXPORT CVReturn CVOpenGLESTextureCacheCreate(
CFAllocatorRef CV_NULLABLE allocator,
CFDictionaryRef CV_NULLABLE cacheAttributes,
CVEAGLContext CV_NONNULL eaglContext,
CFDictionaryRef CV_NULLABLE textureAttributes,
CV_RETURNS_RETAINED_PARAMETER CVOpenGLESTextureCacheRef CV_NULLABLE * CV_NONNULL cacheOut) COREVIDEO_GL_DEPRECATED(ios, 5.0, 12.0) COREVIDEO_GL_DEPRECATED(tvos, 9.0, 12.0) API_UNAVAILABLE(macosx) __WATCHOS_PROHIBITED;
/*!
@function CVOpenGLESTextureCacheCreateTextureFromImage
@abstract Creates a CVOpenGLESTexture object from an existing CVImageBuffer
@param allocator The CFAllocatorRef to use for allocating the CVOpenGLESTexture object. May be NULL.
@param textureCache The texture cache object that will manage the texture.
@param sourceImage The CVImageBuffer that you want to create a CVOpenGLESTexture from.
@param textureAttributes A CFDictionaryRef containing attributes to be used for creating the CVOpenGLESTexture objects. May be NULL.
@param target Specifies the target texture. GL_TEXTURE_2D and GL_RENDERBUFFER are the only targets currently supported.
@param internalFormat Specifies the number of color components in the texture. Examples are GL_RGBA, GL_LUMINANCE, GL_RGBA8_OES, GL_RG, and GL_RED (NOTE: On GLES3 use GL_R8 instead of GL_RED).
@param width Specifies the width of the texture image.
@param height Specifies the height of the texture image.
@param format Specifies the format of the pixel data. Examples are GL_RGBA and GL_LUMINANCE.
@param type Specifies the data type of the pixel data. Examples are GL_UNSIGNED_BYTE.
@param planeIndex Specifies the plane of the CVImageBuffer to map bind. Ignored for non-planar CVImageBuffers.
@param textureOut The newly created texture object will be placed here.
@result Returns kCVReturnSuccess on success
@discussion Creates or returns a cached CVOpenGLESTexture texture object mapped to the CVImageBuffer and
associated params. This creates a live binding between the CVImageBuffer and underlying
CVOpenGLESTexture texture object. The EAGLContext associated with the cache may be modified,
to create, delete, or bind textures. When used as a source texture or GL_COLOR_ATTACHMENT,
the CVImageBuffer must be unlocked before rendering. The source or render buffer texture should
not be re-used until the rendering has completed. This can be guaranteed by calling glFlush().
Here are some example mappings:
Mapping a BGRA buffer as a source texture:
CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, NULL, GL_TEXTURE_2D, GL_RGBA, width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0, &outTexture);
Mapping a BGRA buffer as a renderbuffer:
CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, NULL, GL_RENDERBUFFER, GL_RGBA8_OES, width, height, GL_RGBA, GL_UNSIGNED_BYTE, 0, &outTexture);
Mapping the luma plane of a 420v buffer as a source texture:
CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, NULL, GL_TEXTURE_2D, GL_LUMINANCE, width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, &outTexture);
Mapping the chroma plane of a 420v buffer as a source texture:
CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, NULL, GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, width/2, height/2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 1, &outTexture);
Mapping a yuvs buffer as a source texture (note: yuvs/f and 2vuy are unpacked and resampled -- not colorspace converted)
CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, NULL, GL_TEXTURE_2D, GL_RGB_422_APPLE, width, height, GL_RGB_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 1, &outTexture);
*/
CV_EXPORT CVReturn CVOpenGLESTextureCacheCreateTextureFromImage(
CFAllocatorRef CV_NULLABLE allocator,
CVOpenGLESTextureCacheRef CV_NONNULL textureCache,
CVImageBufferRef CV_NONNULL sourceImage,
CFDictionaryRef CV_NULLABLE textureAttributes,
GLenum target,
GLint internalFormat,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
size_t planeIndex,
CV_RETURNS_RETAINED_PARAMETER CVOpenGLESTextureRef CV_NULLABLE * CV_NONNULL textureOut ) COREVIDEO_GL_DEPRECATED(ios, 5.0, 12.0) COREVIDEO_GL_DEPRECATED(tvos, 9.0, 12.0) API_UNAVAILABLE(macosx) __WATCHOS_PROHIBITED;
/*!
@function CVOpenGLESTextureCacheFlush
@abstract Performs internal housekeeping/recycling operations
@discussion This call must be made periodically to give the texture cache a chance to make OpenGLES calls
on the OpenGLES context used to create it in order to do housekeeping operations. The EAGLContext
associated with the cache may be used to delete or unbind textures.
@param textureCache The texture cache object to flush
@param options Currently unused, set to 0.
*/
CV_EXPORT void CVOpenGLESTextureCacheFlush( CVOpenGLESTextureCacheRef CV_NONNULL textureCache, CVOptionFlags options ) COREVIDEO_GL_DEPRECATED(ios, 5.0, 12.0) COREVIDEO_GL_DEPRECATED(tvos, 9.0, 12.0) API_UNAVAILABLE(macosx) __WATCHOS_PROHIBITED;
#if defined(__cplusplus)
}
#endif
#endif
// ========== CoreVideo.framework/Headers/CVBase.h
/*
* CVBase.h
* CoreVideo
*
* Copyright (c) 2004-2017 Apple Inc. All rights reserved.
*
*/
/*! @header CVBase.h
@copyright 2004-2017 Apple Inc. All rights reserved.
@availability Mac OS X 10.4 or later, and iOS 4.0 or later
@discussion Here you can find the type declarations for CoreVideo. CoreVideo uses a CVTimeStamp structure to store video display time stamps.
*/
#if !defined(__COREVIDEO_CVBASE_H__)
#define __COREVIDEO_CVBASE_H__ 1
#include <TargetConditionals.h>
#include <Availability.h>
#include <AvailabilityMacros.h>
#include <CoreFoundation/CFBase.h>
#if defined(__cplusplus)
extern "C" {
#endif
#define COREVIDEO_TRUE (1 && 1)
#define COREVIDEO_FALSE (0 && 1)
#define COREVIDEO_SUPPORTS_DIRECT3D COREVIDEO_FALSE
#if TARGET_OS_UIKITFORMAC
#define COREVIDEO_SUPPORTS_OPENGL COREVIDEO_TRUE
#define COREVIDEO_SUPPORTS_OPENGLES COREVIDEO_FALSE
#else
#if TARGET_OS_OSX
#define COREVIDEO_SUPPORTS_OPENGL COREVIDEO_TRUE
#else
#define COREVIDEO_SUPPORTS_OPENGL COREVIDEO_FALSE
#endif
#if TARGET_OS_MAC && TARGET_OS_IPHONE
#define COREVIDEO_SUPPORTS_OPENGLES COREVIDEO_TRUE
#else
#define COREVIDEO_SUPPORTS_OPENGLES COREVIDEO_FALSE
#endif
#endif
#if ((TARGET_OS_MAC && ! TARGET_OS_IPHONE) || (0))
#define COREVIDEO_SUPPORTS_COLORSPACE COREVIDEO_TRUE
#else
#define COREVIDEO_SUPPORTS_COLORSPACE COREVIDEO_FALSE
#endif
#if (TARGET_OS_MAC && ! TARGET_OS_IPHONE)
#define COREVIDEO_SUPPORTS_DISPLAYLINK COREVIDEO_TRUE
#else
#define COREVIDEO_SUPPORTS_DISPLAYLINK COREVIDEO_FALSE
#endif
#if TARGET_OS_MAC
#define COREVIDEO_SUPPORTS_IOSURFACE COREVIDEO_TRUE
#else
#define COREVIDEO_SUPPORTS_IOSURFACE COREVIDEO_FALSE
#endif
#if TARGET_OS_EMBEDDED && (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80300)
#define COREVIDEO_SUPPORTS_PREFETCH COREVIDEO_TRUE
#elif TARGET_OS_OSX
#define COREVIDEO_SUPPORTS_PREFETCH COREVIDEO_TRUE
#else
#define COREVIDEO_SUPPORTS_PREFETCH COREVIDEO_FALSE
#endif
#if TARGET_OS_EMBEDDED && (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80300)
#define COREVIDEO_SUPPORTS_IOSURFACE_PREFETCH COREVIDEO_TRUE
#elif TARGET_OS_OSX && (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
#define COREVIDEO_SUPPORTS_IOSURFACE_PREFETCH COREVIDEO_TRUE
#else
#define COREVIDEO_SUPPORTS_IOSURFACE_PREFETCH COREVIDEO_FALSE
#endif
#if TARGET_OS_SIMULATOR
#define COREVIDEO_SUPPORTS_GLES_TEX_IMAGE_IOSURFACE COREVIDEO_FALSE
#else
#define COREVIDEO_SUPPORTS_GLES_TEX_IMAGE_IOSURFACE COREVIDEO_SUPPORTS_IOSURFACE
#endif
#if TARGET_OS_IPHONE
#define COREVIDEO_USE_IOSURFACEREF COREVIDEO_TRUE
#else
#define COREVIDEO_USE_IOSURFACEREF COREVIDEO_FALSE
#endif
#if COREVIDEO_SUPPORTS_IOSURFACE && (TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)) && (! TARGET_OS_WATCH)
#define COREVIDEO_SUPPORTS_METAL COREVIDEO_TRUE
#else
#define COREVIDEO_SUPPORTS_METAL COREVIDEO_FALSE
#endif
#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum))
#define COREVIDEO_USE_DERIVED_ENUMS_FOR_CONSTANTS COREVIDEO_TRUE
#else
#define COREVIDEO_USE_DERIVED_ENUMS_FOR_CONSTANTS COREVIDEO_FALSE
#endif
#if (TARGET_OS_IPHONE || TARGET_OS_MAC) && defined(__has_feature) && __has_feature(nullability)
#define COREVIDEO_DECLARE_NULLABILITY COREVIDEO_TRUE
#else
#define COREVIDEO_DECLARE_NULLABILITY COREVIDEO_FALSE
#endif
#if (TARGET_OS_IPHONE || TARGET_OS_MAC) && defined(__has_feature) && __has_feature(attribute_cf_returns_on_parameters)
#define CV_RETURNS_RETAINED_PARAMETER CF_RETURNS_RETAINED
#else
#define CV_RETURNS_RETAINED_PARAMETER
#endif
#if (TARGET_OS_IPHONE || TARGET_OS_MAC) && defined(__has_feature) && __has_feature(attribute_cf_consumed)
#define CV_RELEASES_ARGUMENT CF_RELEASES_ARGUMENT
#else
#define CV_RELEASES_ARGUMENT
#endif
#if (TARGET_OS_IPHONE || TARGET_OS_MAC) && defined(__has_feature) && __has_feature(objc_bridge_id)
#define CV_BRIDGED_TYPE(type) CF_BRIDGED_TYPE(type)
#else
#define CV_BRIDGED_TYPE(type)
#endif
#if COREVIDEO_DECLARE_NULLABILITY
#define CV_NULLABLE __nullable
#define CV_NONNULL __nonnull
#else
#define CV_NULLABLE
#define CV_NONNULL
#endif
#define CV_INTERNAL __attribute__((visibility("hidden")))
#define CV_EXPORT __attribute__((visibility("default"))) CF_EXPORT
#define CV_INLINE CF_INLINE
#if COREVIDEO_SUPPORTS_DIRECT3D
#define CVDIRECT3DDEVICE LPDIRECT3DDEVICE9
#define CVDIRECT3DTEXTURE LPDIRECT3DTEXTURE9
#define CVDIRECT3DSURFACE LPDIRECT3DSURFACE9
#define CVDIRECT3D LPDIRECT3D9
#endif //COREVIDEO_SUPPORTS_DIRECT3D
#if defined(COREVIDEO_SILENCE_GL_DEPRECATION) || \
defined(GL_SILENCE_DEPRECATION) || \
defined(GLES_SILENCE_DEPRECATION)
#define COREVIDEO_GL_DEPRECATED(platform, from, to) API_AVAILABLE(platform(from))
#else
#define COREVIDEO_GL_DEPRECATED(platform, from, to) API_DEPRECATED("OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)", platform(from, to))
#endif // COREVIDEO_SILENCE_GL_DEPRECATION
/*!
@typedef CVOptionFlags
@abstract Flags to be used for the display and render call back functions.
@discussion ***Values to be defined***
*/
typedef uint64_t CVOptionFlags;
/*!
@struct CVSMPTETime
@abstract A structure for holding a SMPTE time.
@field subframes
The number of subframes in the full message.
@field subframeDivisor
The number of subframes per frame (typically 80).
@field counter
The total number of messages received.
@field type
The kind of SMPTE time using the SMPTE time type constants.
@field flags
A set of flags that indicate the SMPTE state.
@field hours
The number of hours in the full message.
@field minutes
The number of minutes in the full message.
@field seconds
The number of seconds in the full message.
@field frames
The number of frames in the full message.
*/
struct CVSMPTETime
{
SInt16 subframes;
SInt16 subframeDivisor;
UInt32 counter;
UInt32 type;
UInt32 flags;
SInt16 hours;
SInt16 minutes;
SInt16 seconds;
SInt16 frames;
};
typedef struct CVSMPTETime CVSMPTETime;
/*!
@enum SMPTE Time Types
@abstract Constants that describe the type of SMPTE time.
@constant kCVSMPTETimeType24
24 Frame
@constant kCVSMPTETimeType25
25 Frame
@constant kCVSMPTETimeType30Drop
30 Drop Frame
@constant kCVSMPTETimeType30
30 Frame
@constant kCVSMPTETimeType2997
29.97 Frame
@constant kCVSMPTETimeType2997Drop
29.97 Drop Frame
@constant kCVSMPTETimeType60
60 Frame
@constant kCVSMPTETimeType5994
59.94 Frame
*/
typedef CF_ENUM(uint32_t, CVSMPTETimeType)
{
kCVSMPTETimeType24 = 0,
kCVSMPTETimeType25 = 1,
kCVSMPTETimeType30Drop = 2,
kCVSMPTETimeType30 = 3,
kCVSMPTETimeType2997 = 4,
kCVSMPTETimeType2997Drop = 5,
kCVSMPTETimeType60 = 6,
kCVSMPTETimeType5994 = 7
};
/*!
@enum SMPTE State Flags
@abstract Flags that describe the SMPTE time state.
@constant kCVSMPTETimeValid
The full time is valid.
@constant kCVSMPTETimeRunning
Time is running.
*/
typedef CF_OPTIONS(uint32_t, CVSMPTETimeFlags)
{
kCVSMPTETimeValid = (1L << 0),
kCVSMPTETimeRunning = (1L << 1)
};
typedef CF_OPTIONS(int32_t, CVTimeFlags) {
kCVTimeIsIndefinite = 1 << 0
};
typedef struct
{
int64_t timeValue;
int32_t timeScale;
int32_t flags;
} CVTime;
/*!
@struct CVTimeStamp
@abstract CoreVideo uses a CVTimeStamp structure to store video display time stamps.
@discussion This structure is purposely very similar to AudioTimeStamp defined in the CoreAudio framework.
Most of the CVTimeStamp struct should be fairly self-explanatory. However, it is probably worth pointing out that unlike the audio time stamps, floats are not used to represent the video equivalent of sample times. This was done partly to avoid precision issues, and partly because QuickTime still uses integers for time values and time scales. In the actual implementation it has turned out to be very convenient to use integers, and we can represent framerates like NTSC (30000/1001 fps) exactly. The mHostTime structure field uses the same Mach absolute time base that is used in CoreAudio, so that clients of the CoreVideo API can synchronize between the two subsystems.
@field version The current CVTimeStamp is version 0.
@field videoTimeScale The scale (in units per second) of the videoTime and videoPeriod values
@field videoTime This represents the start of a frame (or field for interlaced)
@field hostTime Host root timebase time
@field rateScalar This is the current rate of the device as measured by the timestamps, divided by the nominal rate
@field videoRefreshPeriod This is the nominal update period of the current output device
@field smpteTime SMPTE time representation of the time stamp.
@field flags Possible values are:
kCVTimeStampVideoTimeValid
kCVTimeStampHostTimeValid
kCVTimeStampSMPTETimeValid
kCVTimeStampVideoPeriodValid
kCVTimeStampRateScalarValid
There are flags for each field to make it easier to detect interlaced vs progressive output
kCVTimeStampTopField
kCVTimeStampBottomField
Some commonly used combinations of timestamp flags
kCVTimeStampVideoHostTimeValid
kCVTimeStampIsInterlaced
@field reserved Reserved. Do not use.
*/
typedef struct
{
uint32_t version;
int32_t videoTimeScale;
int64_t videoTime;
uint64_t hostTime;
double rateScalar;
int64_t videoRefreshPeriod;
CVSMPTETime smpteTime;
uint64_t flags;
uint64_t reserved;
} CVTimeStamp;
// Flags for the CVTimeStamp structure
typedef CF_OPTIONS(uint64_t, CVTimeStampFlags)
{
kCVTimeStampVideoTimeValid = (1L << 0),
kCVTimeStampHostTimeValid = (1L << 1),
kCVTimeStampSMPTETimeValid = (1L << 2),
kCVTimeStampVideoRefreshPeriodValid = (1L << 3),
kCVTimeStampRateScalarValid = (1L << 4),
// There are flags for each field to make it easier to detect interlaced vs progressive output
kCVTimeStampTopField = (1L << 16),
kCVTimeStampBottomField = (1L << 17),
// Some commonly used combinations of timestamp flags
kCVTimeStampVideoHostTimeValid = (kCVTimeStampVideoTimeValid | kCVTimeStampHostTimeValid),
kCVTimeStampIsInterlaced = (kCVTimeStampTopField | kCVTimeStampBottomField)
};
CV_EXPORT const CVTime kCVZeroTime;
CV_EXPORT const CVTime kCVIndefiniteTime;
#if defined(__cplusplus)
}
#endif
#endif
// ========== CoreVideo.framework/Headers/CVImageBuffer.h
/*
* CVImageBuffer.h
* CoreVideo
*
* Copyright (c) 2004-2015 Apple Inc. All rights reserved.
*
*/
/*! @header CVImageBuffer.h
@copyright 2004-2015 Apple Inc. All rights reserved.
@availability Mac OS X 10.4 or later, and iOS 4.0 or later
@discussion CVImageBufferRef types are abstract and define various attachments and convenience
calls for retreiving image related bits of data.
*/
#if !defined(__COREVIDEO_CVIMAGEBUFFER_H__)
#define __COREVIDEO_CVIMAGEBUFFER_H__ 1
#include <TargetConditionals.h>
#include <Availability.h>
#include <AvailabilityMacros.h>
// For legacy reasons CVImageBuffer.h includes CoreGraphics.h and ApplicationServices.h
#if TARGET_OS_IPHONE || 0
#include <CoreGraphics/CoreGraphics.h>
#else
#include <ApplicationServices/ApplicationServices.h>
#endif
#include <CoreGraphics/CGColorSpace.h>
#include <CoreGraphics/CGGeometry.h>
#include <CoreVideo/CVBuffer.h>
#if defined(__cplusplus)
extern "C" {
#endif
#pragma mark CVImageBufferRef attachment keys
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferCGColorSpaceKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CGColorSpaceRef
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferCleanApertureKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFDictionary containing the following four keys
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferCleanApertureWidthKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferCleanApertureHeightKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferCleanApertureHorizontalOffsetKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber, horizontal offset from center of image buffer
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferCleanApertureVerticalOffsetKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber, vertical offset from center of image buffer
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferPreferredCleanApertureKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFDictionary containing same keys as kCVImageBufferCleanApertureKey
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferFieldCountKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferFieldDetailKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString with one of the following four values
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferFieldDetailTemporalTopFirst __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferFieldDetailTemporalBottomFirst __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferFieldDetailSpatialFirstLineEarly __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferFieldDetailSpatialFirstLineLate __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferPixelAspectRatioKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFDictionary with the following two keys
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferPixelAspectRatioHorizontalSpacingKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferPixelAspectRatioVerticalSpacingKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferDisplayDimensionsKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFDictionary with the following two keys
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferDisplayWidthKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferDisplayHeightKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferGammaLevelKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFNumber describing the gamma level, used in absence of (or ignorance of) kCVImageBufferTransferFunctionKey
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferICCProfileKey __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0); // CFData representation of the ICC profile
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferYCbCrMatrixKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString describing the color matrix for YCbCr->RGB. This key can be one of the following values:
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferYCbCrMatrix_ITU_R_709_2 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferYCbCrMatrix_ITU_R_601_4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferYCbCrMatrix_SMPTE_240M_1995 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferYCbCrMatrix_DCI_P3 __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferYCbCrMatrix_P3_D65 __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferYCbCrMatrix_ITU_R_2020 __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0); // CFString
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferColorPrimariesKey __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // CFString describing the color primaries. This key can be one of the following values
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferColorPrimaries_ITU_R_709_2 __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferColorPrimaries_EBU_3213 __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferColorPrimaries_SMPTE_C __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferColorPrimaries_P22 __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_6_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferColorPrimaries_DCI_P3 __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferColorPrimaries_P3_D65 __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferColorPrimaries_ITU_R_2020 __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunctionKey __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // CFString describing the transfer function. This key can be one of the following values
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_ITU_R_709_2 __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_SMPTE_240M_1995 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_UseGamma __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_EBU_3213 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA); // Should not be used.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_SMPTE_C __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5,__MAC_10_6,__IPHONE_NA,__IPHONE_NA); // Should not be used.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_sRGB __OSX_AVAILABLE_STARTING(__MAC_10_13,__IPHONE_11_0); // IEC 61966-2-1 sRGB or sYCC
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_ITU_R_2020 __OSX_AVAILABLE_STARTING(__MAC_10_11,__IPHONE_9_0); // note: kCVImageBufferTransferFunction_ITU_R_709_2 is equivalent, and preferred
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_SMPTE_ST_428_1 __OSX_AVAILABLE_STARTING(__MAC_10_12,__IPHONE_10_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ __OSX_AVAILABLE_STARTING(__MAC_10_13,__IPHONE_11_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_ITU_R_2100_HLG __OSX_AVAILABLE_STARTING(__MAC_10_13,__IPHONE_11_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferTransferFunction_Linear __OSX_AVAILABLE_STARTING(__MAC_10_14,__IPHONE_12_0);
/* Chroma siting information. For progressive images, only the TopField value is used. */
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocationTopFieldKey __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // CFString with one of the following CFString values
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocationBottomFieldKey __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // CFString with one of the following CFString values
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocation_Left __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // Chroma sample is horizontally co-sited with the left column of luma samples, but centered vertically.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocation_Center __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // Chroma sample is fully centered
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocation_TopLeft __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // Chroma sample is co-sited with the top-left luma sample.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocation_Top __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // Chroma sample is horizontally centered, but co-sited with the top row of luma samples.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocation_BottomLeft __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // Chroma sample is co-sited with the bottom-left luma sample.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocation_Bottom __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // Chroma sample is horizontally centered, but co-sited with the bottom row of luma samples.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaLocation_DV420 __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // Cr and Cb samples are alternately co-sited with the left luma samples of the same field.
// These describe the format of the original subsampled data before conversion to 422/2vuy. In order to use
// these tags, the data must have been converted to 4:2:2 via simple pixel replication.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaSubsamplingKey __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0); // CFString/CFNumber with one of the following values
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaSubsampling_420 __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaSubsampling_422 __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferChromaSubsampling_411 __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_4_0);
// Can be set to kCFBooleanTrue as a hint that the alpha channel is fully opaque. Not used if the pixel format type has no alpha channel.
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferAlphaChannelIsOpaque __OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferAlphaChannelModeKey API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0)) API_UNAVAILABLE(watchos);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferAlphaChannelMode_StraightAlpha API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0)) API_UNAVAILABLE(watchos);
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferAlphaChannelMode_PremultipliedAlpha API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0)) API_UNAVAILABLE(watchos);
// Returns the standard integer code point corresponding to a given CoreVideo YCbCrMatrix constant string (in the kCVImageBufferYCbCrMatrix_... family). Returns 2 (the code point for "unknown") if the string is NULL or not recognized.
CV_EXPORT int CVYCbCrMatrixGetIntegerCodePointForString( CV_NULLABLE CFStringRef yCbCrMatrixString ) API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
// Returns the standard integer code point corresponding to a given CoreVideo ColorPrimaries constant string (in the kCVImageBufferColorPrimaries_... family). Returns 2 (the code point for "unknown") if the string is NULL or not recognized.
CV_EXPORT int CVColorPrimariesGetIntegerCodePointForString( CV_NULLABLE CFStringRef colorPrimariesString ) API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
// Returns the standard integer code point corresponding to a given CoreVideo TransferFunction constant string (in the kCVImageBufferTransferFunction_... family). Returns 2 (the code point for "unknown") if the string is NULL or not recognized.
CV_EXPORT int CVTransferFunctionGetIntegerCodePointForString( CV_NULLABLE CFStringRef transferFunctionString ) API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
// Returns the CoreVideo YCbCrMatrix constant string (in the kCVImageBufferYCbCrMatrix_... family) corresponding to a given standard integer code point. Returns NULL if the code point is not recognized, or if it is 2 (the code point for "unknown").
CV_EXPORT CV_NULLABLE CFStringRef CVYCbCrMatrixGetStringForIntegerCodePoint( int yCbCrMatrixCodePoint ) API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
// Returns the CoreVideo ColorPrimaries constant string (in the kCVImageBufferColorPrimaries_... family) corresponding to a given standard integer code point. Returns NULL if the code point is not recognized, or if it is 2 (the code point for "unknown").
CV_EXPORT CV_NULLABLE CFStringRef CVColorPrimariesGetStringForIntegerCodePoint( int colorPrimariesCodePoint ) API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
// Returns the CoreVideo TransferFunction constant string (in the kCVImageBufferTransferFunction_... family) corresponding to a given standard integer code point. Returns NULL if the code point is not recognized, or if it is 2 (the code point for "unknown").
CV_EXPORT CV_NULLABLE CFStringRef CVTransferFunctionGetStringForIntegerCodePoint( int transferFunctionCodePoint ) API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
#pragma mark CVImageBufferRef
/*!
@typedef CVImageBufferRef
@abstract Base type for all CoreVideo image buffers
*/
typedef CVBufferRef CVImageBufferRef;
/*!
@function CVImageBufferGetEncodedSize
@abstract Returns the full encoded dimensions of a CVImageBuffer. For example, for an NTSC DV frame this would be 720x480
@param imageBuffer A CVImageBuffer that you wish to retrieve the encoded size from.
@result A CGSize returning the full encoded size of the buffer
Returns zero size if called with a non-CVImageBufferRef type or NULL.
*/
CV_EXPORT CGSize CVImageBufferGetEncodedSize( CVImageBufferRef CV_NONNULL imageBuffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVImageBufferGetDisplaySize
@abstract Returns the nominal output display size (in square pixels) of a CVImageBuffer.
For example, for an NTSC DV frame this would be 640x480
@param imageBuffer A CVImageBuffer that you wish to retrieve the display size from.
@result A CGSize returning the nominal display size of the buffer
Returns zero size if called with a non-CVImageBufferRef type or NULL.
*/
CV_EXPORT CGSize CVImageBufferGetDisplaySize( CVImageBufferRef CV_NONNULL imageBuffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVImageBufferGetCleanRect
@abstract Returns the source rectangle of a CVImageBuffer that represents the clean aperture
of the buffer in encoded pixels. For example, an NTSC DV frame would return a CGRect with an
origin of 8,0 and a size of 704,480.
Note that the origin of this rect always the lower left corner. This is the same coordinate system as
used by CoreImage.
@param imageBuffer A CVImageBuffer that you wish to retrieve the display size from.
@result A CGSize returning the nominal display size of the buffer
Returns zero rect if called with a non-CVImageBufferRef type or NULL.
*/
CV_EXPORT CGRect CVImageBufferGetCleanRect( CVImageBufferRef CV_NONNULL imageBuffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVImageBufferIsFlipped
@abstract Returns whether the image is flipped vertically or not.
@param CVImageBuffer target
@result True if 0,0 in the texture is upper left, false if 0,0 is lower left.
*/
CV_EXPORT Boolean CVImageBufferIsFlipped( CVImageBufferRef CV_NONNULL imageBuffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
#if COREVIDEO_SUPPORTS_COLORSPACE
/*!
@function CVImageBufferGetColorSpace
@abstract Returns the color space of a CVImageBuffer.
@param imageBuffer A CVImageBuffer that you wish to retrieve the color space from.
@result A CGColorSpaceRef representing the color space of the buffer.
Returns NULL if called with a non-CVImageBufferRef type or NULL.
*/
CV_EXPORT CGColorSpaceRef CV_NULLABLE CVImageBufferGetColorSpace( CVImageBufferRef CV_NONNULL imageBuffer ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
#endif
/*!
@function CVImageBufferCreateColorSpaceFromAttachments
@abstract Attempts to synthesize a CGColorSpace from an image buffer's attachments.
@param attachments A CFDictionary of attachments for an image buffer, obtained using CVBufferGetAttachments().
@result A CGColorSpaceRef representing the color space of the buffer.
Returns NULL if the attachments dictionary does not contain the information required to synthesize a CGColorSpace.
@discussion
To generate a CGColorSpace, the attachments dictionary should include values for either:
1. kCVImageBufferICCProfile
2. kCVImageBufferColorPrimariesKey, kCVImageBufferTransferFunctionKey, and kCVImageBufferYCbCrMatrixKey (and possibly kCVImageBufferGammaLevelKey)
The client is responsible for releasing the CGColorSpaceRef when it is done with it (CGColorSpaceRelease() or CFRelease())
*/
CV_EXPORT CGColorSpaceRef CV_NULLABLE CVImageBufferCreateColorSpaceFromAttachments( CFDictionaryRef CV_NONNULL attachments ) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_10_0);
// CFData (24 bytes) containing big-endian data matching payload of ISO/IEC 23008-2:2015(E), D.2.28 Mastering display colour volume SEI message
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferMasteringDisplayColorVolumeKey __OSX_AVAILABLE_STARTING(__MAC_10_13,__IPHONE_11_0);
// CFData (4 bytes) containing big-endian data matching payload of Content Light Level Information SEI message
CV_EXPORT const CFStringRef CV_NONNULL kCVImageBufferContentLightLevelInfoKey __OSX_AVAILABLE_STARTING(__MAC_10_13,__IPHONE_11_0);
#if defined(__cplusplus)
}
#endif
#endif
// ========== CoreVideo.framework/Headers/CVPixelBufferPool.h
/*
* CVPixelBufferPool.h
* CoreVideo
*
* Copyright 2004-2015 Apple Inc. All rights reserved.
*
*/
/*! @header CVPixelBufferPool.h
@copyright 2004-2015 Apple Inc. All rights reserved.
@availability Mac OS X 10.4 or later, and iOS 4.0 or later
@discussion CVPixelBufferPool is a utility object for managing a set of CVPixelBuffer objects that are going to be recycled.
*/
#if !defined(__COREVIDEO__CVPIXELBUFFERPOOL_H__)
#define __COREVIDEO__CVPIXELBUFFERPOOL_H__ 1
#include <TargetConditionals.h>
#include <Availability.h>
#include <AvailabilityMacros.h>
#include <CoreVideo/CVBase.h>
#include <CoreVideo/CVReturn.h>
#include <CoreVideo/CVPixelBuffer.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct CV_BRIDGED_TYPE(id) __CVPixelBufferPool *CVPixelBufferPoolRef;
// By default, buffers will age out after one second. If required, setting an age of zero will disable
// the age-out mechanism completely.
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferPoolMinimumBufferCountKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferPoolMaximumBufferAgeKey __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
CV_EXPORT CFTypeID CVPixelBufferPoolGetTypeID(void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVPixelBufferPoolRetain
@abstract Retains a CVPixelBufferPoolRef object
@discussion Equivalent to CFRetain, but NULL safe
@param buffer A CVPixelBufferPoolRef object that you want to retain.
@result A CVPixelBufferPoolRef object that is the same as the passed in buffer.
*/
CV_EXPORT CVPixelBufferPoolRef CV_NULLABLE CVPixelBufferPoolRetain( CVPixelBufferPoolRef CV_NULLABLE pixelBufferPool ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // NULL-safe
/*!
@function CVPixelBufferPoolRelease
@abstract Releases a CVPixelBufferPoolRef object
@discussion Equivalent to CFRelease, but NULL safe
@param buffer A CVPixelBufferPoolRef object that you want to release.
*/
CV_EXPORT void CVPixelBufferPoolRelease( CV_RELEASES_ARGUMENT CVPixelBufferPoolRef CV_NULLABLE pixelBufferPool ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0); // NULL-safe
/*!
@function CVPixelBufferPoolCreate
@abstract Creates a new Pixel Buffer pool.
@param allocator The CFAllocatorRef to use for allocating this buffer pool. May be NULL.
@param attributes A CFDictionaryRef containing the attributes to be used for creating new PixelBuffers within the pool.
@param poolOut The newly created pool will be placed here
@result Returns kCVReturnSuccess on success
*/
CV_EXPORT CVReturn CVPixelBufferPoolCreate(
CFAllocatorRef CV_NULLABLE allocator,
CFDictionaryRef CV_NULLABLE poolAttributes,
CFDictionaryRef CV_NULLABLE pixelBufferAttributes,
CV_RETURNS_RETAINED_PARAMETER CVPixelBufferPoolRef CV_NULLABLE * CV_NONNULL poolOut ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVPixelBufferPoolGetAttributes
@abstract Returns the pool attributes dictionary for a CVPixelBufferPool
@param pool The CVPixelBufferPoolRef to retrieve the attributes from
@result Returns the pool attributes dictionary, or NULL on failure.
*/
CV_EXPORT CFDictionaryRef CF_RETURNS_NOT_RETAINED CV_NULLABLE CVPixelBufferPoolGetAttributes( CVPixelBufferPoolRef CV_NONNULL pool ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVPixelBufferPoolGetPixelBufferAttributes
@abstract Returns the attributes of pixel buffers that will be created from this pool.
@discussion This function is provided for those cases where you may need to know some information about the buffers that
will be created up front.
@param pool The CVPixelBufferPoolRef to retrieve the attributes from
@result Returns the pixel buffer attributes dictionary, or NULL on failure.
*/
CV_EXPORT CFDictionaryRef CF_RETURNS_NOT_RETAINED CV_NULLABLE CVPixelBufferPoolGetPixelBufferAttributes( CVPixelBufferPoolRef CV_NONNULL pool ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*!
@function CVPixelBufferPoolCreatePixelBuffer
@abstract Creates a new PixelBuffer object from the pool.
@discussion The function creates a new (attachment-free) CVPixelBuffer using the pixel buffer attributes specifed during pool creation.
@param allocator The CFAllocatorRef to use for creating the pixel buffer. May be NULL.
@param pool The CVPixelBufferPool that should create the new CVPixelBuffer.
@param pixelBufferOut The newly created pixel buffer will be placed here
@result Returns kCVReturnSuccess on success
*/
CV_EXPORT CVReturn CVPixelBufferPoolCreatePixelBuffer(
CFAllocatorRef CV_NULLABLE allocator,
CVPixelBufferPoolRef CV_NONNULL pixelBufferPool,
CV_RETURNS_RETAINED_PARAMETER CVPixelBufferRef CV_NULLABLE * CV_NONNULL pixelBufferOut ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
/*
@function CVPixelBufferPoolCreatePixelBufferWithAuxAttributes
@abstract Creates a new PixelBuffer object from the pool.
@discussion This function creates a new CVPixelBuffer using the pixel buffer attributes specified during pool creation and the attributes specified in the auxAttributes parameter.
@param allocator The CFAllocatorRef to use for creating the pixel buffer. May be NULL.
@param pixelBufferPool The CVPixelBufferPool that should create the new CVPixelBuffer.
@param auxAttributes Attributes describing this specific allocation request. May be NULL.
@param pixelBufferOut The newly created pixel buffer will be placed here
@result Returns kCVReturnSuccess on success
*/
CV_EXPORT CVReturn CVPixelBufferPoolCreatePixelBufferWithAuxAttributes(
CFAllocatorRef CV_NULLABLE allocator,
CVPixelBufferPoolRef CV_NONNULL pixelBufferPool,
CFDictionaryRef CV_NULLABLE auxAttributes,
CV_RETURNS_RETAINED_PARAMETER CVPixelBufferRef CV_NULLABLE * CV_NONNULL pixelBufferOut ) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
// Key for the auxiliary attributes dictionary passed to CVPixelBufferPoolCreatePixelBufferWithAuxAttributes().
// When set, indicates that a new pixel buffer should not be allocated if
// the pool already has this many or more pixel buffers allocated.
// This does not prevent already-allocated buffers from being recycled.
// If this key causes CVPixelBufferPoolCreatePixelBufferWithAuxAttributes to fail,
// it will return kCVReturnWouldExceedAllocationThreshold.
CV_EXPORT const CFStringRef CV_NONNULL kCVPixelBufferPoolAllocationThresholdKey __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); // CFNumberRef -- for use only in auxAttributes