Mac OS X Reference Library Apple Developer Connection spyglass button

Version: 2.0

Posted: 2009-08-04

Build Requirements: Xcode 3.1.x

Runtime Requirements: Leopard 10.5.x

View Source Code:

Download Sample Code (“QTCoreVideo201.zip”, 479.9K)



Description

Description:

CoreVideo201 is a Cocoa application demonstrating how to render a QuickTime Movie using OpenGL framebuffer object and the Core Video texture pipeline.

This sample is the third in a series of samples demonstrating the synergy between QTKit, CoreVideo, and OpenGL. QTCoreVideo201 previously made use of the classes that were introduced in QTCoreVideo102 sample. However, this is a new version that is different than the original sample. For a list of changes refer to document revision history section on this page.

Usage:

This sample further demonstrates how to render videos, obtained from Core Video texture pipeline, to offscreen draw buffers with the use of framebuffer objects. By capturing images that would normally be drawn to the screen, framebuffer objects can be used to implement a large variety of image filters, and post processing effects. Framebuffer objects may be used in video processing applications for the post-processing of rendered images and composition between different scenes. Additional benefits for using framebuffer objects in video processing is that they're easier to set up than most other methods, they do not require context switching, they're more efficient since resources are shared within the same context, and they're more flexible as one can acquire all depth buffers, stencil buffers, accumulation buffers, etc.

Base Classes:

• OpenGLAnimation - Manages 3D object's rotation and pitch angel.

• OpenGLFBO - Manages OpenGL framebuffer objects.

• OpenGLFBOStatus - Displays framebuffer object status.

• OpenGLIBO - Utility class to acquire an indexed buffer object.

• OpenGLIBOElements - Is a utility class for obtaining parameters from a dictionary and then drawing with DrawElements.

• OpenGLIBOGeometry - Is a utility class for obtaining IBO vertices, colors, texture coordinates, and normals from a dictionary.

• OpenGLIBOIndices - Is a utility class for obtaining IBO indices from a dictionary.

• OpenGLPropertyList - Is a utility class for obtaining dictionary form a property list.

• OpenGLVBOQuad - Allows you to instantiate a VBO based Quad object.

• OpenGLView - Allows you to work with OpenGL views and interact with objects in 3D space.

• QTCVOpenGLController - Request broker between the OpenGL models and the OpenGL views.

• QTVisualContext - Utility class for maintaining Core Video PixelBuffer and Core Video OpenGL textures.

Derived Classes:

• CVFBO - Derived from OpenGLFBO, updates a framebuffer using CV OpenGL opaque texture references.

• CVOpenGLView - Derived from OpenGLView class, adds additional functionality to render video frames into an OpenGL view.

• OpenGLIBORenderer - Derived from OpenGLIBO, is for obtaining from a dictionary and drawing using IBO indices, normals, vertices, and DrawElements parameters.

• OpenGLPixelAttributes - Derived from OpenGLPropertyList, is a utility class for obtaining pixel attributes for a property list.

• OpenGLPixelFormat - Derived from OpenGLPixelAttributes, is a utility class for obtaining a valid pixel format for an OpenGL view.

• OpenGLTeapot - Derived from OpenGLIBORenderer , allows you to instantiate and display an IBO based Teapot object with a texture (bound to its surface).

• QTCVOpenGLView - Derived from CVOpenGLView, concrete view class that renders 3D objects with video frames attached as textures.

This sample is part of the QTCoreVideo group of samples. Also see QTCoreVideo101, QTCoreVideo102, QTCoreVideo103, QTCoreVideo202, and QTCoreVideo301.

Document Revision History

Date Notes
2009-08-04Fullscreen support. Window resizing support. Open panel code for both Leopard and Snow Leopard. Code refactoring of the OpenGL view class. Base framebuffer object class is an abstract class. CoreVideo specialization of the framebuffer object class. Display lists for quads replaced with VBOs. Teapot is now based on IBOs. Teapot IBO is initialized from a property list. OpenGL view pixel formats initialized from a property list. Alert panel class removed. Memory object container class removed. Read me document updated to reflect the new class hierarchy. Credits document updated to reflect the new class hierarchy.
2008-06-06Demonstrates how to render a QuickTime Movie using OpenGL FBO and the Core Video texture pipeline.
Did this document help you? Yes It's good, but... Not helpful...