Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

Core Video Reference

Framework
QuartzCore/QuartzCore.h
Companion guide
Declared in
CVBase.h
CVBuffer.h
CVDisplayLink.h
CVHostTime.h
CVImageBuffer.h
CVOpenGLBuffer.h
CVOpenGLBufferPool.h
CVOpenGLTexture.h
CVOpenGLTextureCache.h
CVPixelBuffer.h
CVPixelBufferPool.h
CVPixelFormatDescription.h
CVReturn.h

Overview

Core Video is a new pipeline model for digital video in Mac OS X. Partitioning the processing into discrete steps makes it simpler for developers to access and manipulate individual frames without having to worry about translating between data types (QuickTime, OpenGL, and so on) or display synchronization issues.

Core Video is available in:

Functions by Task

CVBuffer Functions

Core Video buffer functions operate on all Core Video buffer types, including pixel buffers and OpenGL buffers, as well as OpenGL textures.

CVDisplayLink Functions

The main purpose of the CoreVideo display link to provide a separate high-priority thread to notify your application when a given display will need each frame. How often a frame is requested is based on the refresh rate of the display device currently associated with the display link. A CoreVideo display link is represented in code by the CVDisplayLinkRef type. The display link API uses the Core Foundation class system internally to provide reference counting behaviour and other useful properties.

CVHostTime Functions

CVImageBuffer Functions

The functions in this section operate on Core Video buffers derived from the CVImageBuffer abstract type (CVImageBufferRef ); specifically, pixel buffers, OpenGL buffers, and OpenGL textures.

CVOpenGLBuffer Functions

The Core Video OpenGL buffer (type CVOpenGLBufferRef is a wrapper around the standard OpenGL pbuffer.

CVOpenGLBufferPool Functions

An OpenGL buffer pool is a utility object for managing a set of OpenGL buffer objects for recycling.

CVOpenGLTexture Functions

The Core Video OpenGL texture is a wrapper around the standard OpenGL texture type.

CVOpenGLTextureCache Functions

CVPixelBuffer Functions

A pixel buffer stores an image in main memory

CVPixelBufferPool Functions

CVPixelFormatDescription Functions

Used only if you are defining a custom pixel format.

Functions

CVBufferGetAttachment

Returns a specific attachment of a Core Video buffer.

CFTypeRef CVBufferGetAttachment (
   CVBufferRef buffer,
   CFStringRef key,
   CVAttachmentMode *attachmentMode
);

Parameters
buffer

The Core Video buffer whose attachment you want to obtain.

key

A key in the form of a Core Foundation string identifying the desired attachment.

attachmentMode

On return, attachmentMode points to the mode of the attachment. See “CVBuffer Attachment Modes” for possible values. If the attachment mode is not defined, this parameter returns NULL.

Return Value

If found, the specified attachment.

Discussion

You can attach any Core Foundation object to a Core Video buffer to store additional information by calling CVBufferSetAttachment or CVBufferSetAttachments.

You can find predefined attachment keys in “CVBuffer Attachment Keys” and “Image Buffer Attachment Keys.”

Availability
Declared In
CVBuffer.h

CVBufferGetAttachments

Returns all attachments of a Core Video buffer.

CFDictionaryRef CVBufferGetAttachments (
   CVBufferRef buffer,
   CVAttachmentMode attachmentMode
);

Parameters
buffer

The Core Video buffer whose attachments you want to obtain.

attachmentMode

The mode of the attachments you want to obtain. See “CVBuffer Attachment Modes” for possible values.

Return Value

A Core Foundation dictionary with all buffer attachments identified by keys. If no attachment is present, the dictionary is empty. Returns NULL for an invalid attachment mode.

Discussion

CVBufferGetAttachments is a convenience call that returns all attachments with their corresponding keys in a Core Foundation dictionary.

You can find predefined attachment keys in “CVBuffer Attachment Keys” and “Image Buffer Attachment Keys.”

Availability
Declared In
CVBuffer.h

CVBufferPropagateAttachments

Copies all propagatable attachments from one Core Video buffer to another.

void CVBufferPropagateAttachments (
   CVBufferRef sourceBuffer,
   CVBufferRef destinationBuffer
);

Parameters
sourceBuffer

The buffer to copy attachments from.

destinationBuffer

The buffer to copy attachments to.

Discussion

CVBufferPropagateAttachments is a convenience call that copies all attachments with a mode of kCVAttachmentMode_ShouldPropagate from one buffer to another.

Availability
Declared In
CVBuffer.h

CVBufferRelease

Releases a Core Video buffer.

void CVBufferRelease (
   CVBufferRef buffer
);

Parameters
buffer

The Core Video buffer that you want to release.

Discussion

Like CFRelease CVBufferRelease decrements the retain count of a Core Video buffer. If that count consequently becomes zero the memory allocated to the object is deallocated and the object is destroyed. Unlike CFRelease, you can pass NULL to CVBufferRelease without causing a crash.

Availability
Declared In
CVBuffer.h

CVBufferRemoveAllAttachments

Removes all attachments of a Core Video buffer.

void CVBufferRemoveAllAttachments (
   CVBufferRef buffer
);

Parameters
buffer

The Core Video buffer whose attachments you want to remove.

Discussion

CVBufferRemoveAllAttachments removes all attachments of a buffer and decrements their reference counts.

Availability
Declared In
CVBuffer.h

CVBufferRemoveAttachment

Removes a specific attachment of a Core Video buffer.

void CVBufferRemoveAttachment (
   CVBufferRef buffer,
   CFStringRef key
);

Parameters
buffer

The Core Video buffer containing the attachment to remove.

key

A key in the form of a Core Foundation string identifying the desired attachment.

Discussion

CVBufferRemoveAttachment removes an attachment identified by a key. If found the attachment is removed and the retain count decremented.

You can find predefined attachment keys in “CVBuffer Attachment Keys” and “Image Buffer Attachment Keys.”

Availability
Declared In
CVBuffer.h

CVBufferRetain

Retains a Core Video buffer.

CVBufferRef CVBufferRetain (
   CVBufferRef buffer
);

Parameters
buffer

The Core Video buffer that you want to retain.

Return Value

For convenience, the same Core Video buffer you wanted to retain.

Discussion

Like CFRetain, CVBufferRetain increments the retain count of a Core Video buffer. Unlike CFRetain, you can pass NULL to CVBufferRetain without causing a crash.

Availability
Declared In
CVBuffer.h

CVBufferSetAttachment

Sets or adds an attachment of a Core Video buffer.

void CVBufferSetAttachment (
   CVBufferRef buffer,
   CFStringRef key,
   CFTypeRef value,
   CVAttachmentMode attachmentMode
);

Parameters
buffer

The Core Video buffer to which to add or set the attachment.

key

The key, in the form of a Core Foundation string, identifying the desired attachment.

value

The attachment in the form of a Core Foundation object. If this parameter is NULL, the function returns an error.

attachmentMode

Specifies the attachment mode for this attachment. See “CVBuffer Attachment Modes” for possible values. Any given attachment key may exist in only one mode at a time.

Discussion

You can attach any Core Foundation object to a Core Video buffer to store additional information. If the key doesn't currently exist for the buffer object when you call this function, the new attachment will be added. If the key does exist, the existing attachment will be replaced. In both cases the retain count of the attachment will be incremented. The value can be any CFType. You can find predefined attachment keys in “CVBuffer Attachment Keys” and “Image Buffer Attachment Keys.”

You can also set attachments when creating a buffer by specifying them in the kCVBufferPropagatedAttachmentsKey or kkCVBufferNonpropagatedAttachmentsKey attributes when creating the buffer.

To retrieve attachments, use the CVBufferGetAttachment or CVBufferGetAttachments functions.

Availability
Declared In
CVBuffer.h

CVBufferSetAttachments

Sets a set of attachments for a Core Video buffer.

void CVBufferSetAttachments (
   CVBufferRef buffer,
   CFDictionaryRef theAttachments,
   CVAttachmentMode attachmentMode
);

Parameters
buffer

The Core Video buffer to which to set the attachments.

theAttachments

The attachments to set, in the form of a Core Foundation dictionary array.

attachmentMode

Specifies which attachment mode is desired for this attachment. A particular attachment key may only exist in a single mode at a time.

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.

Availability
Declared In
CVBuffer.h

CVDisplayLinkCreateWithActiveCGDisplays

Creates a display link capable of being used with all active displays.

CVReturn CVDisplayLinkCreateWithActiveCGDisplays (
   CVDisplayLinkRef *displayLinkOut
);

Parameters
displayLinkOut

On return, displayLinkOut points to the newly created display link.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

CVDisplayLinkCreateWithActiveCGDisplays determines the displays actively used by the host computer and creates a display link compatible with all of them. For most applications, calling this function is the most convenient way to create a display link. After creation, you can assign the display link to any active display by calling CVDisplayLinkSetCurrentCGDisplay.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkCreateWithCGDisplay

Creates a display link for a single display.

CVReturn CVDisplayLinkCreateWithCGDisplay (
   CGDirectDisplayID displayID,
   CVDisplayLinkRef *displayLinkOut
);

Parameters
displayID

The Core Graphics ID of the target display.

displayLinkOut

On return, displayLinkOut points to the newly created display link.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

Use this call to create a display link for a single display.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkCreateWithCGDisplays

Creates a display link for an array of displays.

CVReturn CVDisplayLinkCreateWithCGDisplays (
   CGDirectDisplayID *displayArray,
   CFIndex count,
   CVDisplayLinkRef *displayLinkOut
);

Parameters
displayArray

A pointer to an array of Core Graphics display IDs representing all the active monitors you want to use with this display link.

count

The number of displays in the display array.

displayLisk

On return, displayLinkOut points to the newly created display link.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

Use this call to create a display link for a set of displays identified by the Core Graphics display IDs.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkCreateWithOpenGLDisplayMask

Creates a display link from an OpenGL display mask.

CVReturn CVDisplayLinkCreateWithOpenGLDisplayMask (
   CGOpenGLDisplayMask mask,
   CVDisplayLinkRef *displayLinkOut
);

Parameters
mask

The OpenGL display mask describing the available displays.

displayLinkOut

On return, displayLinkOut points to the newly created display link.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

Using this function avoids having to call the Core Graphics function CGOpenGLDisplayMaskToDisplayID.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkGetActualOutputVideoRefreshPeriod

Retrieves the actual output refresh period of a display as measured by the host time base.

double CVDisplayLinkGetActualOutputVideoRefreshPeriod (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link to get the refresh period from.

Return Value

A double-precision floating-point value representing the actual refresh period. This value may be zero if the device is not running or is otherwise unavailable.

Discussion

This call returns the actual output refresh period (in seconds) as computed relative to the host time base.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkGetCurrentCGDisplay

Gets the current display associated with a display link.

CGDirectDisplayID CVDisplayLinkGetCurrentCGDisplay (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link whose current display you want obtain.

Return Value

A CGDirectDisplayID representing the current display.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkGetCurrentTime

Retrieves the current (“now”) time of a given display link.

CVReturn CVDisplayLinkGetCurrentTime (
   CVDisplayLinkRef displayLink,
   CVTimeStamp *outTime
);

Parameters
displayLink

The display link whose current time you want to obtain.

outTime

A pointer to a CVTimeStamp structure. Note that yout must set the version in the structure (currently 0) before calling to indicate which version of the timestamp structure you want.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

You use this call to obtain the timestamp of the frame that is currently being displayed.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkGetNominalOutputVideoRefreshPeriod

Retrieves the nominal refresh period of a display link.

CVTime CVDisplayLinkGetNominalOutputVideoRefreshPeriod (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link whose refresh period you want to obtain.

Return Value

A CVTime structure that holds the nominal refresh period. This value is indefinite if an invalid display link was specified.

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 vertical refresh rate.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkGetOutputVideoLatency

Retrieves the nominal latency of a display link.

CVTime CVDisplayLinkGetOutputVideoLatency (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link whose latency value you want to obtain.

Return Value

A CVTime structure that holds the latency value. This value may be indefinite.

Discussion

This call allows you to retrieve the device’s built-in output latency. For example, an NTSC device with one frame of latency might report back 1001/30000 or 2002/60000.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkGetTypeID

Obtains the Core Foundation ID for the display link data type.

CFTypeID CVDisplayLinkGetTypeID (
   void
);

Return Value

The Core Foundation ID for this type.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkIsRunning

Indicates whether a given display link is running.

Boolean CVDisplayLinkIsRunning (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link whose run state you want to determine.

Return Value

Returns true if the display link is running, false otherwise.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkRelease

Releases a display link.

void CVDisplayLinkRelease (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link to release. This function is NULL-safe.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkRetain

Retains a display link.

CVDisplayLinkRef CVDisplayLinkRetain (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link to retain. This function is NULL-safe.

Return Value

For convenience, this function returns the retained display link if successful.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkSetCurrentCGDisplay

Sets the current display of a display link.

CVReturn CVDisplayLinkSetCurrentCGDisplay (
   CVDisplayLinkRef displayLink,
   CGDirectDisplayID displayID
);

Parameters
displayLink

The display link whose display you want to set.

displayID

The ID of the display to be set.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

Although it is safe to call this function on a running display link, a discontinuity may appear in the video timestamp.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext

Selects the display link most optimal for the current renderer of an OpenGL context.

CVReturn CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext (
   CVDisplayLinkRef displayLink,
   CGLContextObj cglContext,
   CGLPixelFormatObj cglPixelFormat
);

Parameters
displayLink

The display link for which you want to set the current display.

cglContext

The OpenGL context to retrieve the current renderer from.

cglPixelFormat

The OpenGL pixel format used to create the passed-in OpenGL context.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

This function chooses the display with the lowest refresh rate.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkSetOutputCallback

Set the renderer output callback function.

CVReturn CVDisplayLinkSetOutputCallback (
   CVDisplayLinkRef displayLink,
   CVDisplayLinkOutputCallback callback,
   void *userInfo
);

Parameters
displayLink

The display link whose output callback you want to set.

callback

The callback function to set for this display link. See CVDisplayLinkOutputCallback for more information about implementing this function.

userInfo

A pointer to user data.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

The display link invokes this callback whenever it wants you to output a frame.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkStart

Activates a display link.

CVReturn CVDisplayLinkStart (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link to activate.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

Calling this function starts the display link thread, which then periodically calls back to your application to request that you display frames. If the specified display link is already running, CVDisplayLinkStart returns an error.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkStop

Stops a display link.

CVReturn CVDisplayLinkStop (
   CVDisplayLinkRef displayLink
);

Parameters
displayLink

The display link to stop.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

If the specified display link is already stopped, CVDisplayLinkStop returns an error.

In Mac OS X v.10.4 and later, the display link thread is automatically stopped if the user employs Fast User Switching. The display link is restarted when switching back to the original user.

Availability
Declared In
CVDisplayLink.h

CVDisplayLinkTranslateTime

Translates the time in the display link’s time base from one representation to another.

CVReturn CVDisplayLinkTranslateTime (
   CVDisplayLinkRef displayLink,
   const CVTimeStamp *inTime,
   CVTimeStamp *outTime
);

Parameters
displayLink

The display link whose time base should be used to do the translation.

inTime

A pointer to a CVTimeStamp structure containing the source time to translate.

outTime

A pointer to a CVTimeStamp structure into which the target time is written. Before calling, you must set the version field (currently 0) to indicate which version of the structure you want. You should also set the flags field to specify which representations to translate to.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

Note that the display link has to be running for this call to succeed.

Availability
Declared In
CVDisplayLink.h

CVGetCurrentHostTime

Retrieves the current value of the host time base.

uint64_t CVGetCurrentHostTime

Return Value

The current host time.

Discussion

In Mac OS X, the host time base for CoreVideo and CoreAudio are identical, so the values returned from either API can be used interchangeably.

Availability
Declared In
CVHostTime.h

CVGetHostClockFrequency

Retrieve the frequency of the host time base.

double CVGetHostClockFrequency

Return Value

The current host frequency.

Discussion

In Mac OS X, the host time base for CoreVideo and CoreAudio are identical, and the values returned from either API can be used interchangeably.

Availability
Declared In
CVHostTime.h

CVGetHostClockMinimumTimeDelta

Retrieve the smallest possible increment in the host time base.

uint32_t CVGetHostClockMinimumTimeDelta

Return Value

The smallest valid increment in the host time base.

Availability
Declared In
CVHostTime.h

CVImageBufferGetCleanRect

Returns the source rectangle of a Core Video image buffer that represents the clean aperture of the buffer in encoded pixels.

CGRect CVImageBufferGetCleanRect (
   CVImageBufferRef imageBuffer
);

Parameters
imageBuffer

The image buffer that you want to retrieve the display size from.

Return Value

A CGRect structure returning the nominal display size of the buffer. Returns a rectangle of zero size if called with either a non-CVImageBufferRef type or NULL.

Discussion

The clean aperture size is smaller than the full size of the image. For example, an NTSC DV frame would return a CGRect structure with an origin of (8,0) and a size of (704,480). Note that the origin of this rectangle is always in the lower-left corner. This is the same coordinate system as that used by Quartz and Core Image.

Availability
Declared In
CVImageBuffer.h

CVImageBufferGetColorSpace

Returns the color space of a Core Video image buffer.

CGColorSpaceRef CVImageBufferGetColorSpace (
   CVImageBufferRef imageBuffer
);

Parameters
imageBuffer

The image buffer that you want to retrieve the color space from.

Return Value

The color space of the buffer. Returns NULL if called with either a non-CVImageBufferRef type or NULL.

Availability
Declared In
CVImageBuffer.h

CVImageBufferGetDisplaySize

Returns the nominal output display size, in square pixels, of a Core Video image buffer.

CGSize CVImageBufferGetDisplaySize (
   CVImageBufferRef imageBuffer
);

Parameters
imageBuffer

The image buffer that you want to retrieve the display size from.

Return Value

A CGSize structure defining the nominal display size of the buffer Returns zero size if called with a non-CVImageBufferRef type or NULL.

Discussion

For example, for an NTSC DV frame this would be 640 x 480.

Availability
Declared In
CVImageBuffer.h

CVImageBufferGetEncodedSize

Returns the full encoded dimensions of a Core Video image buffer.

CGSize CVImageBufferGetEncodedSize (
   CVImageBufferRef imageBuffer
);

Parameters
imageBuffer

The image buffer that you want to retrieve the encoded size from.

Return Value

A CGSize structure defining the full encoded size of the buffer. Returns zero size if called with either a non-CVImageBufferRef type or NULL.

Discussion

For example, for an NTSC DV frame, the encoded size would be 720 x 480. Note: When creating a Core Image image from a Core Video image buffer, you use this call to retrieve the image size.

Availability
Declared In
CVImageBuffer.h

CVOpenGLBufferAttach

Attaches an OpenGL context to a Core Video OpenGL buffer.

CVReturn CVOpenGLBufferAttach (
   CVOpenGLBufferRef openGLBuffer,
   CGLContextObj cglContext,
   GLenum face,
   GLint level,
   GLint screen
);

Parameters
openGLBuffer

The buffer you want to attach an OpenGL context to.

cglContext

The OpenGL context you want to attach.

face

The OpenGL face enumeration (0 for noncube maps.)

level

The mipmap level for drawing in the OpenGL context. This value cannot exceed the maximum mipmap level for this buffer.

screen

The virtual screen number you want to use for this context.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Availability
Declared In
CVOpenGLBuffer.h

CVOpenGLBufferCreate

Create a new Core Video OpenGL buffer that can be used for OpenGL rendering purposes

CVReturn CVOpenGLBufferCreate (
   CFAllocatorRef allocator,
   size_t width,
   size_t height,
   CFDictionaryRef attributes,
   CVOpenGLBufferRef *bufferOut
);

Parameters
allocator

The allocator to use to create the Core Video OpenGL buffer. Pass NULL to specify the default allocator.

width

The width of the buffer in pixels.

height

The height of the buffer in pixels.

attributes

A Core Foundation dictionary containing other desired attributes of the buffer (texture target, internal format, max mipmap level, etc.). May be NULL. The following attribute values are assumed if you do not explicitly define them:

  • kCVOpenGLBufferTarget = GL_TEXTURE_RECTANGLE_EXT

  • kCVOpenGLBufferInternalFormat = GL_RGBA

  • kCVOpenGLBufferMaximumMipmapLevel = 0

bufferOut

On return, bufferOut points to the newly created OpenGL buffer.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

Availability
Declared In
CVOpenGLBuffer.h

CVOpenGLBufferGetAttributes

Obtains the attributes of a Core Video OpenGL buffer.

CFDictionaryRef CVOpenGLBufferGetAttributes (
   CVOpenGLBufferRef openGLBuffer
);

Parameters
openGLBuffer

The OpenGL buffer whose attributes you want to obtain.

Return Value

A Core Foundation dictionary containing the OpenGL buffer attributes, or NULL if no attributes exist.

Availability
Declared In
CVOpenGLBuffer.h

CVOpenGLBufferGetTypeID

Obtains the Core Foundation type ID for the OpenGL buffer type.

CFTypeID CVOpenGLBufferGetTypeID (
   void
);

Return Value

The Core Foundation ID for this data type.

Availability
Declared In
CVOpenGLBuffer.h

CVOpenGLBufferPoolCreate

Creates a new OpenGL buffer pool.

CVReturn CVOpenGLBufferPoolCreate (
   CFAllocatorRef allocator,
   CFDictionaryRef poolAttributes,
   CFDictionaryRef openGLBufferAttributes,
   CVOpenGLBufferPoolRef *poolOut
);

Parameters
allocator

The allocator to use for allocating this buffer pool. Pass NULL to specify the default allocator.

poolAttributes

A Core Foundation dictionary containing the attributes to be used for the pool itself.

openGLBufferAttributes

A Core Foundation dictionary containing the attributes to be used for creating new OpenGL buffers within the pool.

poolOut

On return, poolOut points to the new OpenGL buffer pool.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Availability
Declared In
CVOpenGLBufferPool.h

CVOpenGLBufferPoolCreateOpenGLBuffer

Creates a new OpenGL buffer from an OpenGL buffer pool.

CVReturn CVOpenGLBufferPoolCreateOpenGLBuffer (
   CFAllocatorRef allocator,
   CVOpenGLBufferPoolRef openGLBufferPool,
   CVOpenGLBufferRef *openGLBufferOut
);

Parameters
allocator

The allocator to use for creating the buffer. May be NULL to specify the default allocator.

openGLBufferPool

The OpenGL buffer pool that should create the new OpenGL buffer.

openGLBufferOut

On return, OpenGLBufferOut points to the new OpenGL buffer.

Return Value

A Core Video result code. See “Result Codes” for possible values.

Discussion

The function creates a new OpenGL buffer using the OpenGL buffer attributes specified in the CVOpenGLBufferPoolCreate call. This buffer has default attachments as specified in the openGLBufferAttributes parameter of CVOpenGLBufferPoolCreate (using either the kCVBufferPropagatedAttachmentsKey or kCVBufferNonPropagatedAttachmentsKey attributes).

Availability
Declared In
CVOpenGLBufferPool.h

CVOpenGLBufferPoolGetAttributes

Returns the pool attributes dictionary for an Open GL buffer pool.

CFDictionaryRef CVOpenGLBufferPoolGetAttributes (
   CVOpenGLBufferPoolRef pool
);

Parameters
pool

The OpenGL buffer pool to retrieve the attributes from.

Return Value

The buffer-pool attributes Core Foundation dictionary, or NULL on failure.

Availability
Declared In
CVOpenGLBufferPool.h

CVOpenGLBufferPoolGetOpenGLBufferAttributes

Returns the attributes of OpenGL buffers that will be created from a buffer pool.

CFDictionaryRef CVOpenGLBufferPoolGetOpenGLBufferAttributes (
   CVOpenGLBufferPoolRef pool
);

Parameters
pool

The OpenGL buffer pool to retrieve the attributes from.

Return Value

The OpenGL buffer attributes Core Foundation dictionary, or NULL on failure.

Discussion

You can use this function to obtain information about the OpenGL buffers that will be created from the buffer pool.

Availability
Declared In
CVOpenGLBufferPool.h

CVOpenGLBufferPoolGetTypeID

Obtains the Core Foundation ID for the OpenGL buffer pool type.

CFTypeID CVOpenGLBufferPoolGetTypeID (
   void
);

Return Value

The Core Foundation ID for this data type.

Availability
Declared In
CVOpenGLBufferPool.h

CVOpenGLBufferPoolRelease

Releases an OpenGL buffer pool.

void CVOpenGLBufferPoolRelease (
   CVOpenGLBufferPoolRef openGLBufferPool
);

Parameters
openGLBufferPool

The OpenGL buffer pool that you want to release.

Discussion

This function is equivalent to CFRelease, but NULL safe.

Availability
Declared In
CVOpenGLBufferPool.h

CVOpenGLBufferPoolRetain

Retains an OpenGL buffer pool.

CVOpenGLBufferPoolRef CVOpenGLBufferPoolRetain (
   CVOpenGLBufferPoolRef openGLBufferPool
);

Parameters
openGLBufferPool