15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_video_capture 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_video_capture 85bd8deadSopenharmony_ci GLX_NV_video_capture 95bd8deadSopenharmony_ci WGL_NV_video_capture 105bd8deadSopenharmony_ciContributors 115bd8deadSopenharmony_ci 125bd8deadSopenharmony_ci James Jones 135bd8deadSopenharmony_ci Robert Morell 145bd8deadSopenharmony_ci Andy Ritger 155bd8deadSopenharmony_ci Antonio Tejada 165bd8deadSopenharmony_ci Thomas True 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciContact 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci James Jones, NVIDIA Corporation (jajones 'at' nvidia.com) 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciStatus 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Complete. Shipping in NVIDIA 190.XX drivers 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ciVersion 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci Last Modified Date: Jul 8, 2011 295bd8deadSopenharmony_ci Author Revision: 24 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciNumber 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci 374 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ciDependencies 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci OpenGL 2.0 is required. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci ARB_vertex_buffer_object is required. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci EXT_framebuffer_object is required. 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci EXT_timer_query is required for 64-bit integer type definitions 445bd8deadSopenharmony_ci only. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci NV_present_video is required for the definition of the FRAME_NV 475bd8deadSopenharmony_ci token and the wglQueryCurrentContextNV function only. 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci Written based on the wording of the OpenGL 3.0 specification. 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ciOverview 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci This extension provides a mechanism for streaming video data 545bd8deadSopenharmony_ci directly into texture objects and buffer objects. Applications can 555bd8deadSopenharmony_ci then display video streams in interactive 3D scenes and/or 565bd8deadSopenharmony_ci manipulate the video data using the GL's image processing 575bd8deadSopenharmony_ci capabilities. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ciNew Procedures and Functions 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci void BeginVideoCaptureNV(uint video_capture_slot); 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci void BindVideoCaptureStreamBufferNV(uint video_capture_slot, 645bd8deadSopenharmony_ci uint stream, enum frame_region, 655bd8deadSopenharmony_ci intptrARB offset); 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci void BindVideoCaptureStreamTextureNV(uint video_capture_slot, 685bd8deadSopenharmony_ci uint stream, enum frame_region, 695bd8deadSopenharmony_ci enum target, uint texture); 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci void EndVideoCaptureNV(uint video_capture_slot); 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci void GetVideoCaptureivNV(uint video_capture_slot, enum pname, 745bd8deadSopenharmony_ci int *params); 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ci void GetVideoCaptureStream{i,f,d}vNV(uint video_capture_slot, 775bd8deadSopenharmony_ci uint stream, enum pname, 785bd8deadSopenharmony_ci T *params); 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci enum VideoCaptureNV(uint video_capture_slot, uint *sequence_num, 815bd8deadSopenharmony_ci uint64EXT *capture_time); 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci void VideoCaptureStreamParameter{i,f,d}vNV(uint video_capture_slot, 845bd8deadSopenharmony_ci uint stream, 855bd8deadSopenharmony_ci GLenum pname, 865bd8deadSopenharmony_ci const T *params); 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci int glXBindVideoCaptureDeviceNV(Display *dpy, 905bd8deadSopenharmony_ci unsigned int video_capture_slot, 915bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV device); 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV * 945bd8deadSopenharmony_ci glXEnumerateVideoCaptureDevicesNV(Display *dpy, int screen, 955bd8deadSopenharmony_ci int *nelements); 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci void glXLockVideoCaptureDeviceNV(Display *dpy, 985bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV device); 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci int glXQueryVideoCaptureDeviceNV(Display *dpy, 1015bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV device, 1025bd8deadSopenharmony_ci int attribute, int *value); 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci void glXReleaseVideoCaptureDeviceNV(Display *dpy, 1055bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV device); 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci BOOL wglBindVideoCaptureDeviceNV(UINT uVideoSlot, 1095bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV hDevice); 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci UINT wglEnumerateVideoCaptureDevicesNV(HDC hDc, 1125bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV *phDeviceList); 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci BOOL wglLockVideoCaptureDeviceNV(HDC hDc, 1155bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV hDevice); 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci BOOL wglQueryVideoCaptureDeviceNV(HDC hDc, 1185bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV hDevice, 1195bd8deadSopenharmony_ci int iAttribute, int *piValue); 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci BOOL wglReleaseVideoCaptureDeviceNV(HDC hDc, 1225bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV hDevice); 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ciNew Types 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci typedef XID GLXVideoCaptureDeviceNV 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci DECLARE_HANDLE(HVIDEOINPUTDEVICENV); 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ciNew Tokens 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci Accepted by the <target> parameters of BindBufferARB, BufferDataARB, 1335bd8deadSopenharmony_ci BufferSubDataARB, MapBufferARB, UnmapBufferARB, GetBufferSubDataARB, 1345bd8deadSopenharmony_ci GetBufferParameterivARB, and GetBufferPointervARB: 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci VIDEO_BUFFER_NV 0x9020 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 1395bd8deadSopenharmony_ci GetFloatv, and GetDoublev: 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci VIDEO_BUFFER_BINDING_NV 0x9021 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci Accepted by the <frame_region> parameter of 1445bd8deadSopenharmony_ci BindVideoCaptureStreamBufferNV, and BindVideoCaptureStreamTextureNV: 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci FIELD_UPPER_NV 0x9022 1475bd8deadSopenharmony_ci FIELD_LOWER_NV 0x9023 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetVideoCaptureivNV: 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 1525bd8deadSopenharmony_ci NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci Accepted by the <pname> parameter of 1555bd8deadSopenharmony_ci GetVideoCaptureStream{i,f,d}vNV: 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 1585bd8deadSopenharmony_ci VIDEO_BUFFER_PITCH_NV 0x9028 1595bd8deadSopenharmony_ci VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 1605bd8deadSopenharmony_ci VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 1615bd8deadSopenharmony_ci VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A 1625bd8deadSopenharmony_ci VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B 1635bd8deadSopenharmony_ci VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci Accepted by the <pname> parameter of 1665bd8deadSopenharmony_ci GetVideoCaptureStream{i,f,d}vNV and as the <pname> parameter of 1675bd8deadSopenharmony_ci VideoCaptureStreamParameter{i,f,d}vNV: 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 1705bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MAX_NV 0x902A 1715bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MIN_NV 0x902B 1725bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C 1735bd8deadSopenharmony_ci VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D 1745bd8deadSopenharmony_ci VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci Returned by VideoCaptureNV: 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci PARTIAL_SUCCESS_NV 0x902E 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci Returned by VideoCaptureNV and GetVideoCaptureStream{i,f,d}vNV 1815bd8deadSopenharmony_ci when <pname> is LAST_VIDEO_CAPTURE_STATUS_NV: 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ci SUCCESS_NV 0x902F 1845bd8deadSopenharmony_ci FAILURE_NV 0x9030 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci Accepted in the <params> parameter of 1875bd8deadSopenharmony_ci VideoCaptureStreamParameter{i,f,d}vNV when <pname> is 1885bd8deadSopenharmony_ci VIDEO_BUFFER_INTERNAL_FORMAT_NV and returned by 1895bd8deadSopenharmony_ci GetVideoCaptureStream{i,f,d}vNV when <pname> is 1905bd8deadSopenharmony_ci VIDEO_BUFFER_INTERNAL_FORMAT_NV: 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci YCBYCR8_422_NV 0x9031 1935bd8deadSopenharmony_ci YCBAYCR8A_4224_NV 0x9032 1945bd8deadSopenharmony_ci Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 1955bd8deadSopenharmony_ci Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 1965bd8deadSopenharmony_ci Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 1975bd8deadSopenharmony_ci Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 1985bd8deadSopenharmony_ci Z4Y12Z4CB12Z4CR12_444_NV 0x9037 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci Accepted in the attribute list of the GLX reply to the 2015bd8deadSopenharmony_ci glXEnumerateVideoCaptureDevicesNV command: 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci GLX_DEVICE_ID_NV 0x20CD 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ci Accepted by the <attribute> parameter of glXQueryContext: 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci Accepted by the <attribute> parameter of 2105bd8deadSopenharmony_ci glXQueryVideoCaptureDeviceNV: 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci GLX_UNIQUE_ID_NV 0x20CE 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci Accepted by the <iAttribute> parameter of wglQueryCurrentContextNV: 2155bd8deadSopenharmony_ci 2165bd8deadSopenharmony_ci WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF 2175bd8deadSopenharmony_ci 2185bd8deadSopenharmony_ci Accepted by the <iAttribute> parameter of 2195bd8deadSopenharmony_ci wglQueryVideoCaptureDeviceNV: 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci WGL_UNIQUE_ID_NV 0x20CE 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.1 Specification (OpenGL Operation) 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci 2275bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.1 Specification (Rasterization) 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.1 Specification (Per-Fragment 2315bd8deadSopenharmony_ciOperations and the Frame Buffer) 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci Add a new section after Section 4.4 and, if NV_present_video is 2345bd8deadSopenharmony_ci present, before Section 4.5 "Displaying Buffers." 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci "Section 4.5, Video Capture 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci "Video capture can be used to transfer pixels from a video input 2395bd8deadSopenharmony_ci device to textures or buffer objects. Video input devices are 2405bd8deadSopenharmony_ci accessed by binding them to a valid video capture slot in a context 2415bd8deadSopenharmony_ci using window-system specific functions. Valid video capture slots 2425bd8deadSopenharmony_ci are unsigned integers in the range 1 to the implementation dependent 2435bd8deadSopenharmony_ci maximum number of slots, inclusive. Trying to perform video 2445bd8deadSopenharmony_ci capture operations on an invalid video capture slot or a video 2455bd8deadSopenharmony_ci capture slot with no device bound to it will generate 2465bd8deadSopenharmony_ci INVALID_OPERATION. 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci "The values captured can be transformed by a fixed-function color 2495bd8deadSopenharmony_ci conversion pipeline before they are written to the destination. 2505bd8deadSopenharmony_ci Each video input device can have an implementation-dependent number 2515bd8deadSopenharmony_ci of input streams associated with it. Pixels are transferred from 2525bd8deadSopenharmony_ci all streams on a device simultaneously. 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci "Video capture can be started and stopped on a specified video 2555bd8deadSopenharmony_ci capture slot with the commands 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci void BeginVideoCaptureNV(uint video_capture_slot) 2585bd8deadSopenharmony_ci 2595bd8deadSopenharmony_ci and 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci void EndVideoCaptureNV(uint video_capture_slot) 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ci respectively. After BeginVideoCaptureNV is called, the capture 2645bd8deadSopenharmony_ci device bound to <video_capture_slot> will begin filling a queue of 2655bd8deadSopenharmony_ci raw buffers with incoming video data. If capture is already in the 2665bd8deadSopenharmony_ci requested state, INVALID_OPERATION is generated. 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ci "To move data from the raw buffers into the GL, buffer objects or 2695bd8deadSopenharmony_ci textures must be bound to the individual video capture streams. A 2705bd8deadSopenharmony_ci video capture stream refers to a single video source. Each video 2715bd8deadSopenharmony_ci capture slot must provide one or more video capture streams. 2725bd8deadSopenharmony_ci Streams are referred to by their index, starting from zero. If an 2735bd8deadSopenharmony_ci invalid stream index is specified, INVALID_VALUE is generated. 2745bd8deadSopenharmony_ci 2755bd8deadSopenharmony_ci Buffer objects or textures can be bound to streams using the 2765bd8deadSopenharmony_ci commands 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci void BindVideoCaptureStreamBufferNV(uint video_capture_slot, 2795bd8deadSopenharmony_ci uint stream, 2805bd8deadSopenharmony_ci enum frame_region, 2815bd8deadSopenharmony_ci intptrARB offset); 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci or 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci void BindVideoCaptureStreamTextureNV(uint video_capture_slot, 2865bd8deadSopenharmony_ci uint stream, 2875bd8deadSopenharmony_ci enum frame_region, 2885bd8deadSopenharmony_ci enum target, uint texture); 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci where <stream> is the index of the stream to bind the object to and 2915bd8deadSopenharmony_ci <frame_region> is the spatial region of the frame, specified 2925bd8deadSopenharmony_ci by one of FRAME_NV, FIELD_UPPER_NV, or FIELD_LOWER_NV. If 2935bd8deadSopenharmony_ci FIELD_UPPER_NV and FIELD_LOWER_NV are used, two objects must be 2945bd8deadSopenharmony_ci bound to the stream; one for the upper field and one for the lower 2955bd8deadSopenharmony_ci field. If only one field is bound at capture time, 2965bd8deadSopenharmony_ci INVALID_OPERATION is generated. 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ci "For buffer object capture, the buffer bound to the 2995bd8deadSopenharmony_ci VIDEO_BUFFER_NV target is used. An offset into the buffer object 3005bd8deadSopenharmony_ci can be specified using the <offset> parameter. The offset provided 3015bd8deadSopenharmony_ci must be a multiple of the size, in bytes, of a pixel in the internal 3025bd8deadSopenharmony_ci format specified for this stream or INVALID_VALUE will be generated 3035bd8deadSopenharmony_ci at frame capture time. To unbind a buffer object from a video 3045bd8deadSopenharmony_ci capture stream region, bind buffer object 0 to the region. The 3055bd8deadSopenharmony_ci internal format of the pixel data stored in the buffer object can be 3065bd8deadSopenharmony_ci specified using the VideoCaptureStreamParameter functions described 3075bd8deadSopenharmony_ci below, with <pname> set to VIDEO_BUFFER_INTERNAL_FORMAT_NV and 3085bd8deadSopenharmony_ci <params> set to a color-renderable internal format (as defined in 3095bd8deadSopenharmony_ci section 4.4.4), or one of the Y'CbCr/Y'CbCrA formats defined in 3105bd8deadSopenharmony_ci table 4.13. Specifying other internal formats will generate 3115bd8deadSopenharmony_ci INVALID_ENUM. 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci Element Meaning Format 3145bd8deadSopenharmony_ci Format Name and Order Layout 3155bd8deadSopenharmony_ci ---------------------------------------- ---------------- ------- 3165bd8deadSopenharmony_ci YCBYCR8_422_NV Y'0, Cb, Y'1, Cr 4:2:2 3175bd8deadSopenharmony_ci 3185bd8deadSopenharmony_ci YCBAYCRA8_4224_NV Y'0, Cb, A0, 4:2:2:4 3195bd8deadSopenharmony_ci Y'1, Cr, A1 3205bd8deadSopenharmony_ci 3215bd8deadSopenharmony_ci Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 6 zero bits, Y'0, 4:2:2 3225bd8deadSopenharmony_ci 6 zero bits, Cb, 3235bd8deadSopenharmony_ci 6 zero bits, Y'1, 3245bd8deadSopenharmony_ci 6 zero bits, Cr 3255bd8deadSopenharmony_ci 3265bd8deadSopenharmony_ci Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 6 zero bits, Y'0, 4:2:2:4 3275bd8deadSopenharmony_ci 6 zero bits, Cb, 3285bd8deadSopenharmony_ci 6 zero bits, A0, 3295bd8deadSopenharmony_ci 6 zero bits, Y'1, 3305bd8deadSopenharmony_ci 6 zero bits, Cr, 3315bd8deadSopenharmony_ci 6 zero bits, A1 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 4 zero bits, Y'0, 4:2:2 3345bd8deadSopenharmony_ci 4 zero bits, Cb, 3355bd8deadSopenharmony_ci 4 zero bits, Y'1, 3365bd8deadSopenharmony_ci 4 zero bits, Cr 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 4 zero bits, Y'0, 4:2:2:4 3395bd8deadSopenharmony_ci 4 zero bits, Cb, 3405bd8deadSopenharmony_ci 4 zero bits, A0, 3415bd8deadSopenharmony_ci 4 zero bits, Y'1, 3425bd8deadSopenharmony_ci 4 zero bits, Cr, 3435bd8deadSopenharmony_ci 4 zero bits, A1 3445bd8deadSopenharmony_ci 3455bd8deadSopenharmony_ci Z4Y12Z4CB12Z4CR12_444_NV 4 zero bits, Y', 4:4:4 3465bd8deadSopenharmony_ci 4 zero bits, Cb, 3475bd8deadSopenharmony_ci 4 zero bits, Cr 3485bd8deadSopenharmony_ci 3495bd8deadSopenharmony_ci Table 4.13 - Video capture buffer internal formats 3505bd8deadSopenharmony_ci 3515bd8deadSopenharmony_ci "For texture object capture, the texture named <texture> on <target> 3525bd8deadSopenharmony_ci is used. The internal format of the texture must be color- 3535bd8deadSopenharmony_ci renderable as defined in section 4.4.4 at capture time, or 3545bd8deadSopenharmony_ci INVALID_OPERATION is generated. Only 2D textures can be used as 3555bd8deadSopenharmony_ci video capture destinations. If <target> is not TEXTURE_2D or 3565bd8deadSopenharmony_ci TEXTURE_RECTANGLE, INVALID_OPERATION is generated. If <target> 3575bd8deadSopenharmony_ci does not refer to a texture target supported by the current context, 3585bd8deadSopenharmony_ci INVALID_ENUM is generated. To unbind a texture from a video capture 3595bd8deadSopenharmony_ci stream region without binding a new one, bind texture 0 to the 3605bd8deadSopenharmony_ci region. If <texture> is non-zero and does not name an existing 3615bd8deadSopenharmony_ci texture object, INVALID_VALUE is generated. 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci "Captured video data will have 2, 3, or 4 components per pixel. The 3645bd8deadSopenharmony_ci number of components and their layout is determined based on the 3655bd8deadSopenharmony_ci format of the data output by the video capture device. This may 3665bd8deadSopenharmony_ci differ from the data format of the data received by the video 3675bd8deadSopenharmony_ci capture device if it has internal data format conversion hardware. 3685bd8deadSopenharmony_ci For example, if the device is configured to resample data with a 3695bd8deadSopenharmony_ci 4:2:2 layout up to a 4:4:4:4 layout, the effective format is 3705bd8deadSopenharmony_ci 4:4:4:4. If the formats in table 4.13 are used, the format layout 3715bd8deadSopenharmony_ci must be compatible with the format of the captured data, as defined 3725bd8deadSopenharmony_ci in table 4.14, or INVALID_ENUM is generated. Compatibility with 3735bd8deadSopenharmony_ci 4:2:2 and 4:2:2:4 capture format layouts can be queried using the 3745bd8deadSopenharmony_ci GetVideoCaptureStream{i,f,d}vNV commands with <pname> set to 3755bd8deadSopenharmony_ci VIDEO_CAPTURE_TO_422_SUPPORTED_NV as described below. 3765bd8deadSopenharmony_ci 3775bd8deadSopenharmony_ci Effective Compatible 3785bd8deadSopenharmony_ci Format Layout Capture Format Layouts 3795bd8deadSopenharmony_ci ------------- ---------------------- 3805bd8deadSopenharmony_ci 4:2:2 4:2:2, 4:2:2:4 3815bd8deadSopenharmony_ci 4:2:2:4 4:2:2, 4:2:2:4 3825bd8deadSopenharmony_ci 4:4:4 4:4:4, 4:4:4:4 3835bd8deadSopenharmony_ci 4:4:4:4 4:4:4, 4:4:4:4 3845bd8deadSopenharmony_ci 3855bd8deadSopenharmony_ci Table 4.14 - Compatible format layouts. 3865bd8deadSopenharmony_ci 3875bd8deadSopenharmony_ci "If the effective capture data format is 4:2:2, there will be 2 3885bd8deadSopenharmony_ci components per pixel. If capturing to a format from table 4.13, it 3895bd8deadSopenharmony_ci will take two incoming pixels to make up one pixel group referred to 3905bd8deadSopenharmony_ci by the destination layout. The first pixel's components 1 and 2 will 3915bd8deadSopenharmony_ci be written to the destination pixel group's Y'0 and Cb components. 3925bd8deadSopenharmony_ci The second pixel's components 1 and 2 will be written to the 3935bd8deadSopenharmony_ci destination pixel group's Y'1 and Cr components. Otherwise, the 3945bd8deadSopenharmony_ci captured pixel's components 1 and 2 will be written to the 3955bd8deadSopenharmony_ci destination R and G components respectively and there is no concept 3965bd8deadSopenharmony_ci of pixel groups. If the effective capture data format is 4:4:4, 3975bd8deadSopenharmony_ci there will be 3 components per pixel. If capturing to a format from 3985bd8deadSopenharmony_ci table 4.13, the captured components 1, 2, and 3 will be written to 3995bd8deadSopenharmony_ci the Y', Cb, and Cr components respectively. Otherwise the components 4005bd8deadSopenharmony_ci 1, 2, and 3 will be written to the destination R, G, and B components 4015bd8deadSopenharmony_ci respectively. If the effective capture data format is 4:2:2:4 or 4025bd8deadSopenharmony_ci 4:4:4:4, the mapping will be the same as that of 4:2:2 or 4:4:4 4035bd8deadSopenharmony_ci respectively, but the final component will always be stored in the 4045bd8deadSopenharmony_ci destination A or A' component. If the destination format does not 4055bd8deadSopenharmony_ci contain a component used by the mapping above, the source's 4065bd8deadSopenharmony_ci corresponding component will be ignored. If the destination has 4075bd8deadSopenharmony_ci components not mentioned in the mapping above for the current 4085bd8deadSopenharmony_ci effective capture data format, the value in those components will be 4095bd8deadSopenharmony_ci undefined after a capture operation. 4105bd8deadSopenharmony_ci 4115bd8deadSopenharmony_ci "After objects have been bound to the video capture streams, 4125bd8deadSopenharmony_ci 4135bd8deadSopenharmony_ci enum VideoCaptureNV(uint video_capture_slot, uint *sequence_num, 4145bd8deadSopenharmony_ci uint64EXT *capture_time); 4155bd8deadSopenharmony_ci 4165bd8deadSopenharmony_ci can be called to capture one frame of video. If no frames are 4175bd8deadSopenharmony_ci available, this call will block until frames are ready for capture 4185bd8deadSopenharmony_ci or an error occurs. VideoCaptureNV will return one of SUCCESS_NV, 4195bd8deadSopenharmony_ci PARTIAL_SUCCESS_NV, or FAILURE_NV. If the capture operation 4205bd8deadSopenharmony_ci completed successfully on all stream with objects bound, SUCCESS_NV 4215bd8deadSopenharmony_ci is returned. If some streams succeeded PARTIAL_SUCCESS_NV is 4225bd8deadSopenharmony_ci returned. If the capture failed on all streams, or if the capture 4235bd8deadSopenharmony_ci state on the specified slot is invalid, FAILURE_NV is returned. In 4245bd8deadSopenharmony_ci addition, the following GL errors are generated if FAILURE_NV was 4255bd8deadSopenharmony_ci returned because of invalid capture state: 4265bd8deadSopenharmony_ci 4275bd8deadSopenharmony_ci * INVALID_OPERATION if any stream has both texture and buffer 4285bd8deadSopenharmony_ci objects bound. 4295bd8deadSopenharmony_ci 4305bd8deadSopenharmony_ci * INVALID_VALUE if any buffer objects bound are not large enough 4315bd8deadSopenharmony_ci to contain the the data from the region they are bound to at the 4325bd8deadSopenharmony_ci specified offset. 4335bd8deadSopenharmony_ci 4345bd8deadSopenharmony_ci * INVALID_VALUE if the dimensions of any textures bound do not 4355bd8deadSopenharmony_ci match the dimensions of the region they are bound to. 4365bd8deadSopenharmony_ci 4375bd8deadSopenharmony_ci * INVALID_OPERATION if the base level of any textures bound has 4385bd8deadSopenharmony_ci not been defined. 4395bd8deadSopenharmony_ci 4405bd8deadSopenharmony_ci * INVALID_OPERATION if the internal formats of any textures bound 4415bd8deadSopenharmony_ci to the same stream does not match. 4425bd8deadSopenharmony_ci 4435bd8deadSopenharmony_ci * INVALID_OPERATION if automatic mipmap generation is enabled for 4445bd8deadSopenharmony_ci any textures bound. 4455bd8deadSopenharmony_ci 4465bd8deadSopenharmony_ci "If PARTIAL_SUCCESS_NV is returned, the command 4475bd8deadSopenharmony_ci 4485bd8deadSopenharmony_ci void GetVideoCaptureStream{i,f,d}vNV(uint video_capture_slot, 4495bd8deadSopenharmony_ci uint stream, enum pname, 4505bd8deadSopenharmony_ci T *params); 4515bd8deadSopenharmony_ci 4525bd8deadSopenharmony_ci can be used with <pname> set to LAST_VIDEO_CAPTURE_STATUS_NV to 4535bd8deadSopenharmony_ci determine which streams the capture succeeded on. 4545bd8deadSopenharmony_ci 4555bd8deadSopenharmony_ci "After a successful or partially successful VideoCaptureNV call, 4565bd8deadSopenharmony_ci <sequence_num> will be set to the sequence number of the frame 4575bd8deadSopenharmony_ci captured, beginning at 0 for the first frame after BeginVideoCapture 4585bd8deadSopenharmony_ci was called, and <capture_time> is set to the GPU time, in 4595bd8deadSopenharmony_ci nanoseconds, that the video capture device began capturing the 4605bd8deadSopenharmony_ci frame. Note that the time VideoCaptureNV was called does not affect 4615bd8deadSopenharmony_ci the value returned in <capture_time>. The time returned is relative 4625bd8deadSopenharmony_ci to when the video frame first reached the capture hardware, not when 4635bd8deadSopenharmony_ci the GL requested delivery of the next captured frame. After a 4645bd8deadSopenharmony_ci failed VideoCaptureNV call, the values in <sequence_num> and 4655bd8deadSopenharmony_ci <capture_time> are undefined. 4665bd8deadSopenharmony_ci 4675bd8deadSopenharmony_ci "When capturing data with a 4:4:4 or 4:4:4:4 layout without using 4685bd8deadSopenharmony_ci one of the destination formats from table 4.13 the captured pixels 4695bd8deadSopenharmony_ci are run through the color conversion process illustrated in figure 4705bd8deadSopenharmony_ci 4.4 as they are transferred from the capture device's raw buffers to 4715bd8deadSopenharmony_ci the bound capture objects. 4725bd8deadSopenharmony_ci 4735bd8deadSopenharmony_ci |a| 4745bd8deadSopenharmony_ci Output = clamp( M |b| + Offset ) 4755bd8deadSopenharmony_ci |c| 4765bd8deadSopenharmony_ci |d| 4775bd8deadSopenharmony_ci 4785bd8deadSopenharmony_ci Figure 4.4, Video capture color conversion pipeline. When the stream 4795bd8deadSopenharmony_ci is in YUVA color space: a = Yi, b=Ui, c=Vi and d = Ai. When in 4805bd8deadSopenharmony_ci RGBA color space, a = Gi, b=Bi, c=Ri and d = Ai. 4815bd8deadSopenharmony_ci 4825bd8deadSopenharmony_ci "<M> and <Offset> are the color conversion matrix and color 4835bd8deadSopenharmony_ci conversion offset for the video capture stream, respectively, and 4845bd8deadSopenharmony_ci <clamp> is an operation that clamps each component of the result to 4855bd8deadSopenharmony_ci the range specified by the corresponding components of <Cmin> and 4865bd8deadSopenharmony_ci <Cmax> for the video capture stream. Each component of <Cmin> is 4875bd8deadSopenharmony_ci calculated by taking the maximum of the corresponding component 4885bd8deadSopenharmony_ci in the vector specified by VIDEO_COLOR_CONVERSION_MIN_NV, as 4895bd8deadSopenharmony_ci described below, and the minimum value representable by the format 4905bd8deadSopenharmony_ci of the destination surface. Similarly, each component of <Cmax> 4915bd8deadSopenharmony_ci is calculated by taking the minimum of the corresponding component 4925bd8deadSopenharmony_ci in the vector specified by VIDEO_COLOR_CONVERSION_MAX_NV and the 4935bd8deadSopenharmony_ci maximum value representable by the format. 4945bd8deadSopenharmony_ci 4955bd8deadSopenharmony_ci "When the destination format uses fixed-point or floating-point 4965bd8deadSopenharmony_ci internal storage, the captured video data will be converted to a 4975bd8deadSopenharmony_ci floating-point representation internally before the color 4985bd8deadSopenharmony_ci conversion step. The following equation describes the conversion: 4995bd8deadSopenharmony_ci 5005bd8deadSopenharmony_ci f = ( c - Dmin ) / ( Dmax - Dmin ) 5015bd8deadSopenharmony_ci 5025bd8deadSopenharmony_ci "Where <c> is the value of the incoming component, <Dmin> and <Dmax> 5035bd8deadSopenharmony_ci are the minimum and maximum values, respectively, that the video 5045bd8deadSopenharmony_ci capture device can generate in its current configuration, and <f> is 5055bd8deadSopenharmony_ci the resulting floating-point value. Note that <Dmin> and <Dmax> 5065bd8deadSopenharmony_ci refer to the numerical range of the incoming data format. They are 5075bd8deadSopenharmony_ci not affected by any clamping requirements of the captured data 5085bd8deadSopenharmony_ci format. 5095bd8deadSopenharmony_ci 5105bd8deadSopenharmony_ci "The commands 5115bd8deadSopenharmony_ci 5125bd8deadSopenharmony_ci void VideoCaptureStreamParameter{i,f,d}vNV(uint 5135bd8deadSopenharmony_ci video_capture_slot, 5145bd8deadSopenharmony_ci uint stream, 5155bd8deadSopenharmony_ci enum pname, 5165bd8deadSopenharmony_ci const T *params); 5175bd8deadSopenharmony_ci 5185bd8deadSopenharmony_ci can be used to specify video capture stream parameters. The value 5195bd8deadSopenharmony_ci or values in <params> are assigned to video capture stream parameter 5205bd8deadSopenharmony_ci specified as <pname>. To specify a stream's conversion matrix, set 5215bd8deadSopenharmony_ci <pname> to VIDEO_COLOR_CONVERSION_MATRIX_NV, and set <params> to an 5225bd8deadSopenharmony_ci array of 16 consecutive values, which are used as the elements of a 5235bd8deadSopenharmony_ci 4 x 4 column-major matrix. If the video capture stream's data 5245bd8deadSopenharmony_ci format does not include an alpha component, the fourth column of the 5255bd8deadSopenharmony_ci matrix is ignored. The color conversion matrix is initialized to 5265bd8deadSopenharmony_ci a 4x4 identity matrix when a video capture device is bound. 5275bd8deadSopenharmony_ci 5285bd8deadSopenharmony_ci "To specify the video capture stream color conversion offset vector, 5295bd8deadSopenharmony_ci set <pname> to to VIDEO_COLOR_CONVERSION_OFFSET_NV and <params> to 5305bd8deadSopenharmony_ci an array of 4 consecutive values. If the video capture stream's 5315bd8deadSopenharmony_ci data format does not include an alpha component, the fourth 5325bd8deadSopenharmony_ci component of the vector is ignored. Initially the offset vector 5335bd8deadSopenharmony_ci is the zero vector. 5345bd8deadSopenharmony_ci 5355bd8deadSopenharmony_ci "To specify the video capture stream color conversion clamp values, 5365bd8deadSopenharmony_ci set <pname> to one of VIDEO_COLOR_CONVERSION_MIN_NV or 5375bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MAX_NV and <params> to an array of 4 5385bd8deadSopenharmony_ci consecutive values. If the video capture stream's data format does 5395bd8deadSopenharmony_ci not include an alpha component, the fourth component of the vectors 5405bd8deadSopenharmony_ci is ignored. Initially the minimum and maximum values are set to 5415bd8deadSopenharmony_ci the zero vector and <1, 1, 1, 1> respectively. Note that care 5425bd8deadSopenharmony_ci should be taken to set the maximum vector correctly when using 5435bd8deadSopenharmony_ci destination capture formats that do not store normalized values, 5445bd8deadSopenharmony_ci such as integer texture formats. 5455bd8deadSopenharmony_ci 5465bd8deadSopenharmony_ci "To set the orientation of the captured video data, set <pname> to 5475bd8deadSopenharmony_ci VIDEO_CAPTURE_SURFACE_ORIGIN_NV and <params> to LOWER_LEFT or 5485bd8deadSopenharmony_ci UPPER_LEFT. The default value is LOWER_LEFT, which means the bottom 5495bd8deadSopenharmony_ci left of the captured region of the video image will be at texture 5505bd8deadSopenharmony_ci coordinate <0,0> in any textures bound as capture desitnations, and 5515bd8deadSopenharmony_ci will be first pixel in any buffer objects bound as capture 5525bd8deadSopenharmony_ci destinations. If UPPER_LEFT is used as the origin, the image will 5535bd8deadSopenharmony_ci be mirrored vertically. If <params> contains any value other than 5545bd8deadSopenharmony_ci LOWER_LEFT or UPPER_LEFT, INVALID_ENUM is generated." 5555bd8deadSopenharmony_ci 5565bd8deadSopenharmony_ci If NV_present_video is present, section 4.5 "Displaying Buffers" 5575bd8deadSopenharmony_ci becomes section 4.6. 5585bd8deadSopenharmony_ci 5595bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.1 Specification (Special Functions) 5605bd8deadSopenharmony_ci 5615bd8deadSopenharmony_ci In section 5.4, "Display Lists", add the following to the list of 5625bd8deadSopenharmony_ci commands that are not compiled into display lists: 5635bd8deadSopenharmony_ci 5645bd8deadSopenharmony_ci "Video capture commands: BeginVideoCaptureNV, 5655bd8deadSopenharmony_ci BindVideoCaptureStreamBufferNV, BindVideoCaptureStreamTextureNV, 5665bd8deadSopenharmony_ci EndVideoCaptureNV, VideoCaptureNV, 5675bd8deadSopenharmony_ci VideoCaptureStreamParameter{i,f,d}vNV 5685bd8deadSopenharmony_ci 5695bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.1 Specification (State and State 5705bd8deadSopenharmony_ciRequests) 5715bd8deadSopenharmony_ci 5725bd8deadSopenharmony_ci Add a new section after Section 6.1.14, "Shader and Program Queries" 5735bd8deadSopenharmony_ci 5745bd8deadSopenharmony_ci "Section 6.1.15, Video Capture State Queries 5755bd8deadSopenharmony_ci 5765bd8deadSopenharmony_ci "The command 5775bd8deadSopenharmony_ci 5785bd8deadSopenharmony_ci void GetVideoCaptureivNV(uint video_capture_slot, enum pname, 5795bd8deadSopenharmony_ci int *params); 5805bd8deadSopenharmony_ci 5815bd8deadSopenharmony_ci returns properties of the video capture device bound to 5825bd8deadSopenharmony_ci <video_capture_slot> in <params>. The parameter value to return is 5835bd8deadSopenharmony_ci specified in <pname>. 5845bd8deadSopenharmony_ci 5855bd8deadSopenharmony_ci "If <pname> is NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV, TRUE is returned 5865bd8deadSopenharmony_ci if VideoCaptureNV will not block and FALSE is returned otherwise. 5875bd8deadSopenharmony_ci If <pname> is NUM_VIDEO_CAPTURE_STREAMS_NV, the number of available 5885bd8deadSopenharmony_ci video capture streams on the device bound to <video_capture_slot> is 5895bd8deadSopenharmony_ci returned. 5905bd8deadSopenharmony_ci 5915bd8deadSopenharmony_ci "The command 5925bd8deadSopenharmony_ci 5935bd8deadSopenharmony_ci void GetVideoCaptureStream{i,f,d}vNV(uint video_capture_slot, 5945bd8deadSopenharmony_ci uint stream, enum pname, 5955bd8deadSopenharmony_ci uint *params); 5965bd8deadSopenharmony_ci 5975bd8deadSopenharmony_ci returns properties of an individual video stream on the video 5985bd8deadSopenharmony_ci capture device bound to <video_capture_slot> in <params>. The 5995bd8deadSopenharmony_ci parameter value to return is specified in <pname>. 6005bd8deadSopenharmony_ci 6015bd8deadSopenharmony_ci "If <pname> is LAST_VIDEO_CAPTURE_STATUS_NV, SUCCESS_NV will be 6025bd8deadSopenharmony_ci returned if the last call to VideoCaptureNV captured valid pixels 6035bd8deadSopenharmony_ci data for the entire frame on this stream. Otherwise, FAILURE_NV 6045bd8deadSopenharmony_ci will be returned. If <pname> is VIDEO_BUFFER_INTERNAL_FORMAT_NV, 6055bd8deadSopenharmony_ci the internal format used when capturing to a buffer object is 6065bd8deadSopenharmony_ci returned. Initially the internal format is RGBA8. If <pname> is 6075bd8deadSopenharmony_ci VIDEO_BUFFER_PITCH_NV, the pitch of the image data captured when a 6085bd8deadSopenharmony_ci buffer object is bound to this stream is returned. The pitch is 6095bd8deadSopenharmony_ci based on the internal format so it should be queried whenever the 6105bd8deadSopenharmony_ci internal format is changed. If <pname> is 6115bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MATRIX_NV an array of 16 values representing 6125bd8deadSopenharmony_ci the column-major color conversion matrix is returned. Initially 6135bd8deadSopenharmony_ci this matrix is the identity matrix. If <pname> is 6145bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_OFFSET_NV, 4 values representing the color 6155bd8deadSopenharmony_ci conversion offset vector are returned. Initially the offset vector 6165bd8deadSopenharmony_ci is [ 0 0 0 0 ]. If <pname> is VIDEO_COLOR_CONVERSION_MIN_NV or 6175bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MAX_NV, 4 values representing the color 6185bd8deadSopenharmony_ci conversion minimum or maximum vectors are returned, respectively. 6195bd8deadSopenharmony_ci Initially the minimum is [ 0 0 0 0 ] and the maximum is 6205bd8deadSopenharmony_ci [ 1 1 1 1 ]. If <pname> is VIDEO_CAPTURE_FRAME_WIDTH_NV, 6215bd8deadSopenharmony_ci VIDEO_CAPTURE_FRAME_HEIGHT_NV, VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV, 6225bd8deadSopenharmony_ci or VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV, the frame/field width, frame 6235bd8deadSopenharmony_ci height, upper field height, or lower field height of the data the 6245bd8deadSopenharmony_ci bound video capture device is configured to capture, respectively, 6255bd8deadSopenharmony_ci are returned. If <pname> is VIDEO_CAPTURE_SURFACE_ORIGIN_NV, 6265bd8deadSopenharmony_ci LOWER_LEFT or UPPER_LEFT is returned. If <pname> is 6275bd8deadSopenharmony_ci VIDEO_CAPTURE_TO_422_SUPPORTED_NV, TRUE is returned if using one of 6285bd8deadSopenharmony_ci the 4:2:2 formats from table 4.13 when capturing to buffer objects 6295bd8deadSopenharmony_ci on this stream is supported. Otherwise, FALSE is returned. 6305bd8deadSopenharmony_ci 6315bd8deadSopenharmony_ci 6325bd8deadSopenharmony_ciAdditions to Chapter 2 of the GLX 1.4 Specification (GLX Operation) 6335bd8deadSopenharmony_ci 6345bd8deadSopenharmony_ci None 6355bd8deadSopenharmony_ci 6365bd8deadSopenharmony_ciAdditions to Chapter 3 of the GLX 1.4 Specification (Functions and 6375bd8deadSopenharmony_ciErrors) 6385bd8deadSopenharmony_ci 6395bd8deadSopenharmony_ci Modify table 3.5: 6405bd8deadSopenharmony_ci 6415bd8deadSopenharmony_ci Attribute Type Description 6425bd8deadSopenharmony_ci ------------------------------ ---- ------------------------------ 6435bd8deadSopenharmony_ci GLX_FBCONFIG_ID XID XID of GLXFBCconfig associated 6445bd8deadSopenharmony_ci with context 6455bd8deadSopenharmony_ci GLX_RENDER_TYPE int type of rendering supported 6465bd8deadSopenharmony_ci GLX_SCREEN int screen number 6475bd8deadSopenharmony_ci GLX_NUM_VIDEO_CAPTURE_SLOTS_NV int number of video capture slots 6485bd8deadSopenharmony_ci this context supports 6495bd8deadSopenharmony_ci 6505bd8deadSopenharmony_ci Add a section between Sections 3.3.10 and 3.3.11: 6515bd8deadSopenharmony_ci 6525bd8deadSopenharmony_ci 3.3.11a Video Capture Devices 6535bd8deadSopenharmony_ci 6545bd8deadSopenharmony_ci "GLX video capture devices can be used to stream video data from an 6555bd8deadSopenharmony_ci external source directly into GL objects for use in rendering or 6565bd8deadSopenharmony_ci readback. Use 6575bd8deadSopenharmony_ci 6585bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV * 6595bd8deadSopenharmony_ci glXEnumerateVideoCaptureDevicesNV(Display *dpy, 6605bd8deadSopenharmony_ci int screen, 6615bd8deadSopenharmony_ci int *nElements); 6625bd8deadSopenharmony_ci 6635bd8deadSopenharmony_ci "to generate an array of video capture devices. The number of 6645bd8deadSopenharmony_ci elements in the array is returned in <nElements>. Each element of 6655bd8deadSopenharmony_ci the array is a video capture device on <screen>. Use XFree to free 6665bd8deadSopenharmony_ci the memory returned by glXEnumerateVideoCaptureDevicesNV. 6675bd8deadSopenharmony_ci 6685bd8deadSopenharmony_ci "GLX video capture devices are abstract objects that refer to a 6695bd8deadSopenharmony_ci physical capture device. Each physical capture device will have a 6705bd8deadSopenharmony_ci unique ID that can be used to identify it when coordinating device 6715bd8deadSopenharmony_ci usage and setup with other APIs. To query the unique ID of the 6725bd8deadSopenharmony_ci physical device backing a GLX video capture device, use 6735bd8deadSopenharmony_ci 6745bd8deadSopenharmony_ci int glXQueryVideoCaptureDeviceNV(Display *dpy, 6755bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV device, 6765bd8deadSopenharmony_ci int attribute, int *value); 6775bd8deadSopenharmony_ci 6785bd8deadSopenharmony_ci "where <attribute> must be GLX_UNIQUE_ID_NV. On success, the unique 6795bd8deadSopenharmony_ci ID will be returned in <value> and the function will return Success. 6805bd8deadSopenharmony_ci If <device> does not refer to a video capture device GLX_BAD_VALUE 6815bd8deadSopenharmony_ci will be returned. If <attribute> does not name a video capture 6825bd8deadSopenharmony_ci device attribute GLX_BAD_ATTRIBUTE will be returned. 6835bd8deadSopenharmony_ci 6845bd8deadSopenharmony_ci "Before using a video capture device, it must be locked. Once a 6855bd8deadSopenharmony_ci video capture device is locked by a client, no other client can lock 6865bd8deadSopenharmony_ci a video capture device with the same unique ID until the lock is 6875bd8deadSopenharmony_ci released or the connection between the client holding the lock and 6885bd8deadSopenharmony_ci the X server is broken. To lock a video capture device to a display 6895bd8deadSopenharmony_ci connection, use 6905bd8deadSopenharmony_ci 6915bd8deadSopenharmony_ci void glXLockVideoCaptureDeviceNV(Display *dpy, 6925bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV device); 6935bd8deadSopenharmony_ci 6945bd8deadSopenharmony_ci "If <device> does not name a video capture device, BadValue is 6955bd8deadSopenharmony_ci generated. If <device> is already locked <BadMatch> is generated. 6965bd8deadSopenharmony_ci 6975bd8deadSopenharmony_ci "After successfully locking a video capture device, use 6985bd8deadSopenharmony_ci 6995bd8deadSopenharmony_ci int glXBindVideoCaptureDeviceNV(Display *dpy, 7005bd8deadSopenharmony_ci unsigned int video_capture_slot, 7015bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV device); 7025bd8deadSopenharmony_ci 7035bd8deadSopenharmony_ci 7045bd8deadSopenharmony_ci "to bind it to the capture slot <video_capture_slot> in the current 7055bd8deadSopenharmony_ci context. If the slot is already bound, the device it's bound to 7065bd8deadSopenharmony_ci it will be unbound first. To unbind a video capture device, bind 7075bd8deadSopenharmony_ci device None to the video capture slot the device is bound to. If 7085bd8deadSopenharmony_ci the bind is successful, Success is returned. If there is no context 7095bd8deadSopenharmony_ci current GLX_BAD_CONTEXT is returned or GLXBadContext is generated. 7105bd8deadSopenharmony_ci If <video_capture_slot> is not a valid capture slot on the current 7115bd8deadSopenharmony_ci context, BadMatch is generated. If <device> does not name a video 7125bd8deadSopenharmony_ci capture device, BadValue is generated. If <device> is already bound 7135bd8deadSopenharmony_ci to a video capture slot, GLX_BAD_VALUE is returned. If <device> is 7145bd8deadSopenharmony_ci not locked by <dpy>, BadMatch is generated." 7155bd8deadSopenharmony_ci 7165bd8deadSopenharmony_ci "GLX does not provide a mechanism to configure the video capture 7175bd8deadSopenharmony_ci process. It is expected that device vendors provide a vendor- 7185bd8deadSopenharmony_ci specific mechanism for configuring or detecting properties such as 7195bd8deadSopenharmony_ci the incoming video signal and data format. However, GLX does expect 7205bd8deadSopenharmony_ci that devices are fully configured before glXBindVideoCaptureDeviceNV 7215bd8deadSopenharmony_ci is called. Changing device properties that affect the format of the 7225bd8deadSopenharmony_ci captured data will cause the results of video capture to be 7235bd8deadSopenharmony_ci undefined. 7245bd8deadSopenharmony_ci 7255bd8deadSopenharmony_ci "When finished capturing data on a locked video capture device, use 7265bd8deadSopenharmony_ci 7275bd8deadSopenharmony_ci void glXReleaseVideoCaptureDeviceNV(Display *dpy, 7285bd8deadSopenharmony_ci GLXVideoCaptureDeviceNV device); 7295bd8deadSopenharmony_ci 7305bd8deadSopenharmony_ci to unlock it. The application must unbind the device before 7315bd8deadSopenharmony_ci releasing it, or BadMatch will be generated. If <device> does not 7325bd8deadSopenharmony_ci name a video capture device, BadValue is generated. If <device> 7335bd8deadSopenharmony_ci is not locked by <dpy>, BadMatch is generated. 7345bd8deadSopenharmony_ci 7355bd8deadSopenharmony_ciAdditions to Chapter 4 of the GLX 1.4 Specification (Encoding on the X 7365bd8deadSopenharmony_ciByte Stream) 7375bd8deadSopenharmony_ci 7385bd8deadSopenharmony_ci None 7395bd8deadSopenharmony_ci 7405bd8deadSopenharmony_ciAdditions to Chapter 5 of the GLX 1.4 Specification (Extending OpenGL) 7415bd8deadSopenharmony_ci 7425bd8deadSopenharmony_ciAdditions to Chapter 6 of the GLX 1.4 Specification (GLX Versions) 7435bd8deadSopenharmony_ci 7445bd8deadSopenharmony_ci None 7455bd8deadSopenharmony_ci 7465bd8deadSopenharmony_ciGLX Protocol 7475bd8deadSopenharmony_ci 7485bd8deadSopenharmony_ci BindVideoCaptureDeviceNV 7495bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 7505bd8deadSopenharmony_ci 1 17 GLX opcode (glXVendorPrivateWithReply) 7515bd8deadSopenharmony_ci 2 5 request length 7525bd8deadSopenharmony_ci 4 1412 vendor specific opcode 7535bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 7545bd8deadSopenharmony_ci 4 CARD32 video_capture_slot 7555bd8deadSopenharmony_ci 4 CARD32 device 7565bd8deadSopenharmony_ci => 7575bd8deadSopenharmony_ci 1 CARD8 reply 7585bd8deadSopenharmony_ci 1 unused 7595bd8deadSopenharmony_ci 2 CARD16 sequence number 7605bd8deadSopenharmony_ci 4 0 reply length 7615bd8deadSopenharmony_ci 4 CARD32 status 7625bd8deadSopenharmony_ci 20 unused 7635bd8deadSopenharmony_ci 7645bd8deadSopenharmony_ci EnumerateVideoCaptureDeviceNV 7655bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 7665bd8deadSopenharmony_ci 1 17 GLX opcode (glXVendorPrivateWithReply) 7675bd8deadSopenharmony_ci 2 4 request length 7685bd8deadSopenharmony_ci 4 1413 vendor specific opcode 7695bd8deadSopenharmony_ci 4 unused 7705bd8deadSopenharmony_ci 4 CARD32 screen 7715bd8deadSopenharmony_ci => 7725bd8deadSopenharmony_ci 1 CARD8 reply 7735bd8deadSopenharmony_ci 1 unused 7745bd8deadSopenharmony_ci 2 CARD16 sequence number 7755bd8deadSopenharmony_ci 4 n reply length, n = 2 * d * p 7765bd8deadSopenharmony_ci 4 CARD32 num_devices (d) 7775bd8deadSopenharmony_ci 4 CARD32 num_properties (p) 7785bd8deadSopenharmony_ci 16 unused 7795bd8deadSopenharmony_ci 4*n LISTofATTRIBUTE_PAIR attribute, value pairs 7805bd8deadSopenharmony_ci 7815bd8deadSopenharmony_ci LockVideoCaptureDeviceNV 7825bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 7835bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 7845bd8deadSopenharmony_ci 2 4 request length 7855bd8deadSopenharmony_ci 4 1414 vendor specific opcode 7865bd8deadSopenharmony_ci 4 unused 7875bd8deadSopenharmony_ci 4 CARD32 device 7885bd8deadSopenharmony_ci 7895bd8deadSopenharmony_ci ReleaseVideoCaptureDeviceNV 7905bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 7915bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 7925bd8deadSopenharmony_ci 2 4 request length 7935bd8deadSopenharmony_ci 4 1415 vendor specific opcode 7945bd8deadSopenharmony_ci 4 unused 7955bd8deadSopenharmony_ci 4 CARD32 device 7965bd8deadSopenharmony_ci 7975bd8deadSopenharmony_ci BeginVideoCaptureNV 7985bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 7995bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 8005bd8deadSopenharmony_ci 2 4 request length 8015bd8deadSopenharmony_ci 4 1400 vendor specific opcode 8025bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 8035bd8deadSopenharmony_ci 4 CARD32 video_cpture_slot 8045bd8deadSopenharmony_ci 8055bd8deadSopenharmony_ci BindVideoCaptureStreamBufferNV 8065bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 8075bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 8085bd8deadSopenharmony_ci 2 8 request length 8095bd8deadSopenharmony_ci 4 1401 vendor specific opcode 8105bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 8115bd8deadSopenharmony_ci 8 CARD64 offset 8125bd8deadSopenharmony_ci 4 CARD32 video_cpture_slot 8135bd8deadSopenharmony_ci 4 CARD32 stream 8145bd8deadSopenharmony_ci 4 ENUM frame_region 8155bd8deadSopenharmony_ci 8165bd8deadSopenharmony_ci BindVideoCaptureStreamBufferNV 8175bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 8185bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 8195bd8deadSopenharmony_ci 2 8 request length 8205bd8deadSopenharmony_ci 4 1402 vendor specific opcode 8215bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 8225bd8deadSopenharmony_ci 4 CARD32 video_cpture_slot 8235bd8deadSopenharmony_ci 4 CARD32 stream 8245bd8deadSopenharmony_ci 4 ENUM frame_region 8255bd8deadSopenharmony_ci 4 ENUM target 8265bd8deadSopenharmony_ci 4 CARD32 texture 8275bd8deadSopenharmony_ci 8285bd8deadSopenharmony_ci EndVideoCaptureNV 8295bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 8305bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 8315bd8deadSopenharmony_ci 2 4 request length 8325bd8deadSopenharmony_ci 4 1403 vendor specific opcode 8335bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 8345bd8deadSopenharmony_ci 4 CARD32 video_cpture_slot 8355bd8deadSopenharmony_ci 8365bd8deadSopenharmony_ci GetVideoCaptureivNV 8375bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 8385bd8deadSopenharmony_ci 1 17 GLX opcode (glXVendorPrivateWithReply) 8395bd8deadSopenharmony_ci 2 5 request length 8405bd8deadSopenharmony_ci 4 1404 vendor specific opcode 8415bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 8425bd8deadSopenharmony_ci 4 CARD32 video_capture_slot 8435bd8deadSopenharmony_ci 4 ENUM pname 8445bd8deadSopenharmony_ci => 8455bd8deadSopenharmony_ci 1 CARD8 reply 8465bd8deadSopenharmony_ci 1 unused 8475bd8deadSopenharmony_ci 2 CARD16 sequence number 8485bd8deadSopenharmony_ci 4 m reply length, m = (n==1 ? 0 : n) 8495bd8deadSopenharmony_ci 4 unused 8505bd8deadSopenharmony_ci 4 CARD32 n 8515bd8deadSopenharmony_ci 8525bd8deadSopenharmony_ci if (n=1) this follows: 8535bd8deadSopenharmony_ci 8545bd8deadSopenharmony_ci 4 INT32 params 8555bd8deadSopenharmony_ci 12 unused 8565bd8deadSopenharmony_ci 8575bd8deadSopenharmony_ci otherwise this follows: 8585bd8deadSopenharmony_ci 8595bd8deadSopenharmony_ci 16 unused 8605bd8deadSopenharmony_ci n*4 LISTofINT32 params 8615bd8deadSopenharmony_ci 8625bd8deadSopenharmony_ci GetVideoCaptureStreamivNV 8635bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 8645bd8deadSopenharmony_ci 1 17 GLX opcode (glXVendorPrivateWithReply) 8655bd8deadSopenharmony_ci 2 6 request length 8665bd8deadSopenharmony_ci 4 1405 vendor specific opcode 8675bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 8685bd8deadSopenharmony_ci 4 CARD32 video_capture_slot 8695bd8deadSopenharmony_ci 4 CARD32 stream 8705bd8deadSopenharmony_ci 4 ENUM pname 8715bd8deadSopenharmony_ci => 8725bd8deadSopenharmony_ci 1 CARD8 reply 8735bd8deadSopenharmony_ci 1 unused 8745bd8deadSopenharmony_ci 2 CARD16 sequence number 8755bd8deadSopenharmony_ci 4 m reply length, m = (n==1 ? 0 : n) 8765bd8deadSopenharmony_ci 4 unused 8775bd8deadSopenharmony_ci 4 CARD32 n 8785bd8deadSopenharmony_ci 8795bd8deadSopenharmony_ci if (n=1) this follows: 8805bd8deadSopenharmony_ci 8815bd8deadSopenharmony_ci 4 INT32 params 8825bd8deadSopenharmony_ci 12 unused 8835bd8deadSopenharmony_ci 8845bd8deadSopenharmony_ci otherwise this follows: 8855bd8deadSopenharmony_ci 8865bd8deadSopenharmony_ci 16 unused 8875bd8deadSopenharmony_ci n*4 LISTofINT32 params 8885bd8deadSopenharmony_ci 8895bd8deadSopenharmony_ci GetVideoCaptureStreamfvNV 8905bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 8915bd8deadSopenharmony_ci 1 17 GLX opcode (glXVendorPrivateWithReply) 8925bd8deadSopenharmony_ci 2 6 request length 8935bd8deadSopenharmony_ci 4 1406 vendor specific opcode 8945bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 8955bd8deadSopenharmony_ci 4 CARD32 video_capture_slot 8965bd8deadSopenharmony_ci 4 CARD32 stream 8975bd8deadSopenharmony_ci 4 ENUM pname 8985bd8deadSopenharmony_ci => 8995bd8deadSopenharmony_ci 1 CARD8 reply 9005bd8deadSopenharmony_ci 1 unused 9015bd8deadSopenharmony_ci 2 CARD16 sequence number 9025bd8deadSopenharmony_ci 4 m reply length, m = (n==1 ? 0 : n) 9035bd8deadSopenharmony_ci 4 unused 9045bd8deadSopenharmony_ci 4 CARD32 n 9055bd8deadSopenharmony_ci 9065bd8deadSopenharmony_ci if (n=1) this follows: 9075bd8deadSopenharmony_ci 9085bd8deadSopenharmony_ci 4 FLOAT32 params 9095bd8deadSopenharmony_ci 12 unused 9105bd8deadSopenharmony_ci 9115bd8deadSopenharmony_ci otherwise this follows: 9125bd8deadSopenharmony_ci 9135bd8deadSopenharmony_ci 16 unused 9145bd8deadSopenharmony_ci n*4 LISTofFLOAT32 params 9155bd8deadSopenharmony_ci 9165bd8deadSopenharmony_ci GetVideoCaptureStreamdvNV 9175bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 9185bd8deadSopenharmony_ci 1 17 GLX opcode (glXVendorPrivateWithReply) 9195bd8deadSopenharmony_ci 2 6 request length 9205bd8deadSopenharmony_ci 4 1407 vendor specific opcode 9215bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 9225bd8deadSopenharmony_ci 4 CARD32 video_capture_slot 9235bd8deadSopenharmony_ci 4 CARD32 stream 9245bd8deadSopenharmony_ci 4 ENUM pname 9255bd8deadSopenharmony_ci => 9265bd8deadSopenharmony_ci 1 CARD8 reply 9275bd8deadSopenharmony_ci 1 unused 9285bd8deadSopenharmony_ci 2 CARD16 sequence number 9295bd8deadSopenharmony_ci 4 m reply length, m = (n==1 ? 0 : n*2) 9305bd8deadSopenharmony_ci 4 unused 9315bd8deadSopenharmony_ci 4 CARD32 n 9325bd8deadSopenharmony_ci 9335bd8deadSopenharmony_ci if (n=1) this follows: 9345bd8deadSopenharmony_ci 9355bd8deadSopenharmony_ci 8 FLOAT64 params 9365bd8deadSopenharmony_ci 8 unused 9375bd8deadSopenharmony_ci 9385bd8deadSopenharmony_ci otherwise this follows: 9395bd8deadSopenharmony_ci 9405bd8deadSopenharmony_ci 16 unused 9415bd8deadSopenharmony_ci n*8 LISTofFLOAT64 params 9425bd8deadSopenharmony_ci 9435bd8deadSopenharmony_ci VideoCaptureNV 9445bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 9455bd8deadSopenharmony_ci 1 17 GLX opcode (glXVendorPrivateWithReply) 9465bd8deadSopenharmony_ci 2 4 request length 9475bd8deadSopenharmony_ci 4 1408 vendor specific opcode 9485bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 9495bd8deadSopenharmony_ci 4 CARD32 video_capture_slot 9505bd8deadSopenharmony_ci => 9515bd8deadSopenharmony_ci 1 CARD8 reply 9525bd8deadSopenharmony_ci 1 unused 9535bd8deadSopenharmony_ci 2 CARD16 sequence number 9545bd8deadSopenharmony_ci 4 0 reply length 9555bd8deadSopenharmony_ci 4 unused 9565bd8deadSopenharmony_ci 4 unused 9575bd8deadSopenharmony_ci 8 CARD64 capture_time 9585bd8deadSopenharmony_ci 4 CARD32 sequence_num 9595bd8deadSopenharmony_ci 4 unused 9605bd8deadSopenharmony_ci 9615bd8deadSopenharmony_ci VideoCaptureStreamParameterivNV 9625bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 9635bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 9645bd8deadSopenharmony_ci 2 6+n request length 9655bd8deadSopenharmony_ci 4 1409 vendor specific opcode 9665bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 9675bd8deadSopenharmony_ci 4 CARD32 video_cpture_slot 9685bd8deadSopenharmony_ci 4 CARD32 stream 9695bd8deadSopenharmony_ci 4 ENUM pname 9705bd8deadSopenharmony_ci 0x9029 n=16 GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 9715bd8deadSopenharmony_ci 0x902A n=4 GL_VIDEO_COLOR_CONVERSION_MAX_NV 9725bd8deadSopenharmony_ci 0x902B n=4 GL_VIDEO_COLOR_CONVERSION_MIN_NV 9735bd8deadSopenharmony_ci 0x902C n=4 GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 9745bd8deadSopenharmony_ci 0x902D n=1 GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 9755bd8deadSopenharmony_ci 0x902D n=1 GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 9765bd8deadSopenharmony_ci else n=0 command is erroneous 9775bd8deadSopenharmony_ci 4*n LISTofINT32 params 9785bd8deadSopenharmony_ci 9795bd8deadSopenharmony_ci VideoCaptureStreamParameterfvNV 9805bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 9815bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 9825bd8deadSopenharmony_ci 2 6+n request length 9835bd8deadSopenharmony_ci 4 1410 vendor specific opcode 9845bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 9855bd8deadSopenharmony_ci 4 CARD32 video_cpture_slot 9865bd8deadSopenharmony_ci 4 CARD32 stream 9875bd8deadSopenharmony_ci 4 ENUM pname 9885bd8deadSopenharmony_ci 0x9029 n=16 GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 9895bd8deadSopenharmony_ci 0x902A n=4 GL_VIDEO_COLOR_CONVERSION_MAX_NV 9905bd8deadSopenharmony_ci 0x902B n=4 GL_VIDEO_COLOR_CONVERSION_MIN_NV 9915bd8deadSopenharmony_ci 0x902C n=4 GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 9925bd8deadSopenharmony_ci 0x902D n=1 GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 9935bd8deadSopenharmony_ci 0x902D n=1 GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 9945bd8deadSopenharmony_ci else n=0 command is erroneous 9955bd8deadSopenharmony_ci 4*n LISTofFLOAT32 params 9965bd8deadSopenharmony_ci 9975bd8deadSopenharmony_ci VideoCaptureStreamParameterdvNV 9985bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 9995bd8deadSopenharmony_ci 1 16 GLX opcode (glXVendorPrivate) 10005bd8deadSopenharmony_ci 2 6+n*2 request length 10015bd8deadSopenharmony_ci 4 1411 vendor specific opcode 10025bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 10035bd8deadSopenharmony_ci 4 CARD32 video_cpture_slot 10045bd8deadSopenharmony_ci 4 CARD32 stream 10055bd8deadSopenharmony_ci 4 ENUM pname 10065bd8deadSopenharmony_ci 0x9029 n=16 GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 10075bd8deadSopenharmony_ci 0x902A n=4 GL_VIDEO_COLOR_CONVERSION_MAX_NV 10085bd8deadSopenharmony_ci 0x902B n=4 GL_VIDEO_COLOR_CONVERSION_MIN_NV 10095bd8deadSopenharmony_ci 0x902C n=4 GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 10105bd8deadSopenharmony_ci 0x902D n=1 GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 10115bd8deadSopenharmony_ci 0x902D n=1 GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 10125bd8deadSopenharmony_ci else n=0 command is erroneous 10135bd8deadSopenharmony_ci 8*n LISTofFLOAT64 params 10145bd8deadSopenharmony_ci 10155bd8deadSopenharmony_ciAdditions to the WGL Specification 10165bd8deadSopenharmony_ci 10175bd8deadSopenharmony_ci Modify section "Querying WGL context attributes" from NV_present_video 10185bd8deadSopenharmony_ci 10195bd8deadSopenharmony_ci Replace the last two sentences of the last paragraph in the section 10205bd8deadSopenharmony_ci with: 10215bd8deadSopenharmony_ci 10225bd8deadSopenharmony_ci "If <iAttribute> is WGL_NUM_VIDEO_SLOTS_NV, the number of valid video 10235bd8deadSopenharmony_ci output slots in the current context is returned. If <iAttribute> is 10245bd8deadSopenharmony_ci WGL_NUM_VIDEO_CAPTURE_SLOTS_NV, the number of valid video capture 10255bd8deadSopenharmony_ci slots in the current context is returned." 10265bd8deadSopenharmony_ci 10275bd8deadSopenharmony_ci Add a new section "Video Capture Devices" 10285bd8deadSopenharmony_ci 10295bd8deadSopenharmony_ci "WGL video capture devices can be used to stream video data from an 10305bd8deadSopenharmony_ci external source directly into GL objects for use in rendering or 10315bd8deadSopenharmony_ci readback. Use 10325bd8deadSopenharmony_ci 10335bd8deadSopenharmony_ci UINT wglEnumerateVideoCaptureDevicesNV(HDC hDc, 10345bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV *phDeviceList); 10355bd8deadSopenharmony_ci 10365bd8deadSopenharmony_ci "to query the available video capture devices on <hDc>. The number 10375bd8deadSopenharmony_ci of devices is returned, and if phDeviceList is not NULL, an array of 10385bd8deadSopenharmony_ci valid device handles is returned in it. The command will assume 10395bd8deadSopenharmony_ci <phDeviceList> is large enough to hold all available handles so the 10405bd8deadSopenharmony_ci application should take care to first query the number of devices 10415bd8deadSopenharmony_ci and allocate an appropriately sized array. 10425bd8deadSopenharmony_ci 10435bd8deadSopenharmony_ci "WGL video capture device handles refer to a physical capture 10445bd8deadSopenharmony_ci device. Each physical capture device will have a unique ID that can 10455bd8deadSopenharmony_ci be used to identify it when coordinating device usage and setup with 10465bd8deadSopenharmony_ci other APIs. To query the unique ID of the physical device backing a 10475bd8deadSopenharmony_ci WGL video capture device handle, use 10485bd8deadSopenharmony_ci 10495bd8deadSopenharmony_ci BOOL wglQueryVideoCaptureDeviceNV(HDC hDc, 10505bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV hDevice, 10515bd8deadSopenharmony_ci int iAttribute, int *piValue); 10525bd8deadSopenharmony_ci 10535bd8deadSopenharmony_ci "where <iAttribute> must be WGL_UNIQUE_ID_NV. On success, the 10545bd8deadSopenharmony_ci unique ID will be returned in <piValue>. 10555bd8deadSopenharmony_ci 10565bd8deadSopenharmony_ci "Before using a video capture device, it must be locked. Once a 10575bd8deadSopenharmony_ci video capture device is locked by a process, no other process can 10585bd8deadSopenharmony_ci lock a video capture device with the same unique ID until the lock 10595bd8deadSopenharmony_ci is released or the process ends. To lock a video capture device, 10605bd8deadSopenharmony_ci use 10615bd8deadSopenharmony_ci 10625bd8deadSopenharmony_ci BOOL wglLockVideoCaptureDeviceNV(HDC hDc, 10635bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV hDevice); 10645bd8deadSopenharmony_ci 10655bd8deadSopenharmony_ci "After successfully locking a video capture device, use 10665bd8deadSopenharmony_ci 10675bd8deadSopenharmony_ci BOOL wglBindVideoCaptureDeviceNV(UINT uVideoSlot, 10685bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV hDevice); 10695bd8deadSopenharmony_ci 10705bd8deadSopenharmony_ci 10715bd8deadSopenharmony_ci "to bind it to the capture slot <video_capture_slot> in the current 10725bd8deadSopenharmony_ci context. If the slot is already bound, the device it's bound to 10735bd8deadSopenharmony_ci will be unbound first. 10745bd8deadSopenharmony_ci It's an error to bind an already bound device to a different slot. 10755bd8deadSopenharmony_ci To unbind a video capture device, bind device NULL to the 10765bd8deadSopenharmony_ci video capture slot the device is bound to. 10775bd8deadSopenharmony_ci 10785bd8deadSopenharmony_ci "WGL does not provide a mechanism to configure the video capture 10795bd8deadSopenharmony_ci process. It is expected that device vendors provide a vendor- 10805bd8deadSopenharmony_ci specific mechanism for configuring or detecting properties such as 10815bd8deadSopenharmony_ci the incoming video signal and data format. However, WGL does expect 10825bd8deadSopenharmony_ci that devices are fully configured before wglBindVideoCaptureDeviceNV 10835bd8deadSopenharmony_ci is called. Changing device properties that affect the format of the 10845bd8deadSopenharmony_ci captured data will cause the results of video capture to be 10855bd8deadSopenharmony_ci undefined. 10865bd8deadSopenharmony_ci 10875bd8deadSopenharmony_ci "When finished capturing data on a locked video capture device, use 10885bd8deadSopenharmony_ci 10895bd8deadSopenharmony_ci BOOL wglReleaseVideoCaptureDeviceNV(HDC hDc, 10905bd8deadSopenharmony_ci HVIDEOINPUTDEVICENV hDevice); 10915bd8deadSopenharmony_ci 10925bd8deadSopenharmony_ci to unlock it. The application must unbind the device before releasing it, 10935bd8deadSopenharmony_ci it's an error to release a device that is still bound. 10945bd8deadSopenharmony_ci 10955bd8deadSopenharmony_ciErrors 10965bd8deadSopenharmony_ci 10975bd8deadSopenharmony_ci INVALID_VALUE is generated if <video_capture_slot> is less than 1 or 10985bd8deadSopenharmony_ci greater than the number of video capture slots supported by the 10995bd8deadSopenharmony_ci current context when calling BeginVideoCaptureNV, 11005bd8deadSopenharmony_ci BindVideoCaptureStreamBufferNV, BindVideoCaptureStreamTextureNV, 11015bd8deadSopenharmony_ci EndVideoCaptureNV, GetVideoCaptureivNV, 11025bd8deadSopenharmony_ci GetVideoCaptureStream{i,f,d}vNV, VideoCaptureNV, or 11035bd8deadSopenharmony_ci VideoCaptureStreamParameter{i,f,d}vNV. 11045bd8deadSopenharmony_ci 11055bd8deadSopenharmony_ci INVALID_OPERATION is generated if there is no video capture device 11065bd8deadSopenharmony_ci bound to the slot specified by <video_capture_slot> when calling 11075bd8deadSopenharmony_ci BeginVideoCaptureNV, BindVideoCaptureStreamBufferNV, 11085bd8deadSopenharmony_ci BindVideoCaptureStreamTextureNV, EndVideoCaptureNV, 11095bd8deadSopenharmony_ci GetVideoCaptureivNV, GetVideoCaptureStream{i,f,d}vNV, 11105bd8deadSopenharmony_ci VideoCaptureNV, or VideoCaptureStreamParameter{i,f,d}vNV. 11115bd8deadSopenharmony_ci 11125bd8deadSopenharmony_ci INVALID_OPERATION is generated if BeginVideoCaptureNV is called on a 11135bd8deadSopenharmony_ci video capture slot that is already capturing or if EndVideoCaptureNV 11145bd8deadSopenharmony_ci is called on a video capture slot that is not capturing. 11155bd8deadSopenharmony_ci 11165bd8deadSopenharmony_ci INVALID_VALUE is generated if stream is greater than the number of 11175bd8deadSopenharmony_ci streams provided by the currently bound video capture device when 11185bd8deadSopenharmony_ci calling BindVideoCaptureStreamBufferNV, 11195bd8deadSopenharmony_ci BindVideoCaptureStreamTextureNV, 11205bd8deadSopenharmony_ci GetVideoCaptureStreamParameter{i,f,d}vNV, or 11215bd8deadSopenharmony_ci VideoCaptureStreamParameter{i,f,d}vNV. 11225bd8deadSopenharmony_ci 11235bd8deadSopenharmony_ci INVALID_ENUM is generated if <frame_region> is not one of FRAME_NV, 11245bd8deadSopenharmony_ci FIELD_UPPER_NV, or FIELD_LOWER_NV when calling 11255bd8deadSopenharmony_ci BindVideoCaptureStreamBufferNV or BindVideoCaptureStreamTextureNV. 11265bd8deadSopenharmony_ci 11275bd8deadSopenharmony_ci INVALID_OPERATION is generated if <target> is a valid texture target 11285bd8deadSopenharmony_ci but not TEXTURE_2D or TEXTURE_RECTANGLE when calling 11295bd8deadSopenharmony_ci BindVideoCaptureStreamTextureNV 11305bd8deadSopenharmony_ci 11315bd8deadSopenharmony_ci INVALID_ENUM is generated if <target> does not refer to a texture 11325bd8deadSopenharmony_ci target supported by the GL when calling 11335bd8deadSopenharmony_ci BindVideoCaptureStreamTextureNV. 11345bd8deadSopenharmony_ci 11355bd8deadSopenharmony_ci INVALID_VALUE is generated if <texture> is not 0 and does not name 11365bd8deadSopenharmony_ci an existing texture object when calling 11375bd8deadSopenharmony_ci BindVideoCaptureStreamTextureNV. 11385bd8deadSopenharmony_ci 11395bd8deadSopenharmony_ci INVALID_ENUM is generated if <pname> does not name a valid video 11405bd8deadSopenharmony_ci capture slot parameter when calling GetVideoCaptureivNV or a 11415bd8deadSopenharmony_ci valid video capture stream parameter when calling 11425bd8deadSopenharmony_ci GetVideoCaptureStream{i,f,d}vNV or a settable video capture stream 11435bd8deadSopenharmony_ci parameter when calling VideoCaptureStreamParameterivNV. 11445bd8deadSopenharmony_ci 11455bd8deadSopenharmony_ci INVALID_ENUM is generated if the buffer internal format is not a 11465bd8deadSopenharmony_ci supported texture internal format or one of the values in table 11475bd8deadSopenharmony_ci 4.13 when calling VideoCaptureStreamParameter{i,f,d}vNV. 11485bd8deadSopenharmony_ci 11495bd8deadSopenharmony_ci INVALID_ENUM is generated if the buffer internal format is not 11505bd8deadSopenharmony_ci a value in table 4.13 and is not color renderable when calling 11515bd8deadSopenharmony_ci VideoCaptureStreamParameter{i,f,d}vNV. 11525bd8deadSopenharmony_ci 11535bd8deadSopenharmony_ci INVALID_ENUM is generated if the buffer internal format is a value 11545bd8deadSopenharmony_ci in table 4.13 and the format layout is not compatible with the 11555bd8deadSopenharmony_ci effective capture data format as describe in table 4.14 when calling 11565bd8deadSopenharmony_ci VideoCapturStreamParameter{i,f,d}vNV. 11575bd8deadSopenharmony_ci 11585bd8deadSopenharmony_ci INVALID_ENUM is generated if <params> does not contain one of 11595bd8deadSopenharmony_ci LOWER_LEFT or UPPER_LEFT when <pname> is 11605bd8deadSopenharmony_ci VIDEO_CAPTURE_SURFACE_ORIGIN_NV when calling 11615bd8deadSopenharmony_ci VideoCaptureStreamParameter{i,f,d}vNV. 11625bd8deadSopenharmony_ci 11635bd8deadSopenharmony_ci INVALID_OPERATION is generated if any stream has a mixture of 11645bd8deadSopenharmony_ci buffer objects and texture objects bound when VideoCaptureNV is 11655bd8deadSopenharmony_ci called. 11665bd8deadSopenharmony_ci 11675bd8deadSopenharmony_ci INVALID_VALUE is generated if any buffer objects bound are not large 11685bd8deadSopenharmony_ci enough to contain the data that would be captured from the region 11695bd8deadSopenharmony_ci they are bound to at the offset specified when VideoCaptureNV is 11705bd8deadSopenharmony_ci called. 11715bd8deadSopenharmony_ci 11725bd8deadSopenharmony_ci INVALID_VALUE is generated if the dimensions of any textures bound 11735bd8deadSopenharmony_ci to the video capture slot do not match the dimensions of the region 11745bd8deadSopenharmony_ci they are bound to when VideoCaptureNV is called. 11755bd8deadSopenharmony_ci 11765bd8deadSopenharmony_ci INVALID_OPERATION is generated if the base level of any textures 11775bd8deadSopenharmony_ci bound to the video capture slot has not been defined when 11785bd8deadSopenharmony_ci VideoCaptureNV is called. 11795bd8deadSopenharmony_ci 11805bd8deadSopenharmony_ci INVALID_OPERATION is generated if the internal format of all 11815bd8deadSopenharmony_ci textures bound to a given video capture stream does not match when 11825bd8deadSopenharmony_ci VideoCaptureNV is called. 11835bd8deadSopenharmony_ci 11845bd8deadSopenharmony_ci INVALID_OPERATION is generated if the format of any textures bound 11855bd8deadSopenharmony_ci to the video capture slot is not color renderable when 11865bd8deadSopenharmony_ci VideoCaptureNV is called. 11875bd8deadSopenharmony_ci 11885bd8deadSopenharmony_ci INVALID_OPERATION is generated if automatic mipmap generation is 11895bd8deadSopenharmony_ci enabled on any of the textures bound to the video capture slot when 11905bd8deadSopenharmony_ci VideoCaptureNV is called. 11915bd8deadSopenharmony_ci 11925bd8deadSopenharmony_ci INVALID_OPERATION is generated if one field of a stream has an 11935bd8deadSopenharmony_ci object bound to it but the other field does not when VideoCaptureNV 11945bd8deadSopenharmony_ci is called. 11955bd8deadSopenharmony_ci 11965bd8deadSopenharmony_ci INVALID_VALUE is generated when VideoCaptureNV is called if the 11975bd8deadSopenharmony_ci <offset> provided when calling BindVideoCaptureStreamBufferNV is not 11985bd8deadSopenharmony_ci a multiple of the size, in bytes, of a pixel in the internal format 11995bd8deadSopenharmony_ci of the capture buffer. 12005bd8deadSopenharmony_ci 12015bd8deadSopenharmony_ciNew State 12025bd8deadSopenharmony_ci 12035bd8deadSopenharmony_ciAdd a new table, between tables 6.44 and 6.45: 12045bd8deadSopenharmony_ci 12055bd8deadSopenharmony_ci Get Initial 12065bd8deadSopenharmony_ci Get Value Type Command Value Description Sec. Attribute 12075bd8deadSopenharmony_ci ----------------------- ---- ----------- ------- ------------ ---- ------------ 12085bd8deadSopenharmony_ci VIDEO_BUFFER_BINDING_NV Z+ GetIntegerv 0 Video buffer 4.5 - 12095bd8deadSopenharmony_ci binding 12105bd8deadSopenharmony_ci 12115bd8deadSopenharmony_ci Table 6.45. Video Capture State 12125bd8deadSopenharmony_ci 12135bd8deadSopenharmony_ciAdd a new table, after the above: 12145bd8deadSopenharmony_ci 12155bd8deadSopenharmony_ci Get Initial 12165bd8deadSopenharmony_ci Get Value Type Command Value Description Sec. Attribute 12175bd8deadSopenharmony_ci ----------------------------------- ---- ----------------- ------- ----------- ---- --------- 12185bd8deadSopenharmony_ci NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV B GetVideoCaptureiv FALSE Status of 4.5 - 12195bd8deadSopenharmony_ci next video 12205bd8deadSopenharmony_ci capture 12215bd8deadSopenharmony_ci buffer. 12225bd8deadSopenharmony_ci 12235bd8deadSopenharmony_ci Table 6.46. Video Capture Slot State 12245bd8deadSopenharmony_ci 12255bd8deadSopenharmony_ciAdd a new table, after the above: 12265bd8deadSopenharmony_ci 12275bd8deadSopenharmony_ci Get Initial 12285bd8deadSopenharmony_ci Get Value Type Command Value Description Sec. Attribute 12295bd8deadSopenharmony_ci ----------------------------------- ---- ----------------------- ------------ ------------ ---- --------- 12305bd8deadSopenharmony_ci LAST_VIDEO_CAPTURE_STATUS_NV Z3 GetVideoCaptureStreamiv SUCCESS_NV Status of 4.5 - 12315bd8deadSopenharmony_ci last video 12325bd8deadSopenharmony_ci operation 12335bd8deadSopenharmony_ci 12345bd8deadSopenharmony_ci VIDEO_BUFFER_INTERNAL_FORMAT_NV Z+ GetVideoCaptureStreamiv See sec. 4.5 Format of 4.5 - 12355bd8deadSopenharmony_ci video 12365bd8deadSopenharmony_ci capture 12375bd8deadSopenharmony_ci buffers 12385bd8deadSopenharmony_ci bound to 12395bd8deadSopenharmony_ci this stream 12405bd8deadSopenharmony_ci 12415bd8deadSopenharmony_ci VIDEO_BUFFER_PITCH_NV Z+ GetVideoCaptureStreamiv See sec. 4.5 Pitch of 4.5 - 12425bd8deadSopenharmony_ci video 12435bd8deadSopenharmony_ci capture 12445bd8deadSopenharmony_ci buffers 12455bd8deadSopenharmony_ci bound to 12465bd8deadSopenharmony_ci this stream 12475bd8deadSopenharmony_ci 12485bd8deadSopenharmony_ci VIDEO_CAPTURE_FRAME_WIDTH_NV Z+ GetVideoCaptureStreamiv See sec. 4.5 width of 4.5 - 12495bd8deadSopenharmony_ci a frame or 12505bd8deadSopenharmony_ci field on 12515bd8deadSopenharmony_ci currently 12525bd8deadSopenharmony_ci bound video 12535bd8deadSopenharmony_ci capture 12545bd8deadSopenharmony_ci device. 12555bd8deadSopenharmony_ci 12565bd8deadSopenharmony_ci VIDEO_CAPTURE_FRAME_HEIGHT_NV Z+ GetVideoCaptureStreamiv See sec. 4.5 height of 4.5 - 12575bd8deadSopenharmony_ci a full frame 12585bd8deadSopenharmony_ci on currently 12595bd8deadSopenharmony_ci bound video 12605bd8deadSopenharmony_ci capture 12615bd8deadSopenharmony_ci device. 12625bd8deadSopenharmony_ci 12635bd8deadSopenharmony_ci VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV Z+ GetVideoCaptureStreamiv See sec. 4.5 height of 4.5 - 12645bd8deadSopenharmony_ci upper field 12655bd8deadSopenharmony_ci on currently 12665bd8deadSopenharmony_ci bound video 12675bd8deadSopenharmony_ci capture 12685bd8deadSopenharmony_ci device. 12695bd8deadSopenharmony_ci 12705bd8deadSopenharmony_ci VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV Z+ GetVideoCaptureStreamiv See sec. 4.5 height of 4.5 - 12715bd8deadSopenharmony_ci lower field 12725bd8deadSopenharmony_ci on currently 12735bd8deadSopenharmony_ci bound video 12745bd8deadSopenharmony_ci capture 12755bd8deadSopenharmony_ci device. 12765bd8deadSopenharmony_ci 12775bd8deadSopenharmony_ci VIDEO_CAPTURE_SURFACE_ORIGIN_NV Z2 GetVideoCaptureStreamiv LOWER_LEFT orientation 4.5 - 12785bd8deadSopenharmony_ci of captured 12795bd8deadSopenharmony_ci video image 12805bd8deadSopenharmony_ci 12815bd8deadSopenharmony_ci VIDEO_CAPTURE_TO_422_SUPPORTED_NV B GetVideoCaptureStreamiv See sec 4.5 support for 4.5 - 12825bd8deadSopenharmony_ci 4:2:2 or 12835bd8deadSopenharmony_ci 4:2:2:4 12845bd8deadSopenharmony_ci capture. 12855bd8deadSopenharmony_ci 12865bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MATRIX_NV M4 GetVideoCaptureStreamfv Identity Color 4.5 - 12875bd8deadSopenharmony_ci Matrix Conversion 12885bd8deadSopenharmony_ci Matrix 12895bd8deadSopenharmony_ci 12905bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MAX_NV R4 GetVideoCaptureStreamfv <1,1,1,1> Color 4.5 - 12915bd8deadSopenharmony_ci Conversion 12925bd8deadSopenharmony_ci Clamp Max 12935bd8deadSopenharmony_ci 12945bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_MIN_NV R4 GetVideoCaptureStreamfv <0,0,0,0> Color 4.5 - 12955bd8deadSopenharmony_ci Conversion 12965bd8deadSopenharmony_ci Clamp Min 12975bd8deadSopenharmony_ci 12985bd8deadSopenharmony_ci VIDEO_COLOR_CONVERSION_OFFEST_NV R4 GetVideoCaptureStreamfv <0,0,0,0> Color 4.5 - 12995bd8deadSopenharmony_ci Conversion 13005bd8deadSopenharmony_ci Offset 13015bd8deadSopenharmony_ci 13025bd8deadSopenharmony_ci - Z+ - 0 name of 4.5 - 13035bd8deadSopenharmony_ci object bound 13045bd8deadSopenharmony_ci to frame 13055bd8deadSopenharmony_ci or upper 13065bd8deadSopenharmony_ci field 13075bd8deadSopenharmony_ci 13085bd8deadSopenharmony_ci - Z+ - 0 name of 4.5 - 13095bd8deadSopenharmony_ci object bound 13105bd8deadSopenharmony_ci to lower 13115bd8deadSopenharmony_ci field 13125bd8deadSopenharmony_ci 13135bd8deadSopenharmony_ci - B - - Is a frame 4.5 - 13145bd8deadSopenharmony_ci or fields 13155bd8deadSopenharmony_ci bound. 13165bd8deadSopenharmony_ci 13175bd8deadSopenharmony_ci Table 6.47. Video Capture Stream State 13185bd8deadSopenharmony_ci 13195bd8deadSopenharmony_ciNew Implementation Dependent State 13205bd8deadSopenharmony_ci 13215bd8deadSopenharmony_ci(Table 6.50, p. 388) 13225bd8deadSopenharmony_ci 13235bd8deadSopenharmony_ci Get Initial 13245bd8deadSopenharmony_ci Get Value Type Command Value Description Sec. Attribute 13255bd8deadSopenharmony_ci ---------------------------- ---- ----------------- ------------ ------------- ---- --------- 13265bd8deadSopenharmony_ci NUM_VIDEO_CAPTURE_STREAMS_NV Z+ GetVideoCaptureiv See Sec. 4.5 Number of 4.5 - 13275bd8deadSopenharmony_ci video capture 13285bd8deadSopenharmony_ci streams on 13295bd8deadSopenharmony_ci this video 13305bd8deadSopenharmony_ci capture slot 13315bd8deadSopenharmony_ci 13325bd8deadSopenharmony_ciUsage Examples: 13335bd8deadSopenharmony_ci 13345bd8deadSopenharmony_ci This example demonstrates binding a video capture device to a 13355bd8deadSopenharmony_ci GLX context. 13365bd8deadSopenharmony_ci 13375bd8deadSopenharmony_ci GLXVideoCaptureDevice *devices; 13385bd8deadSopenharmony_ci GLXVideoCaptureDevice device; 13395bd8deadSopenharmony_ci int numDevices; 13405bd8deadSopenharmony_ci 13415bd8deadSopenharmony_ci devices = glXEnumerateVideoCaptureDevicesNV(dpy, 0, 13425bd8deadSopenharmony_ci &numDevices); 13435bd8deadSopenharmony_ci 13445bd8deadSopenharmony_ci // Assumes at least 1 device is available and is not locked. 13455bd8deadSopenharmony_ci device = devices[0]; 13465bd8deadSopenharmony_ci XFree(devices); 13475bd8deadSopenharmony_ci 13485bd8deadSopenharmony_ci glXLockVideoCaptureDeviceNV(dpy, device); 13495bd8deadSopenharmony_ci 13505bd8deadSopenharmony_ci glXBindVideoCaptureDeviceNV(dpy, 1, device); 13515bd8deadSopenharmony_ci 13525bd8deadSopenharmony_ci BeginVideoCaptureNV(1); 13535bd8deadSopenharmony_ci 13545bd8deadSopenharmony_ci while (use_device) { 13555bd8deadSopenharmony_ci // Do main capture loop here. 13565bd8deadSopenharmony_ci } 13575bd8deadSopenharmony_ci 13585bd8deadSopenharmony_ci EndVideoCaptureNV(1); 13595bd8deadSopenharmony_ci 13605bd8deadSopenharmony_ci // Unbind and release the capture device. 13615bd8deadSopenharmony_ci glXBindVideoCaptureDeviceNV(dpy, 1, None); 13625bd8deadSopenharmony_ci 13635bd8deadSopenharmony_ci glXReleaseVideoCaptureDeviceNV(dpy, device); 13645bd8deadSopenharmony_ci 13655bd8deadSopenharmony_ci 13665bd8deadSopenharmony_ci This example demonstrates capturing 1080p video data from two 13675bd8deadSopenharmony_ci sources, streaming the first to system memory, and displaying the 13685bd8deadSopenharmony_ci second with the NV_present_video extension. It assumes video 13695bd8deadSopenharmony_ci capture and video output devices are already bound to the current 13705bd8deadSopenharmony_ci context. 13715bd8deadSopenharmony_ci 13725bd8deadSopenharmony_ci uint video_out_buffer; 13735bd8deadSopenharmony_ci uint video_out_texture; 13745bd8deadSopenharmony_ci int buffer_pitch; 13755bd8deadSopenharmony_ci int video_buffer_format = RGB8; 13765bd8deadSopenharmony_ci 13775bd8deadSopenharmony_ci // Create a video output buffer object. 13785bd8deadSopenharmony_ci GenBuffersARB(1, &video_out_buffer); 13795bd8deadSopenharmony_ci 13805bd8deadSopenharmony_ci // Create and init a video output texture object. 13815bd8deadSopenharmony_ci GenTextures(1, &video_out_texture); 13825bd8deadSopenharmony_ci BindTexture(TEXTURE_2D, video_out_texture); 13835bd8deadSopenharmony_ci TexImage2D(TEXTURE_2D, 0, RGB8, 1920, 1080, 0, RGB, BYTE, NULL); 13845bd8deadSopenharmony_ci 13855bd8deadSopenharmony_ci // Set up the outputs for stream 0. 13865bd8deadSopenharmony_ci // Set the buffer object data format. 13875bd8deadSopenharmony_ci VideoCaptureStreamParameterivNV(1, 0, 13885bd8deadSopenharmony_ci VIDEO_BUFFER_INTERNAL_FORMAT_NV, 13895bd8deadSopenharmony_ci &video_buffer_format); 13905bd8deadSopenharmony_ci 13915bd8deadSopenharmony_ci // Get the video buffer pitch 13925bd8deadSopenharmony_ci GetVideoCaptureStreamivNV(1, 0, VIDEO_BUFFER_PITCH_NV, 13935bd8deadSopenharmony_ci &buffer_pitch); 13945bd8deadSopenharmony_ci 13955bd8deadSopenharmony_ci // Allocate space in the buffer object. 13965bd8deadSopenharmony_ci BindBufferARB(VIDEO_BUFFER_NV, video_out_buffer); 13975bd8deadSopenharmony_ci BufferDataARB(VIDEO_BUFFER_NV, buffer_pitch * 1080, NULL, 13985bd8deadSopenharmony_ci STREAM_READ_ARB); 13995bd8deadSopenharmony_ci 14005bd8deadSopenharmony_ci // Bind the buffer object to the video capture stream. 14015bd8deadSopenharmony_ci BindVideoCaptureStreamBufferNV(1, 0, FRAME_NV, 0); 14025bd8deadSopenharmony_ci 14035bd8deadSopenharmony_ci // Bind the outputs for stream 1 14045bd8deadSopenharmony_ci BindVideoCaptureStreamTextureNV(1, 1, FRAME_NV, GL_TEXTURE_2D, 14055bd8deadSopenharmony_ci video_out_texture); 14065bd8deadSopenharmony_ci 14075bd8deadSopenharmony_ci // Start the capture process 14085bd8deadSopenharmony_ci BeginVideoCaptureNV(1); 14095bd8deadSopenharmony_ci 14105bd8deadSopenharmony_ci // Loop capturing data 14115bd8deadSopenharmony_ci while (...) { 14125bd8deadSopenharmony_ci uint64EXT timestamp; 14135bd8deadSopenharmony_ci uint sequence_num; 14145bd8deadSopenharmony_ci 14155bd8deadSopenharmony_ci // Capture the video to a buffer object 14165bd8deadSopenharmony_ci VideoCaptureNV(1, &sequence_num, ×tamp); 14175bd8deadSopenharmony_ci 14185bd8deadSopenharmony_ci // Pull stream 0's video data back to local memory 14195bd8deadSopenharmony_ci BindBufferARB(VIDEO_BUFFER_NV, video_out_buffer); 14205bd8deadSopenharmony_ci GetBufferSubDataARB(VIDEO_BUFFER_NV, 0, buffer_pitch * 1080, 14215bd8deadSopenharmony_ci someMallocMem1); 14225bd8deadSopenharmony_ci 14235bd8deadSopenharmony_ci // Present stream 1's video data using NV_present_video 14245bd8deadSopenharmony_ci PresentFrameKeyedNV(1, 0, 0, 0, GL_FRAME_NV, 14255bd8deadSopenharmony_ci GL_TEXTURE_2D, video_out_texture, 0, 14265bd8deadSopenharmony_ci GL_NONE, 0, 0); 14275bd8deadSopenharmony_ci 14285bd8deadSopenharmony_ci // Do something with the data in someMallocMem1 here, 14295bd8deadSopenharmony_ci // such as save it to disk. 14305bd8deadSopenharmony_ci } 14315bd8deadSopenharmony_ci 14325bd8deadSopenharmony_ci // Pause/Stop capturing. 14335bd8deadSopenharmony_ci EndVideoCaptureNV(1); 14345bd8deadSopenharmony_ci 14355bd8deadSopenharmony_ciIssues 14365bd8deadSopenharmony_ci 14375bd8deadSopenharmony_ci Should there be separate bind points for each input stream 14385bd8deadSopenharmony_ci rather than having BindVideoCaptureStreamBufferNV? 14395bd8deadSopenharmony_ci 14405bd8deadSopenharmony_ci [RESOLVED] No. BindVideoCaptureStreamBufferNV makes it simpler 14415bd8deadSopenharmony_ci to use an implementation-dependent number of streams and 14425bd8deadSopenharmony_ci reduces the number of tokens introduced. The downside is one 14435bd8deadSopenharmony_ci extra step for the application at setup time, and possibly one 14445bd8deadSopenharmony_ci extra step in the loop. 14455bd8deadSopenharmony_ci 14465bd8deadSopenharmony_ci Should VideoCaptureNV return values, making it synchronize the 14475bd8deadSopenharmony_ci client and server, or generate asynchronous query results? 14485bd8deadSopenharmony_ci 14495bd8deadSopenharmony_ci [RESOLVED] VideoCaptureNV will return a status code and other 14505bd8deadSopenharmony_ci capture statistics immediately. The application will likely need 14515bd8deadSopenharmony_ci to use these values to decide how to use the captured data. 14525bd8deadSopenharmony_ci 14535bd8deadSopenharmony_ci How should video capture devices be presented to the application? 14545bd8deadSopenharmony_ci 14555bd8deadSopenharmony_ci [RESOLVED] In GLX, video capture devices are X resources 14565bd8deadSopenharmony_ci with their own XID. Device enumeration returns a list of XIDs to 14575bd8deadSopenharmony_ci the application. The application can query the unique ID of the 14585bd8deadSopenharmony_ci underlying physical device associated with the XID. 14595bd8deadSopenharmony_ci 14605bd8deadSopenharmony_ci In WGL, handles to the physical devices are returned. 14615bd8deadSopenharmony_ci 14625bd8deadSopenharmony_ci There may be many X resources or windows handles referring to the 14635bd8deadSopenharmony_ci same video device, but only one X client or handle at a time 14645bd8deadSopenharmony_ci can own the physical device. This is accomplished with the lock 14655bd8deadSopenharmony_ci and release entry points. 14665bd8deadSopenharmony_ci 14675bd8deadSopenharmony_ci How does the application determine if a given capture operation 14685bd8deadSopenharmony_ci returned valid data. 14695bd8deadSopenharmony_ci 14705bd8deadSopenharmony_ci [RESOLVED] VideoCaptureNV will have an enum return value 14715bd8deadSopenharmony_ci that specifies the overall status of the capture. It will be 14725bd8deadSopenharmony_ci able to indicate success, partial success (some streams captured 14735bd8deadSopenharmony_ci valid data), or failure (no streams captured valid data). The 14745bd8deadSopenharmony_ci user can then query the individual streams to determine if they 14755bd8deadSopenharmony_ci captured valid data on the last capture call. 14765bd8deadSopenharmony_ci 14775bd8deadSopenharmony_ci The capture process involves a colorspace transformation in which 14785bd8deadSopenharmony_ci the user can specify a conversion matrix. Should this matrix be 14795bd8deadSopenharmony_ci configurable per-stream or is per-video-capture device sufficient? 14805bd8deadSopenharmony_ci 14815bd8deadSopenharmony_ci [RESOLVED] Per-stream matrices will be used. This could be 14825bd8deadSopenharmony_ci useful if the devices connected to each stream have different 14835bd8deadSopenharmony_ci color characteristics and therefore each need different 14845bd8deadSopenharmony_ci conversion matrices. 14855bd8deadSopenharmony_ci 14865bd8deadSopenharmony_ci Should there be a way to specify color clamp values for each stream 14875bd8deadSopenharmony_ci and each color component? 14885bd8deadSopenharmony_ci 14895bd8deadSopenharmony_ci [RESOLVED] Yes. Some video specifications require color data to 14905bd8deadSopenharmony_ci be in a certain range, so clamping is needed. 14915bd8deadSopenharmony_ci 14925bd8deadSopenharmony_ci How do the color conversion parameters affect captured data when 14935bd8deadSopenharmony_ci using a 4:2:2 capture format? 14945bd8deadSopenharmony_ci 14955bd8deadSopenharmony_ci [RESOLVED] The color conversion step is skipped when the 14965bd8deadSopenharmony_ci destination format is listed in table 4.13 or the effective 14975bd8deadSopenharmony_ci capture data format layout isn't 4:4:4 or 4:4:4:4. 14985bd8deadSopenharmony_ci 14995bd8deadSopenharmony_ci Does video capture slot state belong to the context or the video 15005bd8deadSopenharmony_ci capture device. 15015bd8deadSopenharmony_ci 15025bd8deadSopenharmony_ci [RESOLVED] The video capture state lives in the context. Setting 15035bd8deadSopenharmony_ci video capture slot state does not affect the video capture device 15045bd8deadSopenharmony_ci itself. Any video capture slot state that affects the video 15055bd8deadSopenharmony_ci capture hardware will be applied to the hardware when the device 15065bd8deadSopenharmony_ci is bound to the slot. 15075bd8deadSopenharmony_ci 15085bd8deadSopenharmony_ci What happens to video capture slot state when a device is unbound, 15095bd8deadSopenharmony_ci or, does video capture slot state persist across device bindings? 15105bd8deadSopenharmony_ci 15115bd8deadSopenharmony_ci [RESOLVED] Since much of the video capture slot state depends on 15125bd8deadSopenharmony_ci the currently bound device, the state should be reset to default 15135bd8deadSopenharmony_ci values whenever a device is bound. 15145bd8deadSopenharmony_ci 15155bd8deadSopenharmony_ci Is video capture slot state defined when no device is bound to the 15165bd8deadSopenharmony_ci slot? Should querying video capture slot state when no device is 15175bd8deadSopenharmony_ci bound generate an error? 15185bd8deadSopenharmony_ci 15195bd8deadSopenharmony_ci [RESOLVED] Much of the state only has meaning when a device is 15205bd8deadSopenharmony_ci bound. For example, the number of streams depends on how many 15215bd8deadSopenharmony_ci streams the bound device exposes. Because of this, querying 15225bd8deadSopenharmony_ci video capture state on a slot with no bound device should 15235bd8deadSopenharmony_ci generate an INVALID_OPERATION error. This operation would 15245bd8deadSopenharmony_ci essentially be the video capture equivalent of making GL calls 15255bd8deadSopenharmony_ci without a current context. 15265bd8deadSopenharmony_ci 15275bd8deadSopenharmony_ci What should the default values for all the video capture per-slot 15285bd8deadSopenharmony_ci and per-stream state be? 15295bd8deadSopenharmony_ci 15305bd8deadSopenharmony_ci [RESOLVED] Initial values have been specified in the spec and 15315bd8deadSopenharmony_ci the state tables. 15325bd8deadSopenharmony_ci 15335bd8deadSopenharmony_ci 15345bd8deadSopenharmony_ciRevision History 15355bd8deadSopenharmony_ci Fifth external draft: 2011/7/8 15365bd8deadSopenharmony_ci -Fixed video slots used in second usage example 15375bd8deadSopenharmony_ci 15385bd8deadSopenharmony_ci Fourth external draft: 2009/9/28 15395bd8deadSopenharmony_ci -Added "New Types" section 15405bd8deadSopenharmony_ci 15415bd8deadSopenharmony_ci Third external draft: 2009/9/8 15425bd8deadSopenharmony_ci 15435bd8deadSopenharmony_ci Second external draft: 2009/7/31 15445bd8deadSopenharmony_ci 15455bd8deadSopenharmony_ci First external draft: 2009/2/23 1546