Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
4.8 KiB

  1. /*
  2. * CVPixelBufferPool.h
  3. * CoreVideo
  4. *
  5. * Copyright 2004 Apple Computer, Inc. All rights reserved.
  6. *
  7. */
  8. /*! @header CVPixelBufferPool.h
  9. @copyright 2004 Apple Computer, Inc. All rights reserved.
  10. @availability Mac OS X 10.4 or later
  11. @discussion CVPixelBufferPool is a utility object for managing a set of CVPixelBuffer objects that are going to be recycled.
  12. */
  13. #if !defined(__COREVIDEO__CVPIXELBUFFERPOOL_H__)
  14. #define __COREVIDEO__CVPIXELBUFFERPOOL_H__ 1
  15. #include <TargetConditionals.h>
  16. #if TARGET_OS_MAC
  17. #include <QuartzCore/CVBase.h>
  18. #include <QuartzCore/CVReturn.h>
  19. #include <QuartzCore/CVPixelBuffer.h>
  20. #else
  21. #include <CVBase.h>
  22. #include <CVReturn.h>
  23. #include <CVPixelBuffer.h>
  24. #endif
  25. #if defined(__cplusplus)
  26. extern "C" {
  27. #endif
  28. typedef struct __CVPixelBufferPool *CVPixelBufferPoolRef;
  29. // By default, buffers will age out after one second. If required, setting an age of zero will disable
  30. // the age-out mechanism completely.
  31. #if TARGET_OS_MAC
  32. CV_EXPORT const CFStringRef kCVPixelBufferPoolMinimumBufferCountKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  33. CV_EXPORT const CFStringRef kCVPixelBufferPoolMaximumBufferAgeKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  34. #else
  35. #define kCVPixelBufferPoolMinimumBufferCountKey CFSTR("MinimumBufferCount")
  36. #define kCVPixelBufferPoolMaximumBufferAgeKey CFSTR("MaximumBufferAge")
  37. #endif
  38. CV_EXPORT CFTypeID CVPixelBufferPoolGetTypeID() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  39. /*!
  40. @function CVPixelBufferPoolRetain
  41. @abstract Retains a CVPixelBufferPoolRef object
  42. @discussion Equivalent to CFRetain, but NULL safe
  43. @param buffer A CVPixelBufferPoolRef object that you want to retain.
  44. @result A CVPixelBufferPoolRef object that is the same as the passed in buffer.
  45. */
  46. CV_EXPORT CVPixelBufferPoolRef CVPixelBufferPoolRetain( CVPixelBufferPoolRef pixelBufferPool ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // NULL-safe
  47. /*!
  48. @function CVPixelBufferPoolRelease
  49. @abstract Releases a CVPixelBufferPoolRef object
  50. @discussion Equivalent to CFRelease, but NULL safe
  51. @param buffer A CVPixelBufferPoolRef object that you want to release.
  52. */
  53. CV_EXPORT void CVPixelBufferPoolRelease( CVPixelBufferPoolRef pixelBufferPool ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // NULL-safe
  54. /*!
  55. @function CVPixelBufferPoolCreate
  56. @abstract Creates a new Pixel Buffer pool.
  57. @param allocator The CFAllocatorRef to use for allocating this buffer pool. May be NULL.
  58. @param attributes A CFDictionaryRef containing the attributes to be used for creating new PixelBuffers within the pool.
  59. @param poolOut The newly created pool will be placed here
  60. @result Returns kCVReturnSuccess on success
  61. */
  62. CV_EXPORT CVReturn CVPixelBufferPoolCreate(CFAllocatorRef allocator,
  63. CFDictionaryRef poolAttributes,
  64. CFDictionaryRef pixelBufferAttributes,
  65. CVPixelBufferPoolRef *poolOut) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  66. /*!
  67. @function CVPixelBufferPoolGetAttributes
  68. @abstract Returns the pool attributes dictionary for a CVPixelBufferPool
  69. @param pool The CVPixelBufferPoolRef to retrieve the attributes from
  70. @result Returns the pool attributes dictionary, or NULL on failure.
  71. */
  72. CV_EXPORT CFDictionaryRef CVPixelBufferPoolGetAttributes(CVPixelBufferPoolRef pool) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  73. /*!
  74. @function CVPixelBufferPoolGetPixelBufferAttributes
  75. @abstract Returns the attributes of pixel buffers that will be created from this pool.
  76. @discussion This function is provided for those cases where you may need to know some information about the buffers that
  77. will be created up front.
  78. @param pool The CVPixelBufferPoolRef to retrieve the attributes from
  79. @result Returns the pixel buffer attributes dictionary, or NULL on failure.
  80. */
  81. CV_EXPORT CFDictionaryRef CVPixelBufferPoolGetPixelBufferAttributes(CVPixelBufferPoolRef pool) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  82. /*!
  83. @function CVPixelBufferPoolCreatePixelBuffer
  84. @abstract Creates a new PixelBuffer object from the pool.
  85. @discussion The function creates a new (attachment-free) CVPixelBuffer using the pixel buffer attributes specifed during pool creation.
  86. @param allocator The CFAllocatorRef to use for creating the pixel buffer. May be NULL.
  87. @param pool The CVPixelBufferPool that should create the new CVPixelBuffer.
  88. @param pixelBufferOut The newly created pixel buffer will be placed here
  89. @result Returns kCVReturnSuccess on success
  90. */
  91. CV_EXPORT CVReturn CVPixelBufferPoolCreatePixelBuffer(CFAllocatorRef allocator,
  92. CVPixelBufferPoolRef pixelBufferPool,
  93. CVPixelBufferRef *pixelBufferOut) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
  94. #if defined(__cplusplus)
  95. }
  96. #endif
  97. #endif