From 118beda355076acf03611e5c8bc147a9c634e54f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 30 Jan 2016 22:06:47 +0100 Subject: 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. --- libavcodec/nvenc.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'libavcodec/nvenc.h') 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; -- cgit v1.2.3