-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathencoder.h
More file actions
41 lines (29 loc) · 817 Bytes
/
encoder.h
File metadata and controls
41 lines (29 loc) · 817 Bytes
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
#ifndef NVCODEC_PYTHON_VIDEO_ENCODER_H
#define NVCODEC_PYTHON_VIDEO_ENCODER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <cuda.h>
#include "cuvid/nvcuvid.h"
#include <libavcodec/avcodec.h>
#ifdef __cplusplus
}
#endif
typedef struct
{
CUcontext cuContext;
void* enc;
}videoEncoder;
typedef videoEncoder* videoEncoderHandle;
typedef struct
{
uint8_t* data;
int size;
}videoEncodedBuffer;
videoEncoderHandle videoEncoder_init(int width, int height, char* params);
int videoEncoder_destroy(videoEncoderHandle handle);
videoEncodedBuffer* videoEncoder_encode(videoEncoderHandle handle, u_int8_t* in);
videoEncodedBuffer* videoEncoder_encode_end(videoEncoderHandle handle);
void videoEncodedBuffer_destory(videoEncodedBuffer**);
videoEncodedBuffer* videoEncodedBuffer_init(int size);
#endif