123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- #ifndef __NV_BUF_SURFACE_H__
- #define __NV_BUF_SURFACE_H__
- #include <errno.h>
- #include <fstream>
- #include <iostream>
- #include <linux/videodev2.h>
- #include <malloc.h>
- #include <pthread.h>
- #include <string.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <poll.h>
- #include "nvbufsurface.h"
- #include "nvbufsurftransform.h"
- class NvBufSurf
- {
- public:
- typedef struct {
-
- uint32_t src_width;
-
- uint32_t src_height;
-
- uint32_t src_top;
-
- uint32_t src_left;
-
- uint32_t dst_width;
-
- uint32_t dst_height;
-
- uint32_t dst_top;
-
- uint32_t dst_left;
-
- NvBufSurfTransform_Transform_Flag flag;
-
- NvBufSurfTransform_Flip flip;
-
- NvBufSurfTransform_Inter filter;
- } NvCommonTransformParams;
- typedef struct {
-
- uint32_t width;
-
- uint32_t height;
-
- NvBufSurfaceColorFormat colorFormat;
-
- NvBufSurfaceLayout layout;
-
- NvBufSurfaceMemType memType;
-
- NvBufSurfaceTag memtag;
- } NvCommonAllocateParams;
-
- static int NvDestroy(int fd);
-
- static int NvAllocate(NvCommonAllocateParams *allocateParams, uint32_t numBuffers, int *fd);
-
- static int NvTransform(NvCommonTransformParams *transformParams, int src_fd, int dst_fd);
- static int NvTransformAsync(NvCommonTransformParams *transformParams, NvBufSurfTransformSyncObj_t *sync_obj, int src_fd, int dst_fd);
- };
- #endif
|