summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-01-30 22:06:47 +0100
committerAnton Khirnov <anton@khirnov.net>2016-02-12 10:19:40 +0100
commit118beda355076acf03611e5c8bc147a9c634e54f (patch)
treef234664983a377ded267f53cf10e5f19b8fb06bb /libavcodec/nvenc.h
parent28259c13db784d4b4175ca323dc1eeffec7f919b (diff)
nvenc: merge input and output surface structs
An input frame always corresponds to exactly one output packet, so there is no point in complicating the situation by managing them separately.
Diffstat (limited to 'libavcodec/nvenc.h')
-rw-r--r--libavcodec/nvenc.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index 7b1e8a5596..6edca75195 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -27,17 +27,12 @@
#include "avcodec.h"
-typedef struct NVENCInputSurface {
- NV_ENC_INPUT_PTR in;
+typedef struct NVENCFrame {
+ NV_ENC_INPUT_PTR in;
+ NV_ENC_OUTPUT_PTR out;
NV_ENC_BUFFER_FORMAT format;
int locked;
-} NVENCInputSurface;
-
-typedef struct NVENCOutputSurface {
- NV_ENC_OUTPUT_PTR out;
- NVENCInputSurface *in;
- int busy;
-} NVENCOutputSurface;
+} NVENCFrame;
typedef CUresult(CUDAAPI *PCUINIT)(unsigned int Flags);
typedef CUresult(CUDAAPI *PCUDEVICEGETCOUNT)(int *count);
@@ -107,8 +102,7 @@ typedef struct NVENCContext {
CUcontext cu_context;
int nb_surfaces;
- NVENCInputSurface *in;
- NVENCOutputSurface *out;
+ NVENCFrame *frames;
AVFifoBuffer *timestamps;
AVFifoBuffer *pending, *ready;