summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/nvenc.h')
-rw-r--r--libavcodec/nvenc.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index a0020377e6..c8f0745a19 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -29,8 +29,14 @@
#include "avcodec.h"
+#define MAX_REGISTERED_FRAMES 64
+
typedef struct NVENCFrame {
NV_ENC_INPUT_PTR in;
+ AVFrame *in_ref;
+ NV_ENC_MAP_INPUT_RESOURCE in_map;
+ int reg_idx;
+
NV_ENC_OUTPUT_PTR out;
NV_ENC_BUFFER_FORMAT format;
int locked;
@@ -104,12 +110,24 @@ typedef struct NVENCContext {
NV_ENC_CONFIG config;
CUcontext cu_context;
+ CUcontext cu_context_internal;
int nb_surfaces;
NVENCFrame *frames;
AVFifoBuffer *timestamps;
AVFifoBuffer *pending, *ready;
+ struct {
+ CUdeviceptr ptr;
+ NV_ENC_REGISTERED_PTR regptr;
+ int mapped;
+ } registered_frames[MAX_REGISTERED_FRAMES];
+ int nb_registered_frames;
+
+ /* the actual data pixel format, different from
+ * AVCodecContext.pix_fmt when using hwaccel frames on input */
+ enum AVPixelFormat data_pix_fmt;
+
/* timestamps of the first two frames, for computing the first dts
* when b-frames are present */
int64_t initial_pts[2];