| Framework | /System/Library/Frameworks/InstantMessage.framework |
| Declared in | InstantMessage/IMAVManager.h |
| Companion guide |
IMVideoDataSource is an informal protocol that an IMAVManager data source must conform to in order to provide video data to iChat AV.
To provide video when the CVPixelBuffer representation is preferred, the data source must implement both the getPixelBufferPixelFormat: and renderIntoPixelBuffer:forTime: methods. Otherwise, to provide video when the CVOpenGLBuffers representation is preferred, the data source must implement both the getOpenGLBufferContext:pixelFormat: and renderIntoOpenGLBuffer:onScreen:forTime: methods.
Returns the pixel OpenGL buffer context and pixel format.
- (void)getOpenGLBufferContext:(CGLContextObj *)contextOut pixelFormat:(CGLPixelFormatObj *)pixelFormatOut
The OpenGL context to be used for the CVOpenGLBufferRef instances passed to the renderIntoOpenGLBuffer:onScreen:forTime: method.
The OpenGL pixel format to be used for the CVOpenGLBufferRef instances passed to the renderIntoOpenGLBuffer:onScreen:forTime: method.
This method is invoked once after setVideoDataSource: is sent to an IMAVManager object.
Returns the pixel buffer format.
- (void)getPixelBufferPixelFormat:(OSType *)pixelFormatOut
The pixel format to be used for the CVPixelBufferRef instances passed to the renderIntoPixelBuffer:forTime: method.
This method is invoked once after setVideoDataSource: is sent to an IMAVManager object.
Provides data for the next video frame using OpenGL buffering.
- (BOOL)renderIntoOpenGLBuffer:(CVOpenGLBufferRef)buffer onScreen:(int *)screenInOut forTime:(CVTimeStamp *)timeStamp
The OpenGL buffer to fill. The receiver should call the CVOpenGLBufferAttach function and then fill the buffer with video data.
The recommended virtual screen number to pass to the CVOpenGLBufferAttach function for maximum efficiency. The receiver may use a different screen number, but it must write that value back into screenInOut before returning.
The frame time for which the buffer should be rendered.
You should render a video frame that corresponds to the supplied host time, timeStamp->hostTime, and before returning from this method, change the host time to the earliest time for which the rendered video is valid. For example, if the content is a movie, then set the host time to correspond to the rendered frame—typically, slightly earlier than the original host time. If the content is a photo slideshow, then set the host time to the time the image first appeared which can be several seconds before the original host time. Adjusting the time this way helps synchronize the audio with the video track.
Returns YES if the buffer is successfully filled with new frame data. Returns NO if nothing changed or an error was encountered.
This method is invoked each time a frame is sent to iChat AV. This method is not invoked on the main thread.
Provides data for the next video frame using pixel buffering.
- (BOOL)renderIntoPixelBuffer:(CVPixelBufferRef)buffer forTime:(CVTimeStamp *)timeStamp
The pixel buffer to fill with video data. The dimensions can vary. Use the CVPixelBufferGetWidth and CVPixelBufferGetHeight functions to get the dimensions each time this method is invoked.
The frame time for which the buffer should be rendered.
You should render a video frame that corresponds to the supplied host time, timeStamp->hostTime, and before returning from this method, change the host time to the earliest time for which the rendered video is valid. For example, if the content is a movie, then set the host time to correspond to the rendered frame—typically, slightly earlier than the original host time. If the content is a photo slideshow, then set the host time to the time the image first appeared which can be several seconds before the original host time. Adjusting the time this way helps synchronize the audio with the video track.
Returns YES if the buffer is successfully filled with new frame data. Returns NO if nothing changed or an error was encountered.
This method is invoked each time a frame is sent to iChat AV. This method is not invoked on the main thread.
Last updated: 2007-07-08