summaryrefslogtreecommitdiff
path: root/libavcodec/cuviddec.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-10-26 00:18:40 +0100
committerMark Thompson <sw@jkqxz.net>2017-11-26 21:35:53 +0000
commit758fbc54fef2f31957b5c5f22e05e5fd9b04f631 (patch)
tree45b66ac7797cec7968add561498acf75cc4871c2 /libavcodec/cuviddec.c
parent24cc0a53e99e281b0ff502e82e7cf857111eca3f (diff)
lavc: Add hardware config metadata for decoders supporting hardware output
This includes a pointer to the associated hwaccel for decoders using hwaccels - these will be used later to implement the hwaccel setup without needing a global list. Also added is a new file listing all hwaccels as external declarations - this will be used later to generate the hwaccel list at configure time.
Diffstat (limited to 'libavcodec/cuviddec.c')
-rw-r--r--libavcodec/cuviddec.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 806dab2074..3bd2409ea2 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -32,6 +32,7 @@
#include "avcodec.h"
#include "decode.h"
+#include "hwaccel.h"
#include "internal.h"
typedef struct CuvidContext
@@ -1094,6 +1095,19 @@ static const AVOption options[] = {
{ NULL }
};
+static const AVCodecHWConfigInternal *cuvid_hw_configs[] = {
+ &(const AVCodecHWConfigInternal) {
+ .public = {
+ .pix_fmt = AV_PIX_FMT_CUDA,
+ .methods = AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX |
+ AV_CODEC_HW_CONFIG_METHOD_INTERNAL,
+ .device_type = AV_HWDEVICE_TYPE_CUDA
+ },
+ .hwaccel = NULL,
+ },
+ NULL
+};
+
#define DEFINE_CUVID_CODEC(x, X) \
static const AVClass x##_cuvid_class = { \
.class_name = #x "_cuvid", \
@@ -1127,6 +1141,7 @@ static const AVOption options[] = {
AV_PIX_FMT_P010, \
AV_PIX_FMT_P016, \
AV_PIX_FMT_NONE }, \
+ .hw_configs = cuvid_hw_configs, \
};
#if CONFIG_HEVC_CUVID_DECODER