00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _NVBUF_UTILS_H_
00017 #define _NVBUF_UTILS_H_
00018
00019 #ifdef __cplusplus
00020 extern "C"
00021 {
00022 #endif
00023
00024 #include <EGL/egl.h>
00025 #include <EGL/eglext.h>
00026 #include <errno.h>
00027
00028 #define MAX_NUM_PLANES 3
00029
00030 typedef enum
00031 {
00032 NvBufferLayout_Pitch,
00033 NvBufferLayout_BlockLinear,
00034 } NvBufferLayout;
00035
00036 typedef enum
00037 {
00038 NvBufferColorFormat_YUV420,
00039 NvBufferColorFormat_YVU420,
00040 NvBufferColorFormat_NV12,
00041 NvBufferColorFormat_NV21,
00042 NvBufferColorFormat_UYVY,
00043 NvBufferColorFormat_ABGR32,
00044 NvBufferColorFormat_XRGB32,
00045 NvBufferColorFormat_Invalid,
00046 } NvBufferColorFormat;
00047
00048 typedef struct _NvBufferParams
00049 {
00050 uint32_t dmabuf_fd;
00051 void *nv_buffer;
00052 uint32_t nv_buffer_size;
00053 uint32_t pixel_format;
00054 uint32_t num_planes;
00055 uint32_t width[MAX_NUM_PLANES];
00056 uint32_t height[MAX_NUM_PLANES];
00057 uint32_t pitch[MAX_NUM_PLANES];
00058 uint32_t offset[MAX_NUM_PLANES];
00059 }NvBufferParams;
00060
00061
00062
00063
00064
00065
00066
00067
00068 EGLImageKHR NvEGLImageFromFd (EGLDisplay display, int dmabuf_fd);
00069
00070
00071
00072
00073
00074
00075
00076
00077 int NvDestroyEGLImage (EGLDisplay display, EGLImageKHR eglImage);
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 int NvBufferCreate (int *dmabuf_fd, int width, int height,
00090 NvBufferLayout layout, NvBufferColorFormat colorFormat);
00091
00092
00093
00094
00095
00096
00097
00098
00099 int NvBufferGetParams (int dmabuf_fd, NvBufferParams *params);
00100
00101
00102
00103
00104
00105
00106
00107 int NvBufferDestroy (int dmabuf_fd);
00108
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112
00113 #endif