-
Notifications
You must be signed in to change notification settings - Fork 0
/
cuda_rtsp.h
87 lines (64 loc) · 1.95 KB
/
cuda_rtsp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef CUDA_RTSP_H
#define CUDA_RTSP_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdbool.h>
#include <cuda.h>
#ifdef CU_RTSP_EXPOSE_GMAIN
#include <glib/gmain.h>
#endif
typedef struct CUrtsp_server_st *CUrtsp_server;
typedef struct CUrtsp_session_st *CUrtsp_session;
#define CU_RTSP_DEFAULT_PORT 8554
typedef enum CUrtsp_format_enum
{
CU_RTSP_FORMAT_NV12,
CU_RTSP_FORMAT_YV12,
CU_RTSP_FORMAT_I420,
CU_RTSP_FORMAT_BGRA,
CU_RTSP_FORMAT_RGBA,
CU_RTSP_FORMAT_Y444,
CU_RTSP_FORMAT_VUYA,
CU_RTSP_FORMAT_ARGB,
CU_RTSP_FORMAT_ABGR,
CU_RTSP_FORMAT_BGR,
CU_RTSP_FORMAT_RGB,
} CUrtsp_format;
typedef void(CUDA_CB *CUrtspWriteCallback)(CUdeviceptr, size_t, void *);
typedef struct CUDA_RTSP_SERVER_st
{
const char *host;
uint16_t port;
} CUDA_RTSP_SERVER;
typedef struct CUDA_RTSP_SESSION_st
{
CUdevice device;
CUcontext context;
size_t width;
size_t height;
CUrtsp_format format;
size_t fpsNum;
size_t fpsDen;
bool live;
CUrtspWriteCallback writeCallback;
void *userData;
} CUDA_RTSP_SESSION;
void cuRTSPInit();
void cuRTSPDeinit();
const char *cuRTSPGetError();
CUresult cuRTSPServerCreate(CUrtsp_server *pServer, const CUDA_RTSP_SERVER *pCreateServer);
void cuRTSPServerDestroy(CUrtsp_server hServer);
CUresult cuRTSPServerAttach(CUrtsp_server hServer);
void cuRTSPServerDispatch(CUrtsp_server hServer);
void cuRTSPServerShutdown(CUrtsp_server hServer);
#ifdef CU_RTSP_EXPOSE_GMAIN
CUresult cuRTSPServerAttachGMain(CUrtsp_server hServer, GMainContext *context);
#endif
CUresult cuRTSPSessionCreate(CUrtsp_session *pSession, const CUDA_RTSP_SESSION *pCreateSession);
CUresult cuRTSPSessionMount(CUrtsp_session hSession, CUrtsp_server hServer, const char *path);
#ifdef __cplusplus
}
#endif
#endif