/dvs/p4/build/sw/gpgpu/bin/x86_64_Linux_release/stub/cudaEGL.h

File members: /dvs/p4/build/sw/gpgpu/bin/x86_64_Linux_release/stub/cudaEGL.h

/*
 * Copyright 2014 NVIDIA Corporation.  All rights reserved.
 *
 * NOTICE TO LICENSEE:
 *
 * This source code and/or documentation ("Licensed Deliverables") are
 * subject to NVIDIA intellectual property rights under U.S. and
 * international Copyright laws.
 *
 * These Licensed Deliverables contained herein is PROPRIETARY and
 * CONFIDENTIAL to NVIDIA and is being provided under the terms and
 * conditions of a form of NVIDIA software license agreement by and
 * between NVIDIA and Licensee ("License Agreement") or electronically
 * accepted by Licensee.  Notwithstanding any terms or conditions to
 * the contrary in the License Agreement, reproduction or disclosure
 * of the Licensed Deliverables to any third party without the express
 * written consent of NVIDIA is prohibited.
 *
 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
 * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
 * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE.  IT IS
 * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
 * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
 * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
 * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
 * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
 * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
 * OF THESE LICENSED DELIVERABLES.
 *
 * U.S. Government End Users.  These Licensed Deliverables are a
 * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
 * 1995), consisting of "commercial computer software" and "commercial
 * computer software documentation" as such terms are used in 48
 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
 * only as a commercial end item.  Consistent with 48 C.F.R.12.212 and
 * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
 * U.S. Government End Users acquire the Licensed Deliverables with
 * only those rights set forth herein.
 *
 * Any use of the Licensed Deliverables in individual and commercial
 * software must include, in the user documentation and internal
 * comments to the code, the above Disclaimer and U.S. Government End
 * Users Notice.
 */

#ifndef CUDAEGL_H
#define CUDAEGL_H

#include "cuda.h"
#include "EGL/egl.h"
#include "EGL/eglext.h"

#ifdef CUDA_FORCE_API_VERSION
#error "CUDA_FORCE_API_VERSION is no longer supported."
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define MAX_PLANES 3

typedef enum CUeglFrameType_enum {
    CU_EGL_FRAME_TYPE_ARRAY = 0,
    CU_EGL_FRAME_TYPE_PITCH = 1,
} CUeglFrameType;

#define CUDA_EGL_INFINITE_TIMEOUT 0xFFFFFFFF

typedef enum CUeglResourceLocationFlags_enum {
    CU_EGL_RESOURCE_LOCATION_SYSMEM   = 0x00,
    CU_EGL_RESOURCE_LOCATION_VIDMEM   = 0x01
} CUeglResourceLocationFlags;

typedef enum CUeglColorFormat_enum {
    CU_EGL_COLOR_FORMAT_YUV420_PLANAR              = 0x00,
    CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR          = 0x01,
    CU_EGL_COLOR_FORMAT_YUV422_PLANAR              = 0x02,
    CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR          = 0x03,
    CU_EGL_COLOR_FORMAT_RGB                        = 0x04,
    CU_EGL_COLOR_FORMAT_BGR                        = 0x05,
    CU_EGL_COLOR_FORMAT_ARGB                       = 0x06,
    CU_EGL_COLOR_FORMAT_RGBA                       = 0x07,
    CU_EGL_COLOR_FORMAT_L                          = 0x08,
    CU_EGL_COLOR_FORMAT_R                          = 0x09,
    CU_EGL_COLOR_FORMAT_YUV444_PLANAR              = 0x0A,
    CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR          = 0x0B,
    CU_EGL_COLOR_FORMAT_YUYV_422                   = 0x0C,
    CU_EGL_COLOR_FORMAT_UYVY_422                   = 0x0D,
    CU_EGL_COLOR_FORMAT_ABGR                       = 0x0E,
    CU_EGL_COLOR_FORMAT_BGRA                       = 0x0F,
    CU_EGL_COLOR_FORMAT_A                          = 0x10,
    CU_EGL_COLOR_FORMAT_RG                         = 0x11,
    CU_EGL_COLOR_FORMAT_AYUV                       = 0x12,
    CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR          = 0x13,
    CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR          = 0x14,
    CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR          = 0x15,
    CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR   = 0x16,
    CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR   = 0x17,
    CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR   = 0x18,
    CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR   = 0x19,
    CU_EGL_COLOR_FORMAT_VYUY_ER                    = 0x1A,
    CU_EGL_COLOR_FORMAT_UYVY_ER                    = 0x1B,
    CU_EGL_COLOR_FORMAT_YUYV_ER                    = 0x1C,
    CU_EGL_COLOR_FORMAT_YVYU_ER                    = 0x1D,
    CU_EGL_COLOR_FORMAT_YUV_ER                     = 0x1E,
    CU_EGL_COLOR_FORMAT_YUVA_ER                    = 0x1F,
    CU_EGL_COLOR_FORMAT_AYUV_ER                    = 0x20,
    CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER           = 0x21,
    CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER           = 0x22,
    CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER           = 0x23,
    CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER       = 0x24,
    CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER       = 0x25,
    CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER       = 0x26,
    CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER           = 0x27,
    CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER           = 0x28,
    CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER           = 0x29,
    CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER       = 0x2A,
    CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER       = 0x2B,
    CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER       = 0x2C,
    CU_EGL_COLOR_FORMAT_BAYER_RGGB                 = 0x2D,
    CU_EGL_COLOR_FORMAT_BAYER_BGGR                 = 0x2E,
    CU_EGL_COLOR_FORMAT_BAYER_GRBG                 = 0x2F,
    CU_EGL_COLOR_FORMAT_BAYER_GBRG                 = 0x30,
    CU_EGL_COLOR_FORMAT_BAYER10_RGGB               = 0x31,
    CU_EGL_COLOR_FORMAT_BAYER10_BGGR               = 0x32,
    CU_EGL_COLOR_FORMAT_BAYER10_GRBG               = 0x33,
    CU_EGL_COLOR_FORMAT_BAYER10_GBRG               = 0x34,
    CU_EGL_COLOR_FORMAT_BAYER12_RGGB               = 0x35,
    CU_EGL_COLOR_FORMAT_BAYER12_BGGR               = 0x36,
    CU_EGL_COLOR_FORMAT_BAYER12_GRBG               = 0x37,
    CU_EGL_COLOR_FORMAT_BAYER12_GBRG               = 0x38,
    CU_EGL_COLOR_FORMAT_BAYER14_RGGB               = 0x39,
    CU_EGL_COLOR_FORMAT_BAYER14_BGGR               = 0x3A,
    CU_EGL_COLOR_FORMAT_BAYER14_GRBG               = 0x3B,
    CU_EGL_COLOR_FORMAT_BAYER14_GBRG               = 0x3C,
    CU_EGL_COLOR_FORMAT_BAYER20_RGGB               = 0x3D,
    CU_EGL_COLOR_FORMAT_BAYER20_BGGR               = 0x3E,
    CU_EGL_COLOR_FORMAT_BAYER20_GRBG               = 0x3F,
    CU_EGL_COLOR_FORMAT_BAYER20_GBRG               = 0x40,
    CU_EGL_COLOR_FORMAT_YVU444_PLANAR              = 0x41,
    CU_EGL_COLOR_FORMAT_YVU422_PLANAR              = 0x42,
    CU_EGL_COLOR_FORMAT_YVU420_PLANAR              = 0x43,
    CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB             = 0x44,
    CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR             = 0x45,
    CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG             = 0x46,
    CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG             = 0x47,
    CU_EGL_COLOR_FORMAT_BAYER_BCCR                 = 0x48,
    CU_EGL_COLOR_FORMAT_BAYER_RCCB                 = 0x49,
    CU_EGL_COLOR_FORMAT_BAYER_CRBC                 = 0x4A,
    CU_EGL_COLOR_FORMAT_BAYER_CBRC                 = 0x4B,
    CU_EGL_COLOR_FORMAT_BAYER10_CCCC               = 0x4C,
    CU_EGL_COLOR_FORMAT_BAYER12_BCCR               = 0x4D,
    CU_EGL_COLOR_FORMAT_BAYER12_RCCB               = 0x4E,
    CU_EGL_COLOR_FORMAT_BAYER12_CRBC               = 0x4F,
    CU_EGL_COLOR_FORMAT_BAYER12_CBRC               = 0x50,
    CU_EGL_COLOR_FORMAT_BAYER12_CCCC               = 0x51,
    CU_EGL_COLOR_FORMAT_Y                          = 0x52,
    CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020     = 0x53,
    CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020     = 0x54,
    CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020         = 0x55,
    CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020         = 0x56,
    CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709      = 0x57,
    CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709      = 0x58,
    CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709          = 0x59,
    CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709          = 0x5A,
    CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709  = 0x5B,
    CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 = 0x5C,
    CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 = 0x5D,
    CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR      = 0x5E,
    CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709  = 0x5F,
    CU_EGL_COLOR_FORMAT_Y_ER                          = 0x60,
    CU_EGL_COLOR_FORMAT_Y_709_ER                      = 0x61,
    CU_EGL_COLOR_FORMAT_Y10_ER                        = 0x62,
    CU_EGL_COLOR_FORMAT_Y10_709_ER                    = 0x63,
    CU_EGL_COLOR_FORMAT_Y12_ER                        = 0x64,
    CU_EGL_COLOR_FORMAT_Y12_709_ER                    = 0x65,
    CU_EGL_COLOR_FORMAT_YUVA                          = 0x66,
    CU_EGL_COLOR_FORMAT_YUV                           = 0x67,
    CU_EGL_COLOR_FORMAT_YVYU                          = 0x68,
    CU_EGL_COLOR_FORMAT_VYUY                          = 0x69,
    CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER     = 0x6A,
    CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER = 0x6B,
    CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER     = 0x6C,
    CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER = 0x6D,
    CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER     = 0x6E,
    CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER = 0x6F,
    CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER     = 0x70,
    CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER = 0x71,
    CU_EGL_COLOR_FORMAT_UYVY_709                        = 0x72,
    CU_EGL_COLOR_FORMAT_UYVY_709_ER                     = 0x73,
    CU_EGL_COLOR_FORMAT_UYVY_2020                       = 0x74,
    CU_EGL_COLOR_FORMAT_MAX
} CUeglColorFormat;

typedef struct CUeglFrame_st {
    union {
        CUarray pArray[MAX_PLANES];
        void*   pPitch[MAX_PLANES];
    } frame;
    unsigned int width;
    unsigned int height;
    unsigned int depth;
    unsigned int pitch;
    unsigned int planeCount;
    unsigned int numChannels;
    CUeglFrameType frameType;
    CUeglColorFormat eglColorFormat;
    CUarray_format cuFormat;
} CUeglFrame_v1;
typedef CUeglFrame_v1 CUeglFrame;

typedef struct CUeglStreamConnection_st* CUeglStreamConnection;
 /* END CUDA_TYPES */

CUresult CUDAAPI cuGraphicsEGLRegisterImage(CUgraphicsResource *pCudaResource, EGLImageKHR image, unsigned int flags);

CUresult CUDAAPI cuEGLStreamConsumerConnect(CUeglStreamConnection *conn, EGLStreamKHR stream);

CUresult CUDAAPI cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection *conn, EGLStreamKHR stream, unsigned int flags);

CUresult CUDAAPI cuEGLStreamConsumerDisconnect(CUeglStreamConnection *conn);

CUresult CUDAAPI cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection *conn,
                                                  CUgraphicsResource *pCudaResource, CUstream *pStream, unsigned int timeout);
CUresult CUDAAPI cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection *conn,
                                                  CUgraphicsResource pCudaResource, CUstream *pStream);

CUresult CUDAAPI cuEGLStreamProducerConnect(CUeglStreamConnection *conn, EGLStreamKHR stream,
                                             EGLint width, EGLint height);

CUresult CUDAAPI cuEGLStreamProducerDisconnect(CUeglStreamConnection *conn);

CUresult CUDAAPI cuEGLStreamProducerPresentFrame(CUeglStreamConnection *conn,
                                                 CUeglFrame eglframe, CUstream *pStream);

CUresult CUDAAPI cuEGLStreamProducerReturnFrame(CUeglStreamConnection *conn,
                                                CUeglFrame *eglframe, CUstream *pStream);

CUresult CUDAAPI cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel);

CUresult CUDAAPI cuEventCreateFromEGLSync(CUevent *phEvent, EGLSyncKHR eglSync, unsigned int flags);
 /* END CUDA_EGL */

#ifdef __cplusplus
};
#endif

#endif