AVFoundation.pas 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. {$mode delphi}
  2. {$modeswitch objectivec1}
  3. {$modeswitch cvar}
  4. {$macro on}
  5. {$define instancetype := id}
  6. {$ifndef LOADED_AVAILABILITY_MACROS}
  7. {$define LOADED_AVAILABILITY_MACROS}
  8. // System Versions MacOSX SDK
  9. {$define MAC_OS_X_VERSION_10_0 := 1000}
  10. {$define MAC_OS_X_VERSION_10_1 := 1010}
  11. {$define MAC_OS_X_VERSION_10_2 := 1020}
  12. {$define MAC_OS_X_VERSION_10_3 := 1030}
  13. {$define MAC_OS_X_VERSION_10_4 := 1040}
  14. {$define MAC_OS_X_VERSION_10_5 := 1050}
  15. {$define MAC_OS_X_VERSION_10_6 := 1060}
  16. {$define MAC_OS_X_VERSION_10_7 := 1070}
  17. {$define MAC_OS_X_VERSION_10_8 := 1080}
  18. {$define MAC_OS_X_VERSION_10_9 := 1090}
  19. {$define MAC_OS_X_VERSION_10_10 := 101000}
  20. {$define MAC_OS_X_VERSION_LATEST := MAC_OS_X_VERSION_10_10}
  21. // System Versions iPhoneOS SDK
  22. {$define __MAC_10_0 := 1000}
  23. {$define __MAC_10_1 := 1010}
  24. {$define __MAC_10_2 := 1020}
  25. {$define __MAC_10_3 := 1030}
  26. {$define __MAC_10_4 := 1040}
  27. {$define __MAC_10_5 := 1050}
  28. {$define __MAC_10_6 := 1060}
  29. {$define __MAC_10_7 := 1070}
  30. {$define __MAC_10_8 := 1080}
  31. {$define __MAC_10_9 := 1090}
  32. {$define __MAC_10_10 := 1100}
  33. {$define __MAC_NA := 9999}
  34. {$define __IPHONE_2_0 := 20000}
  35. {$define __IPHONE_2_1 := 20100}
  36. {$define __IPHONE_2_2 := 20200}
  37. {$define __IPHONE_3_0 := 30000}
  38. {$define __IPHONE_3_1 := 30100}
  39. {$define __IPHONE_3_2 := 30200}
  40. {$define __IPHONE_4_0 := 40000}
  41. {$define __IPHONE_4_1 := 40100}
  42. {$define __IPHONE_4_2 := 40200}
  43. {$define __IPHONE_4_3 := 40300}
  44. {$define __IPHONE_5_0 := 50000}
  45. {$define __IPHONE_6_0 := 60000}
  46. {$define __IPHONE_7_0 := 70000}
  47. {$define __IPHONE_8_0 := 80000}
  48. {$define __IPHONE_NA := 99999}
  49. {$define __IPHONE_LATEST := __IPHONE_8_0}
  50. // Target Conditionals
  51. {$if defined(CPUPOWERPC32)}
  52. {$define TARGET_CPU_PPC}
  53. {$undef TARGET_CPU_PPC64}
  54. {$undef TARGET_CPU_X86}
  55. {$undef TARGET_CPU_X86_64}
  56. {$undef TARGET_CPU_ARM}
  57. {$define TARGET_OS_MAC}
  58. {$undef TARGET_OS_IPHONE}
  59. {$undef TARGET_IPHONE_SIMULATOR}
  60. {$undef TARGET_RT_64_BIT}
  61. {$elseif defined(CPUPOWERPC64)}
  62. {$undef TARGET_CPU_PPC}
  63. {$define TARGET_CPU_PPC64}
  64. {$undef TARGET_CPU_X86}
  65. {$undef TARGET_CPU_X86_64}
  66. {$undef TARGET_CPU_ARM}
  67. {$define TARGET_OS_MAC}
  68. {$undef TARGET_OS_IPHONE}
  69. {$undef TARGET_IPHONE_SIMULATOR}
  70. {$define TARGET_RT_64_BIT}
  71. {$elseif defined(CPUI386)}
  72. {$undef TARGET_CPU_PPC}
  73. {$undef TARGET_CPU_PPC64}
  74. {$define TARGET_CPU_X86}
  75. {$undef TARGET_CPU_X86_64}
  76. {$undef TARGET_CPU_ARM}
  77. {$undef TARGET_RT_64_BIT}
  78. {$if defined(IPHONESIM)}
  79. {$undef TARGET_OS_MAC}
  80. {$define TARGET_OS_IPHONE}
  81. {$define TARGET_IPHONE_SIMULATOR}
  82. {$else}
  83. {$define TARGET_OS_MAC}
  84. {$undef TARGET_OS_IPHONE}
  85. {$undef TARGET_IPHONE_SIMULATOR}
  86. {$endif}
  87. {$elseif defined(CPUX86_64)}
  88. {$undef TARGET_CPU_PPC}
  89. {$undef TARGET_CPU_PPC64}
  90. {$undef TARGET_CPU_X86}
  91. {$define TARGET_CPU_X86_64}
  92. {$undef TARGET_CPU_ARM}
  93. {$define TARGET_OS_MAC}
  94. {$undef TARGET_OS_IPHONE}
  95. {$undef TARGET_IPHONE_SIMULATOR}
  96. {$define TARGET_RT_64_BIT}
  97. {$elseif defined(CPUARM)}
  98. {$undef TARGET_CPU_PPC}
  99. {$undef TARGET_CPU_PPC64}
  100. {$undef TARGET_CPU_X86}
  101. {$undef TARGET_CPU_X86_64}
  102. {$define TARGET_CPU_ARM}
  103. {$undef TARGET_OS_MAC}
  104. {$define TARGET_OS_IPHONE}
  105. {$undef TARGET_IPHONE_SIMULATOR}
  106. {$undef TARGET_RT_64_BIT}
  107. {$endif}
  108. {$ifdef CPU64}
  109. {$define TARGET_CPU_64}
  110. {$define TARGET_RT_64_BIT}
  111. {$else}
  112. {$undef TARGET_CPU_64}
  113. {$undef TARGET_RT_64_BIT}
  114. {$endif}
  115. {$if defined(FPC_BIG_ENDIAN)}
  116. {$define TARGET_RT_BIG_ENDIAN}
  117. {$undef TARGET_RT_LITTLE_ENDIAN}
  118. {$elseif defined(FPC_LITTLE_ENDIAN)}
  119. {$define TARGET_RT_LITTLE_ENDIAN}
  120. {$undef TARGET_RT_BIG_ENDIAN}
  121. {$endif}
  122. {$undef DEPLOYMENT_TARGET_EMBEDDED}
  123. {$undef DEPLOYMENT_TARGET_WINDOWS}
  124. {$define TARGET_API_MAC_CARBON}
  125. {$undef TARGET_API_MAC_OS8}
  126. {$define TARGET_API_MAC_OSX}
  127. {$define TARGET_CARBON}
  128. {$undef TARGET_CPU_68K}
  129. {$undef TARGET_CPU_MIPS}
  130. {$undef TARGET_CPU_SPARC}
  131. {$undef TARGET_CPU_ALPHA}
  132. {$undef TARGET_OS_UNIX}
  133. {$undef TARGET_OS_WIN32}
  134. {$undef TARGET_OS_EMBEDDED}
  135. {$undef TARGET_RT_MAC_68881}
  136. {$undef TARGET_RT_MAC_CFM}
  137. {$define TARGET_RT_MAC_MACHO}
  138. {$undef __OBJC2__}
  139. {$undef __BLOCKS__}
  140. {$undef NS_BLOCKS_AVAILABLE}
  141. {$undef NS_BUILD_32_LIKE_64}
  142. {$undef NS_NONATOMIC_IOSONLY}
  143. {$define ACCESSOR_CALLS_ARE_FUNCTIONS}
  144. {$undef CALL_NOT_IN_CARBON}
  145. {$undef OLDROUTINENAMES}
  146. {$define OPAQUE_TOOLBOX_STRUCTS}
  147. {$define OPAQUE_UPP_TYPES}
  148. {$define OTCARBONAPPLICATION}
  149. {$undef OTKERNEL}
  150. {$define PM_USE_SESSION_APIS}
  151. {$define TYPED_FUNCTION_POINTERS}
  152. {$undef TYPE_BOOL}
  153. {$undef TYPE_EXTENDED}
  154. {$define TYPE_LONGLONG}
  155. {$ifdef CPU64}
  156. {$define __LP64__}
  157. {$else}
  158. {$undef __LP64__}
  159. {$endif}
  160. // Mac OS X Version Requirements
  161. {$if defined(TARGET_CPU_PPC64) or defined(TARGET_CPU_X86) or defined(TARGET_CPU_X86_64)}
  162. {$define MAC_OS_X_VERSION_MIN_REQUIRED := MAC_OS_X_VERSION_10_4}
  163. {$elseif defined(TARGET_CPU_ARM)}
  164. {$define MAC_OS_X_VERSION_MIN_REQUIRED := MAC_OS_X_VERSION_10_5}
  165. {$else}
  166. {$define MAC_OS_X_VERSION_MIN_REQUIRED := MAC_OS_X_VERSION_10_1}
  167. {$endif}
  168. {$define MAC_OS_X_VERSION_MAX_ALLOWED := MAC_OS_X_VERSION_LATEST}
  169. // iOS Version Requirements
  170. {$define __IPHONE_OS_VERSION_MAX_ALLOWED := __IPHONE_LATEST}
  171. {$define __IPHONE_OS_VERSION_MIN_REQUIRED := __IPHONE_2_0}
  172. // Mac OS X compiled for iOS
  173. {$define __MAC_OS_X_VERSION_MIN_REQUIRED := MAC_OS_X_VERSION_MIN_REQUIRED}
  174. {$define __MAC_OS_X_VERSION_MAX_ALLOWED := MAC_OS_X_VERSION_LATEST}
  175. {$endif}
  176. unit AVFoundation;
  177. interface
  178. {$linkframework AVFoundation}
  179. uses
  180. {$ifdef COCOAALL}
  181. {$ifdef MACOSALL}
  182. DefinedClassesAVFoundation, CoreVideo, CoreMedia, CoreAudio, CocoaAll, CTypes, MacOSAll;
  183. {$else}
  184. DefinedClassesAVFoundation, CoreVideo, CoreMedia, CoreAudio, CTypes, MacTypes, MacOSXPosix, CocoaAll, AEDataModel, IconsCore, IOSurfaceAPI, SecBase, SecTrust, MacGL, CGLTypes, CFBase, CFArray, CFBag, CFCharacterSet, CFData, CFDate, CFDictionary, CFNumber, CFPropertyList, CFSet, CFString, CFStringEncodingExt, CFTimeZone, CFTree, CFURL, CFXMLNode, CFXMLParser, CFMachPort, CFMessagePort, CFRunLoop, CFSocket, CFBinaryHeap, CFBitVector, CFBundle, CFByteOrders, CFPlugIn, CFPreferences, CFURLAccess, CFUUID, CFLocale, CFStream, CFDateFormatter, CFNumberFormatter, CFCalendar, CFUserNotification, CFNotificationCenter, CFAttributedString, CFNetworkErrorss, CGBase, CGAffineTransforms, CGBitmapContext, CGColor, CGColorSpace, CGContext, CGDataConsumer, CGDataProvider, CGDirectDisplay, CGDirectPalette, CGDisplayConfiguration, CGDisplayFades, CGErrors, CGEvent, CGEventSource, CGEventTypes, CGFont, CGFunction, CGGLContext, CGGeometry, CGImage, CGLayer, CGPDFArray, CGPDFContentStream, CGPDFContext, CGPDFDictionary, CGPDFDocument, CGPDFObject, CGPDFOperatorTable, CGPDFPage, CGPDFScanner, CGPDFStream, CGPDFString, CGPSConverter, CGPath, CGPattern, CGRemoteOperation, CGSession, CGShading, CGWindowLevels, CVBase, CVImageBuffer, AudioComponents, AUComponent;
  185. {$endif}
  186. {$else}
  187. {$ifdef MACOSALL}
  188. DefinedClassesAVFoundation, QuartzCore, CoreVideo, CoreMedia, CoreAudio, Foundation, CTypes, MacOSAll;
  189. {$else}
  190. DefinedClassesAVFoundation, QuartzCore, CoreVideo, CoreMedia, CoreAudio, Foundation, CTypes, MacTypes, MacOSXPosix, AEDataModel, IconsCore, IOSurfaceAPI, SecBase, SecTrust, MacGL, CGLTypes, CFBase, CFArray, CFBag, CFCharacterSet, CFData, CFDate, CFDictionary, CFNumber, CFPropertyList, CFSet, CFString, CFStringEncodingExt, CFTimeZone, CFTree, CFURL, CFXMLNode, CFXMLParser, CFMachPort, CFMessagePort, CFRunLoop, CFSocket, CFBinaryHeap, CFBitVector, CFBundle, CFByteOrders, CFPlugIn, CFPreferences, CFURLAccess, CFUUID, CFLocale, CFStream, CFDateFormatter, CFNumberFormatter, CFCalendar, CFUserNotification, CFNotificationCenter, CFAttributedString, CFNetworkErrorss, CGBase, CGAffineTransforms, CGBitmapContext, CGColor, CGColorSpace, CGContext, CGDataConsumer, CGDataProvider, CGDirectDisplay, CGDirectPalette, CGDisplayConfiguration, CGDisplayFades, CGErrors, CGEvent, CGEventSource, CGEventTypes, CGFont, CGFunction, CGGLContext, CGGeometry, CGImage, CGLayer, CGPDFArray, CGPDFContentStream, CGPDFContext, CGPDFDictionary, CGPDFDocument, CGPDFObject, CGPDFOperatorTable, CGPDFPage, CGPDFScanner, CGPDFStream, CGPDFString, CGPSConverter, CGPath, CGPattern, CGRemoteOperation, CGSession, CGShading, CGWindowLevels, CVBase, CVImageBuffer, AudioComponents, AUComponent;
  191. {$endif}
  192. {$endif}
  193. {$define INTERFACE}
  194. {$define CGFLOAT_DEFINED}
  195. {$define NSINTEGER_DEFINED}
  196. type
  197. OpaqueRecord = record end;
  198. OpaqueCBlock = pointer;
  199. OpaqueType = ^SInt32;
  200. objc_protocol = protocol;
  201. idPtr = ^id;
  202. SELPtr = ^SEL;
  203. va_list_rec = OpaqueRecord;
  204. va_list = ^va_list_rec;
  205. {$include UndefinedTypes.inc}
  206. {$include avfoundation/UndefinedTypes.inc}
  207. {$define TYPES}
  208. {$include avfoundation/Sources.inc}
  209. {$undef TYPES}
  210. {$define RECORDS}
  211. {$include avfoundation/Sources.inc}
  212. {$undef RECORDS}
  213. {$define PROTOCOLS}
  214. {$include avfoundation/Sources.inc}
  215. {$undef PROTOCOLS}
  216. {$define CLASSES}
  217. {$include avfoundation/Sources.inc}
  218. {$undef CLASSES}
  219. {$define FUNCTIONS}
  220. {$include avfoundation/Sources.inc}
  221. {$undef FUNCTIONS}
  222. {$define EXTERNAL_SYMBOLS}
  223. {$include avfoundation/Sources.inc}
  224. {$undef EXTERNAL_SYMBOLS}
  225. {$include avfoundation/InlineFunctions.inc}
  226. {$undef INTERFACE}
  227. implementation
  228. {$define IMPLEMENTATION}
  229. {$include avfoundation/InlineFunctions.inc}
  230. {$undef IMPLEMENTATION}
  231. end.