-
Notifications
You must be signed in to change notification settings - Fork 201
/
nvmpi.h
90 lines (70 loc) · 1.93 KB
/
nvmpi.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
88
89
90
#ifndef __NVMPI_H__
#define __NVMPI_H__
#include <stdlib.h>
#include <stdbool.h>
typedef struct nvmpictx nvmpictx;
typedef enum {
NV_PIX_NV12,
NV_PIX_YUV420
}nvPixFormat;
typedef struct _NVENCPARAM{
unsigned int width;
unsigned int height;
unsigned int profile;
unsigned int level;
unsigned int bitrate;
unsigned int peak_bitrate;
char enableLossless;
char mode_vbr;
char insert_spspps_idr;
unsigned int iframe_interval;
unsigned int idr_interval;
unsigned int fps_n;
unsigned int fps_d;
int capture_num;
unsigned int max_b_frames;
unsigned int refs;
unsigned int qmax;
unsigned int qmin;
unsigned int hw_preset_type;
} nvEncParam;
typedef struct _NVPACKET{
unsigned long flags;
unsigned long payload_size;
unsigned char *payload;
unsigned long pts;
} nvPacket;
typedef struct _NVFRAME{
unsigned long flags;
unsigned long payload_size[3];
unsigned char *payload[3];
unsigned int linesize[3];
nvPixFormat type;
unsigned int width;
unsigned int height;
time_t timestamp;
}nvFrame;
typedef enum {
NV_VIDEO_CodingUnused,
NV_VIDEO_CodingH264, /**< H.264 */
NV_VIDEO_CodingMPEG4, /**< MPEG-4 */
NV_VIDEO_CodingMPEG2, /**< MPEG-2 */
NV_VIDEO_CodingVP8, /**< VP8 */
NV_VIDEO_CodingVP9, /**< VP9 */
NV_VIDEO_CodingHEVC, /**< H.265/HEVC */
} nvCodingType;
#ifdef __cplusplus
extern "C" {
#endif
nvmpictx* nvmpi_create_decoder(nvCodingType codingType,nvPixFormat pixFormat);
int nvmpi_decoder_put_packet(nvmpictx* ctx,nvPacket* packet);
int nvmpi_decoder_get_frame(nvmpictx* ctx,nvFrame* frame,bool wait);
int nvmpi_decoder_close(nvmpictx* ctx);
nvmpictx* nvmpi_create_encoder(nvCodingType codingType,nvEncParam * param);
int nvmpi_encoder_put_frame(nvmpictx* ctx,nvFrame* frame);
int nvmpi_encoder_get_packet(nvmpictx* ctx,nvPacket* packet);
int nvmpi_encoder_close(nvmpictx* ctx);
#ifdef __cplusplus
}
#endif
#endif /*__NVMPI_H__*/