
Data Transfer
Quadro SDI Output PG-03776-001_v06 | 22
After creating one or more pbuffers using the procedure described in Code Listing 17,
each of these pbuffers must be bound to the video device so that subsequent OpenGL
rendering into that pbuffer is sent to the video output device. Prior to binding the
pbuffer however, it is necessary to identify the video devices available using the
glXGetVideoDeviceNV() function from the GLX_NV_video_out extension.
Code Listing 18: Getting Video Devices Available on a Linux System
GLXVideoDeviceNV video_device;
if (glXGetVideoDeviceNV(dpy, 0, 1, &video_device) {
// Handle error.
}
Once a video device has been identified, bind the application pbuffers using the
glXBindVideoImageNV() command. The final argument to this function must be one of
GLX_VIDEO_OUT_COLOR_NV, GLX_VIDEO_OUT_ALPHA_NV,
GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV
or GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV. This
argument specifies the data within the pbuffer that will ultimately get transferred to the
video out device. In Code Listing 19, the color and alpha portions of the pbuffer
specified by hPbuf are bound to the video device.
Code Listing 19: Binding a Pbuffer to a Linux Video Device
if (glXBindVideoImageNV(dpy, video_device,
pbuffer, GLX_VIDEO_OUT_COLOR_NV)) {
// Handle error.
}
Once the pbuffers are bound to the video device, video transfers can be started as
described in Starting Video Transfers. The procedure for sending frames/fields of data to
the device is described in the section entitled Sending FBO Data and Sending Pbuffer Data.
Comentários a estes Manuais