CVDisplayLink.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. {
  2. * CVDisplayLink.h
  3. * CoreVideo
  4. *
  5. * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
  6. *
  7. }
  8. { Pascal Translation: Gale R Paeper, <[email protected]>, 2008 }
  9. { Pascal Translation Update: Gorazd Krosl, <[email protected]>, 2009 }
  10. { Pascal Translation Update: Jonas Maebe <[email protected]>, October 2012 }
  11. { Pascal Translation Update: Jonas Maebe <[email protected]>, August 2015 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$modeswitch cblocks}
  20. {$packenum 1}
  21. {$macro on}
  22. {$inline on}
  23. {$calling mwpascal}
  24. {$IFNDEF FPC_DOTTEDUNITS}
  25. unit CVDisplayLink;
  26. {$ENDIF FPC_DOTTEDUNITS}
  27. interface
  28. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  29. {$setc GAP_INTERFACES_VERSION := $0308}
  30. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  31. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  32. {$endc}
  33. {$ifc defined CPUPOWERPC and defined CPUI386}
  34. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  35. {$endc}
  36. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  37. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  38. {$endc}
  39. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  40. {$setc __ppc__ := 1}
  41. {$elsec}
  42. {$setc __ppc__ := 0}
  43. {$endc}
  44. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  45. {$setc __ppc64__ := 1}
  46. {$elsec}
  47. {$setc __ppc64__ := 0}
  48. {$endc}
  49. {$ifc not defined __i386__ and defined CPUI386}
  50. {$setc __i386__ := 1}
  51. {$elsec}
  52. {$setc __i386__ := 0}
  53. {$endc}
  54. {$ifc not defined __x86_64__ and defined CPUX86_64}
  55. {$setc __x86_64__ := 1}
  56. {$elsec}
  57. {$setc __x86_64__ := 0}
  58. {$endc}
  59. {$ifc not defined __arm__ and defined CPUARM}
  60. {$setc __arm__ := 1}
  61. {$elsec}
  62. {$setc __arm__ := 0}
  63. {$endc}
  64. {$ifc not defined __arm64__ and defined CPUAARCH64}
  65. {$setc __arm64__ := 1}
  66. {$elsec}
  67. {$setc __arm64__ := 0}
  68. {$endc}
  69. {$ifc defined cpu64}
  70. {$setc __LP64__ := 1}
  71. {$elsec}
  72. {$setc __LP64__ := 0}
  73. {$endc}
  74. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  75. {$error Conflicting definitions for __ppc__ and __i386__}
  76. {$endc}
  77. {$ifc defined __ppc__ and __ppc__}
  78. {$setc TARGET_CPU_PPC := TRUE}
  79. {$setc TARGET_CPU_PPC64 := FALSE}
  80. {$setc TARGET_CPU_X86 := FALSE}
  81. {$setc TARGET_CPU_X86_64 := FALSE}
  82. {$setc TARGET_CPU_ARM := FALSE}
  83. {$setc TARGET_CPU_ARM64 := FALSE}
  84. {$setc TARGET_OS_MAC := TRUE}
  85. {$setc TARGET_OS_IPHONE := FALSE}
  86. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  87. {$setc TARGET_OS_EMBEDDED := FALSE}
  88. {$elifc defined __ppc64__ and __ppc64__}
  89. {$setc TARGET_CPU_PPC := FALSE}
  90. {$setc TARGET_CPU_PPC64 := TRUE}
  91. {$setc TARGET_CPU_X86 := FALSE}
  92. {$setc TARGET_CPU_X86_64 := FALSE}
  93. {$setc TARGET_CPU_ARM := FALSE}
  94. {$setc TARGET_CPU_ARM64 := FALSE}
  95. {$setc TARGET_OS_MAC := TRUE}
  96. {$setc TARGET_OS_IPHONE := FALSE}
  97. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  98. {$setc TARGET_OS_EMBEDDED := FALSE}
  99. {$elifc defined __i386__ and __i386__}
  100. {$setc TARGET_CPU_PPC := FALSE}
  101. {$setc TARGET_CPU_PPC64 := FALSE}
  102. {$setc TARGET_CPU_X86 := TRUE}
  103. {$setc TARGET_CPU_X86_64 := FALSE}
  104. {$setc TARGET_CPU_ARM := FALSE}
  105. {$setc TARGET_CPU_ARM64 := FALSE}
  106. {$ifc defined iphonesim}
  107. {$setc TARGET_OS_MAC := FALSE}
  108. {$setc TARGET_OS_IPHONE := TRUE}
  109. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  110. {$elsec}
  111. {$setc TARGET_OS_MAC := TRUE}
  112. {$setc TARGET_OS_IPHONE := FALSE}
  113. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  114. {$endc}
  115. {$setc TARGET_OS_EMBEDDED := FALSE}
  116. {$elifc defined __x86_64__ and __x86_64__}
  117. {$setc TARGET_CPU_PPC := FALSE}
  118. {$setc TARGET_CPU_PPC64 := FALSE}
  119. {$setc TARGET_CPU_X86 := FALSE}
  120. {$setc TARGET_CPU_X86_64 := TRUE}
  121. {$setc TARGET_CPU_ARM := FALSE}
  122. {$setc TARGET_CPU_ARM64 := FALSE}
  123. {$ifc defined iphonesim}
  124. {$setc TARGET_OS_MAC := FALSE}
  125. {$setc TARGET_OS_IPHONE := TRUE}
  126. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  127. {$elsec}
  128. {$setc TARGET_OS_MAC := TRUE}
  129. {$setc TARGET_OS_IPHONE := FALSE}
  130. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  131. {$endc}
  132. {$setc TARGET_OS_EMBEDDED := FALSE}
  133. {$elifc defined __arm__ and __arm__}
  134. {$setc TARGET_CPU_PPC := FALSE}
  135. {$setc TARGET_CPU_PPC64 := FALSE}
  136. {$setc TARGET_CPU_X86 := FALSE}
  137. {$setc TARGET_CPU_X86_64 := FALSE}
  138. {$setc TARGET_CPU_ARM := TRUE}
  139. {$setc TARGET_CPU_ARM64 := FALSE}
  140. {$setc TARGET_OS_MAC := FALSE}
  141. {$setc TARGET_OS_IPHONE := TRUE}
  142. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  143. {$setc TARGET_OS_EMBEDDED := TRUE}
  144. {$elifc defined __arm64__ and __arm64__}
  145. {$setc TARGET_CPU_PPC := FALSE}
  146. {$setc TARGET_CPU_PPC64 := FALSE}
  147. {$setc TARGET_CPU_X86 := FALSE}
  148. {$setc TARGET_CPU_X86_64 := FALSE}
  149. {$setc TARGET_CPU_ARM := FALSE}
  150. {$setc TARGET_CPU_ARM64 := TRUE}
  151. {$ifc defined ios}
  152. {$setc TARGET_OS_MAC := FALSE}
  153. {$setc TARGET_OS_IPHONE := TRUE}
  154. {$setc TARGET_OS_EMBEDDED := TRUE}
  155. {$elsec}
  156. {$setc TARGET_OS_MAC := TRUE}
  157. {$setc TARGET_OS_IPHONE := FALSE}
  158. {$setc TARGET_OS_EMBEDDED := FALSE}
  159. {$endc}
  160. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  161. {$elsec}
  162. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  163. {$endc}
  164. {$ifc defined __LP64__ and __LP64__ }
  165. {$setc TARGET_CPU_64 := TRUE}
  166. {$elsec}
  167. {$setc TARGET_CPU_64 := FALSE}
  168. {$endc}
  169. {$ifc defined FPC_BIG_ENDIAN}
  170. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  171. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  172. {$elifc defined FPC_LITTLE_ENDIAN}
  173. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  174. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  175. {$elsec}
  176. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  177. {$endc}
  178. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  179. {$setc CALL_NOT_IN_CARBON := FALSE}
  180. {$setc OLDROUTINENAMES := FALSE}
  181. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  182. {$setc OPAQUE_UPP_TYPES := TRUE}
  183. {$setc OTCARBONAPPLICATION := TRUE}
  184. {$setc OTKERNEL := FALSE}
  185. {$setc PM_USE_SESSION_APIS := TRUE}
  186. {$setc TARGET_API_MAC_CARBON := TRUE}
  187. {$setc TARGET_API_MAC_OS8 := FALSE}
  188. {$setc TARGET_API_MAC_OSX := TRUE}
  189. {$setc TARGET_CARBON := TRUE}
  190. {$setc TARGET_CPU_68K := FALSE}
  191. {$setc TARGET_CPU_MIPS := FALSE}
  192. {$setc TARGET_CPU_SPARC := FALSE}
  193. {$setc TARGET_OS_UNIX := FALSE}
  194. {$setc TARGET_OS_WIN32 := FALSE}
  195. {$setc TARGET_RT_MAC_68881 := FALSE}
  196. {$setc TARGET_RT_MAC_CFM := FALSE}
  197. {$setc TARGET_RT_MAC_MACHO := TRUE}
  198. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  199. {$setc TYPE_BOOL := FALSE}
  200. {$setc TYPE_EXTENDED := FALSE}
  201. {$setc TYPE_LONGLONG := TRUE}
  202. {$IFDEF FPC_DOTTEDUNITS}
  203. uses MacOsApi.MacTypes, MacOsApi.CFBase, MacOsApi.CGDirectDisplay, MacOsApi.CVBase, MacOsApi.CVReturns, MacOsApi.CGLTypes;
  204. {$ELSE FPC_DOTTEDUNITS}
  205. uses MacTypes, CFBase, CGDirectDisplay, CVBase, CVReturns, CGLTypes;
  206. {$ENDIF FPC_DOTTEDUNITS}
  207. {$endc} {not MACOSALLINCLUDE}
  208. {$ALIGN POWER}
  209. {$ifc TARGET_OS_MAC}
  210. {! @header CVDisplayLink.h
  211. @copyright 2004 Apple Computer, Inc. All rights reserved.
  212. @availability Mac OS X 10.4 or later
  213. @discussion The main purpose of the CoreVideo DisplayLink API is to provide a worker thread to the VideoUnit subsystem that is clocked based on the refresh rate of a CGDirectDisplay device. In the current implementation, these DisplayLinks are created automatically by the Video Unit display nodes, and the developer does not have to deal with them directly.
  214. A CoreVideo DisplayLink is represented in code by a CVDisplayLinkRef. The CVDisplayLinkRef API uses the CoreFoundation class system internally to provide reference counting behaviour and other such goodies. There are three different ways to create a CVDisplayLinkRef in the current API. The first call is the most general case, and the other two are provided as a convenience (the third will probably go away, as it's only marginally useful).
  215. }
  216. type
  217. CVDisplayLinkRef = ^__CVDisplayLink; { an opaque type }
  218. __CVDisplayLink = record end;
  219. type
  220. CVDisplayLinkOutputCallback = function( displayLink: CVDisplayLinkRef; const (*var*) inNow: CVTimeStamp; const (*var*) inOutputTime: CVTimeStamp; flagsIn: CVOptionFlags; var flagsOut: CVOptionFlags; displayLinkContext: UnivPtr ): CVReturn;
  221. function CVDisplayLinkGetTypeID: CFTypeID; external name '_CVDisplayLinkGetTypeID';
  222. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  223. {!
  224. @function CVDisplayLinkCreateWithCGDisplays
  225. @abstract General call to create a CVDisplayLink
  226. @discussion Use this call to create a CVDisplayLink for a set of displays indentified by the CGDirectDisplayIDs.
  227. @param displayArray array of CGDirectDisplayIDs
  228. @param count number of displays in the displayArray
  229. @param displayLisk The new display link will be returned here
  230. @result returns kCVReturnSuccesss on success.
  231. }
  232. function CVDisplayLinkCreateWithCGDisplays( displayArray: {variable-size-array} CGDirectDisplayIDPtr; count: CFIndex; var displayLinkOut: CVDisplayLinkRef ): CVReturn; external name '_CVDisplayLinkCreateWithCGDisplays';
  233. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  234. {!
  235. @function CVDisplayLinkCreateWithOpenGLDisplayMask
  236. @abstract Convenience call to create a CVDisplayLink from an OpenGL display mask.
  237. @discussion Use this call to create a CVDisplayLink for a CGOpenGLDisplayMask.
  238. @param mask CGOpenGLDisplayMask describing the display
  239. @param displayLisk The new display link will be returned here
  240. @result returns kCVReturnSuccesss on success.
  241. }
  242. function CVDisplayLinkCreateWithOpenGLDisplayMask( mask: CGOpenGLDisplayMask; var displayLinkOut: CVDisplayLinkRef ): CVReturn; external name '_CVDisplayLinkCreateWithOpenGLDisplayMask';
  243. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  244. {!
  245. @function CVDisplayLinkCreateWithCGDisplay
  246. @abstract Convenience call to create a CVDisplayLink for a single CGDirectDisplay.
  247. @discussion Use this call to create a CVDisplayLink for a single CGDirectDisplay.
  248. @param displayID CGDirectDisplayID of the target display
  249. @param displayLisk The new display link will be returned here
  250. @result returns kCVReturnSuccesss on success.
  251. }
  252. function CVDisplayLinkCreateWithCGDisplay( displayID: CGDirectDisplayID; var displayLinkOut: CVDisplayLinkRef ): CVReturn; external name '_CVDisplayLinkCreateWithCGDisplay';
  253. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  254. {!
  255. @function CVDisplayLinkCreateWithActiveCGDisplays
  256. @abstract Convenience function to create a CVDisplayLink capable of being used with all active CGDisplays
  257. @param displayLinkOut The newly created CVDisplayLink
  258. @result kCVReturnSuccess if the device was created, or failure
  259. }
  260. function CVDisplayLinkCreateWithActiveCGDisplays( var displayLinkOut: CVDisplayLinkRef ): CVReturn; external name '_CVDisplayLinkCreateWithActiveCGDisplays';
  261. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  262. {!
  263. @function CVDisplayLinkSetCurrentCGDisplay
  264. @abstract Sets the current display of a DisplayLink
  265. @discussion It is safe to call this with a running display link, but be aware that there will likely be a timestamp
  266. discontinuity in the video time stamp
  267. @param displayLink target CVDisplayLinkRef
  268. @param displayID target CGDirectDisplayID
  269. @result CVReturn. kCVReturnSuccesss if successfull.
  270. }
  271. function CVDisplayLinkSetCurrentCGDisplay( displayLink: CVDisplayLinkRef; displayID: CGDirectDisplayID ): CVReturn; external name '_CVDisplayLinkSetCurrentCGDisplay';
  272. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  273. {!
  274. @function CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext
  275. @abstract Convenience function to select a CVDisplayLink most optimal for the current renderer of the passed in OpenGL context
  276. @param displayLink The CVDisplayLink for which you want to set the current CGDisplay
  277. @param cglContext The OpenGL context to retrieve the current renderer from.
  278. @param cglPixelFormat The OpenGL pixel format used to create the passed in OpenGL context
  279. @result kCVReturnSuccess if a device was found, or failure.
  280. }
  281. function CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext( displayLink: CVDisplayLinkRef; cglContext: CGLContextObj; cglPixelFormat: CGLPixelFormatObj ): CVReturn; external name '_CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext';
  282. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  283. {!
  284. @function CVDisplayLinkGetCurrentCGDisplay
  285. @abstract Gets the current display of a DisplayLink
  286. @discussion (description)
  287. @param displayLink target CVDisplayLinkRef
  288. @result CGDirectDisplayID
  289. }
  290. function CVDisplayLinkGetCurrentCGDisplay( displayLink: CVDisplayLinkRef ): CGDirectDisplayID; external name '_CVDisplayLinkGetCurrentCGDisplay';
  291. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  292. {!
  293. @function CVDisplayLinkSetOutputCallback
  294. @abstract Set the renderer output callback function
  295. @discussion The DisplayLink will invoke this callback whenever it wants you to output a frame.
  296. @param displayLink target CVDisplayLinkRef
  297. @param callback CVDisplayLinkOutputCallback function
  298. @param userInfo User data for the callback to identify the context.
  299. @result CVReturn. kCVReturnSuccesss if successfull.
  300. }
  301. function CVDisplayLinkSetOutputCallback( displayLink: CVDisplayLinkRef; callback: CVDisplayLinkOutputCallback; userInfo: UnivPtr ): CVReturn; external name '_CVDisplayLinkSetOutputCallback';
  302. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  303. {!
  304. @function CVDisplayLinkStart
  305. @abstract Start timer for DisplayLink
  306. @discussion (description)
  307. @param displayLink target CVDisplayLinkRef
  308. @result CVReturn. kCVReturnSuccesss if successfull.
  309. kCVReturnDisplayLinkCallbacksNotSet The DisplayLink cannot be started untill both callbacks are set.
  310. }
  311. function CVDisplayLinkStart( displayLink: CVDisplayLinkRef ): CVReturn; external name '_CVDisplayLinkStart';
  312. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  313. {!
  314. @function CVDisplayLinkStop
  315. @abstract Stop timer for DisplayLink
  316. @discussion (description)
  317. @param displayLink target CVDisplayLinkRef
  318. @result CVReturn. kCVReturnSuccesss if successfull.
  319. }
  320. function CVDisplayLinkStop( displayLink: CVDisplayLinkRef ): CVReturn; external name '_CVDisplayLinkStop';
  321. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  322. {!
  323. @function CVDisplayLinkGetNominalOutputVideoRefreshPeriod
  324. @abstract Retrieves the nominal refresh period of a CVDisplayLink.
  325. @discussion This call allows one to retrieve the device's "ideal" refresh period. For example, an NTSC output device might report 1001/60000 to represent the exact NTSC vertial refresh rate.
  326. @param displayLink The CVDisplayLink to get the refresh period from.
  327. @result A CVTime struct that holds the nominal refresh period. This value may be indefinite.
  328. }
  329. function CVDisplayLinkGetNominalOutputVideoRefreshPeriod( displayLink: CVDisplayLinkRef ): CVTime; external name '_CVDisplayLinkGetNominalOutputVideoRefreshPeriod';
  330. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  331. {!
  332. @function CVDisplayLinkGetOutputVideoLatency
  333. @abstract Retrieves the nominal latency of a CVDisplayLink.
  334. @discussion This call allows one to retrieve the device's built in output latency. An NTSC device with one frame of latency might report back 1001/30000 or 2002/60000, for example.
  335. @param displayLink The CVDisplayLink to get the latency period from.
  336. @result A CVTime struct that holds the latency. This value may be indefinite.
  337. }
  338. function CVDisplayLinkGetOutputVideoLatency( displayLink: CVDisplayLinkRef ): CVTime; external name '_CVDisplayLinkGetOutputVideoLatency';
  339. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  340. {!
  341. @function CVDisplayLinkGetActualOutputVideoRefreshPeriod
  342. @abstract Retrieves the actual output refresh period of a display as measured by the host timebase.
  343. @discussion This call returns the actual output refresh period (in seconds) as computed relative to the host's timebase.
  344. @param displayLink The CVDisplayLink to get the refresh period from.
  345. @result A double containing the actual refresh period. This value may be zero if the device is not running, or is otherwise unavailable.
  346. }
  347. function CVDisplayLinkGetActualOutputVideoRefreshPeriod( displayLink: CVDisplayLinkRef ): Float64; external name '_CVDisplayLinkGetActualOutputVideoRefreshPeriod';
  348. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  349. {!
  350. @function CVDisplayLinkIsRunning
  351. @abstract Retrieves the running state of a CVDisplayLink.
  352. @discussion This call queries the running state of the given CVDisplayLink.
  353. @param displayLink The CVDisplayLink to get the running state from.
  354. @result A boolean describing the running state. It returns true if it is running and false if it is not running or the CVDisplayLink is invalid.
  355. }
  356. function CVDisplayLinkIsRunning( displayLink: CVDisplayLinkRef ): Boolean; external name '_CVDisplayLinkIsRunning';
  357. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  358. {!
  359. @function CVDisplayLinkGetCurrentTime
  360. @abstract Retrieves the current ("now") time of a given CVDisplayLink
  361. @discussion This call may be used to get the current time of a running CVDisplayLink, outside of the output callback.
  362. @param displayLink The CVDisplayLink to get the current time from.
  363. @param outTime A pointer to a CVTimeStamp struct. This struct's version field must currently be set correctly (currently 0) to indicate which version of the timestamp struct is desired.
  364. @result kCVReturnSuccess if the current time could be retrieved, otherwise an error indicating why the operation failed.
  365. }
  366. function CVDisplayLinkGetCurrentTime( displayLink: CVDisplayLinkRef; var outTime: CVTimeStamp ): CVReturn; external name '_CVDisplayLinkGetCurrentTime';
  367. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  368. {!
  369. @function CVDisplayLinkTranslateTime
  370. @abstract Translates the time in the CVDisplayLink's time base from one representation to
  371. another. Note that the device has to be running for this call to succeed.
  372. @param displayLink The CVDisplayLink who's timebase should be used to do the translation.
  373. @param inTime A CVTimeStamp containing the source time to be translated.
  374. @param outTime A CVTimeStamp into which the target time will be written. This struct's version field must currently be set correctly
  375. (currently 0) to indicate which version of the timestamp struct is desired. As well, the flags field should be used to specify
  376. which representations to translate to.
  377. @result kCVReturnSuccess if the time could be translated, otherwise an error indicating why the operation failed.
  378. }
  379. function CVDisplayLinkTranslateTime( displayLink: CVDisplayLinkRef; const (*var*) inTime: CVTimeStamp; var outTime: CVTimeStamp ): CVReturn; external name '_CVDisplayLinkTranslateTime';
  380. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  381. {!
  382. @function CVDisplayLinkRetain
  383. @abstract Retains the CVDisplayLink
  384. @discussion Use this call to retain a CVDisplayLink.
  385. @param displayLink target CVDisplayLinkRef. NULL safe.
  386. @result If successfull the passed in dislplayLink
  387. }
  388. function CVDisplayLinkRetain( displayLink: CVDisplayLinkRef ): CVDisplayLinkRef; external name '_CVDisplayLinkRetain';
  389. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  390. {!
  391. @function CVDisplayLinkRelease
  392. @abstract Releases the CVDisplayLink
  393. @discussion Use this call to release a CVDisplayLink.
  394. @param displayLink target CVDisplayLinkRef. NULL safe.
  395. }
  396. procedure CVDisplayLinkRelease( displayLink: CVDisplayLinkRef ); external name '_CVDisplayLinkRelease';
  397. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  398. {$endc} //TARGET_OS_MAC
  399. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  400. end.
  401. {$endc} {not MACOSALLINCLUDE}