1Name 2 3 NV_video_output 4 5Name Strings 6 7 GLX_NV_video_out 8 9Contact 10 11 Thomas True, Nvidia, ttrue@nvidia.com 12 Ian Williams, Nvidia, iwilliams@nvidia.com 13 Martin Schwarzer, Nvidia, mschwarzer@nvidia.com 14 Andy Ritger, Nvidia, aritger@nvidia.com 15 16Status 17 18 Shipping since 2004 for NVIDIA Quadro SDI (Serial Digital Interface) 19 20Version 21 Last Modified: 2014/06/04 22 NVIDIA Revision: 8 23 24Number 25 26 348 27 28Dependencies 29 30 OpenGL 1.1 is required. 31 GLX 1.3 is required. 32 33Overview 34 35 This extension permits a color and or depth buffer of a pbuffer to 36 be used for rendering and subsequent video output. After a pbuffer 37 has been bound to a video device, subsequent color and or depth 38 rendering into that buffer may be displayed on the video output. 39 40 This is intended for use with NVIDIA products such as the Quadro FX 41 4000 SDI. 42 43Issues 44 45 1. Should the new pbuffer attributes be available through GL queries? 46 47 No, like other pbuffer attributes you need to query them through the 48 window system extension. This extension does not make any changes to 49 OpenGL. 50 51 2. Should glXSendPbufferToVideoNV require that the pbuffer be current? 52 53Implementation Notes 54 55 1. Any created pbuffers must be the same resolution as that specified 56 by the state of the video output device. The current state of the 57 video output device can be queried via the NV-CONTROL X extension. 58 59 2. Applications may use a single pbuffer or a collection of pbuffers 60 to send frames/fields to a video device. In the first case, an 61 application should block on the call to glXSendPbufferToVideoNV() to 62 ensure synchronization. In the second case, an application should 63 utilize glXGetVideoInfoNV() in order to query vblank and 64 buffer counters for synchronization. 65 66Intended Usage 67 68 1) Configure the video output device via the NV-CONTROL X extension. 69 70 2) Use glXGetFBConfigs or glXChooseFBConfig to find a suitable 71 FBConfig for rendering images. GLX_DRAWABLE_TYPE must have 72 GLX_PBUFFER_BIT set. The per-component pixel depth of the pbuffer 73 must be equal to or greater than the per-component depth of the 74 video output. 75 76 3) Create a GLXPbuffer for each stream of video by calling 77 glXCreatePbuffer. Set the width and height for each GLXPbuffer 78 to match that of the intended video output device. 79 80 4) Call glXGetVideoDeviceNV to retrieve the handles for all 81 video devices available. A video device handle is required 82 for each video stream. glXGetVideoDeviceNV will lock the 83 video device for exclusive use by this GLX client. The NV-CONTROL 84 X extension will not be able to update video out attributes until 85 the video device is released with glXReleaseVideoDeviceNV. 86 87 5) Call glXBindVideoImageNV to bind each GLXPbuffer to a 88 corresponding video device handle. Multiple pbuffers can 89 be bound, at the same time, to the same video device. 90 91 6) Render the current frame/field for each stream to one of the bound 92 GLXPbuffers. Once rendering is complete, call 93 glXSendPbufferToVideoNV to send each frame/field to the video 94 device. 95 96 7) Render subsequent video frames or fields calling 97 glXSendPbufferToVideoNV() at the completion of rendering for 98 each frame/field. 99 100 8) Call glXReleaseVideoImageNV to unbind each GLXPbuffer 101 from its associated video device. 102 103 9) Call glXReleaseVideoDeviceNV to release the video device. 104 105New Types 106 107 /* 108 * GLXVideoDeviceNV is an opaque handle to a video device. 109 */ 110 typedef unsigned int GLXVideoDeviceNV; 111 112 113New Procedures and Functions 114 115 int glXGetVideoDeviceNV(Display *dpy, int screen, int numVideoDevices, 116 GLXVideoDeviceNV *pVideoDevice); 117 118 int glXReleaseVideoDeviceNV(Display *dpy, int screen, 119 GLXVideoDeviceNV VideoDevice); 120 121 int glXBindVideoImageNV(Display *dpy, GLXVideoDeviceNV VideoDevice, 122 GLXPbuffer pbuf, int iVideoBuffer); 123 124 int glXReleaseVideoImageNV(Display *dpy, GLXPbuffer pbuf); 125 126 int glXSendPbufferToVideoNV(Display *dpy, GLXPbuffer pbuf, 127 int iBufferType, 128 unsigned long *pulCounterPbuffer, 129 GLboolean bBlock); 130 131 int glXGetVideoInfoNV(Display *dpy, int screen, 132 GLXVideoDeviceNV VideoDevice, 133 unsigned long *pulCounterOutputPbuffer, 134 unsigned long *pulCounterOutputVideo); 135 136New Tokens 137 138 Accepted by the <iVideoBuffer> parameter of glXBindVideoImageNV: 139 140 GLX_VIDEO_OUT_COLOR_NV 0x20C3 141 GLX_VIDEO_OUT_ALPHA_NV 0x20C4 142 GLX_VIDEO_OUT_DEPTH_NV 0x20C5 143 GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 144 GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 145 146 Accepted by the <iBufferType> parameter of glXSendPbufferToVideoNV: 147 148 GLX_VIDEO_OUT_FRAME_NV 0x20C8 149 GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 150 GLX_VIDEO_OUT_FIELD_2_NV 0x20CA 151 GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB 152 GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC 153 154Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) 155 156 None. 157 158Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 159 160 None. 161 162Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 163Operations and the Frame Buffer) 164 165 None. 166 167Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 168 169 None. 170 171Additions to Chapter 6 of the OpenGL 1.2.1 Specification (State and State 172Requests) 173 174 None. 175 176 177Additions to the GLX 1.3 Specification 178 179 [Add new section, Video Out] 180 181 Video out functions permit color and depth buffers from a 182 pbuffer to be sent to a video output device. 183 184 The command 185 186 int glXGetVideoDeviceNV(Display *dpy, int screen, int numVideoDevices, 187 GLXVideoDeviceNV *pVideoDevice); 188 189 fills in the array <pVideoDevice> with up to <numVideoDevices> 190 handles to the available video devices. <numVideoDevices> must be 191 non-negative, and <pVideoDevice> must not be NULL. 192 193 It is not an error if the number of available video devices is larger 194 that <numVideoDevices>; in that case the first <numVideoDevices> 195 device handles are returned. It is an error if <numVideoDevices> 196 is larger than the number of available video devices. The order of 197 devices returned in <pVideoDevice> is implementation dependent. 198 199 If glXGetVideoDeviceNV succeeds, 0 is returned. Otherwise, a non-zero 200 error code is returned. 201 202 203 The command 204 205 int glXReleaseVideoDeviceNV(Display *dpy, int screen, 206 GLXVideoDeviceNV VideoDevice); 207 208 releases all resources associated with <VideoDevice>. 209 210 If glXReleaseVideoDeviceNV succeeds, 0 is returned. Otherwise, 211 a non-zero error code is returned. 212 213 214 The command 215 216 int glXBindVideoImageNV(Display *dpy, GLXVideoDeviceNV VideoDevice, 217 GLXPbuffer pbuf, int iVideoBuffer); 218 219 binds <pbuf> to <VideoDevice> for subsequent scanout where 220 <iVideoBuffer> specifies that <pbuf> contains color, alpha and/or 221 depth data. Valid values for <iVideoBuffer> are: 222 223 GLX_VIDEO_OUT_COLOR_NV 0x20C3 224 GLX_VIDEO_OUT_ALPHA_NV 0x20C4 225 GLX_VIDEO_OUT_DEPTH_NV 0x20C5 226 GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 227 GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 228 229 <pbuf> cannot be None, and <VideoDevice> must be a VideoDevice 230 returned by glXGetVideoDeviceNV(). 231 232 233 A pbuffer can only be bound to one GLXVideoDeviceNV at a time. 234 If <pbuf> is already bound to a different GLXVideoDeviceNV, then 235 glXBindVideoImageNV will fail. 236 237 238 If glXBindVideoImageNV succeeds, 0 is returned. Otherwise, 239 a non-zero error code is returned. 240 241 242 The command 243 244 int glXReleaseVideoImageNV(Display *dpy, GLXPbuffer pbuf); 245 246 releases <pbuf> from a previously bound video device. <pbuf> may 247 not be None. 248 249 If glXReleaseVideoImageNV succeeds, 0 is returned. Otherwise, 250 a non-zero error code is returned. 251 252 253 The command 254 255 int glXSendPbufferToVideoNV(Display *dpy, GLXPbuffer pbuf, 256 int iBufferType, 257 unsigned long *pulCounterPbuffer, 258 Bool bBlock); 259 260 indicates that rendering to the <pbuf> is complete and that the 261 completed frame/field contained with <pbuf> is ready for scan out by 262 the video device where <iBufferType> specifies that <pbuf> contains 263 the first field, second field or a complete frame. Valid values 264 for <iBufferType> are: 265 266 GLX_VIDEO_OUT_FRAME_NV 0x20C8 267 GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 268 GLX_VIDEO_OUT_FIELD_2_NV 0x20CA 269 270 The color buffer controlled by glReadBuffer is used as the color 271 buffer input to glXSendPbufferToVideoNV(). <pbuf> cannot be None. 272 The <bBlock> argument specifies whether or not the call should 273 block until scan out of the specified frame/field is complete. 274 <pulCounterPbuffer> returns the total number of frames/fields sent 275 to the video device. 276 277 If glXSendPbufferToVideoNV succeeds, 0 is returned. Otherwise, 278 a non-zero error code is returned. 279 280 281 The command 282 283 int glXGetVideoInfoNV(GLXVideoDeviceNV VideoDevice, 284 unsigned long *pulCounterOutputPbuffer, 285 unsigned long *pulCounterOutputVideo); 286 287 returns in <pulCounterOutputVideo> the absolute count of vertical 288 blanks on <VideoDevice> since transfers were started while 289 <pulCounterOutputPbuffer> returns the count of the current pbuffer 290 being scanned out by <VideoDevice>. 291 292 If glXGetVideoInfoNV succeeds, 0 is returned. Otherwise, a non-zero 293 error code is returned. 294 295 296GLX Protocol 297 298 Six new GLX protocol commands are added. 299 300 GetVideoDeviceNV 301 1 CARD8 opcode (X assigned) 302 1 17 GLX opcode (glXVendorPrivateWithReply) 303 2 5 request length 304 4 1313 vendor specific opcode 305 4 unused 306 4 CARD32 num_devices 307 4 CARD32 screen 308 => 309 1 CARD8 reply 310 1 unused 311 2 CARD16 sequence number 312 4 n reply length 313 4 CARD32 status 314 4 CARD32 num_devices 315 16 unused 316 4 * n CARD32 video_device handles 317 318 Where n is the number of device handles returned. 319 320 321 ReleaseVideoDeviceNV 322 1 CARD8 opcode (X assigned) 323 1 17 GLX opcode (glXVendorPrivateWithReply) 324 2 5 request length 325 4 1314 vendor specific opcode 326 4 unused 327 4 CARD32 video_device 328 4 CARD32 screen 329 => 330 1 CARD8 reply 331 1 unused 332 2 CARD16 sequence number 333 4 0 reply length 334 4 CARD32 status 335 20 unused 336 337 338 BindVideoImageNV 339 1 CARD8 opcode (X assigned) 340 1 17 GLX opcode (glXVendorPrivateWithReply) 341 2 6 request length 342 4 1315 vendor specific opcode 343 4 unused 344 4 GLX_PBUFFER pbuffer 345 4 CARD32 video_device 346 4 CARD32 video_buffer 347 => 348 1 CARD8 reply 349 1 unused 350 2 CARD16 sequence number 351 4 0 reply length 352 4 CARD32 status 353 20 unused 354 355 356 ReleaseVideoImageNV 357 1 CARD8 opcode (X assigned) 358 1 17 GLX opcode (glXVendorPrivateWithReply) 359 2 4 request length 360 4 1316 vendor specific opcode 361 4 GLX_PBUFFER pbuffer 362 => 363 1 CARD8 reply 364 1 unused 365 2 CARD16 sequence number 366 4 0 reply length 367 4 CARD32 status 368 20 unused 369 370 371 SendPbufferToVideoNV 372 1 CARD8 opcode (X assigned) 373 1 17 GLX opcode (glXVendorPrivateWithReply) 374 2 6 request length 375 4 1317 vendor specific opcode 376 4 unused 377 4 GLX_PBUFFER pbuffer 378 4 CARD32 buffer_type 379 1 BOOL block 380 1 unused 381 2 unused 382 => 383 1 CARD8 reply 384 1 unused 385 2 CARD16 sequence number 386 4 0 reply length 387 4 CARD32 status 388 4 CARD32 counter_pbuffer 389 16 unused 390 391 392 GetVideoInfoNV 393 1 CARD8 opcode (X assigned) 394 1 17 GLX opcode (glXVendorPrivateWithReply) 395 2 5 request length 396 4 1318 vendor specific opcode 397 4 CARD32 screen 398 4 CARD32 video_device 399 => 400 1 CARD8 reply 401 1 unused 402 2 CARD16 sequence number 403 4 0 reply length 404 4 CARD32 status 405 4 CARD32 counter_video 406 4 CARD32 counter_pbuffer 407 12 unused 408 409New State 410 411 None 412 413New Implementation Dependent State 414 415 None 416 417History 418 419 Revision 8, June 4, 2014 (jajones) 420 - Fix extension string to match implementation. 421 422 Revision 7, February 6, 2013 (pbrown) 423 - Fix GLX protocol section to remove the duplicate 424 opcode and match the implementation. 425 426 Revision 6, February 20, 2008 427 - Internal revisions. 428 429