[06/12] pixfmt: add a CUDA hwaccelled format

Message ID 1454413292-14686-6-git-send-email-anton@khirnov.net
State New
Headers show

Commit Message

Anton Khirnov Feb. 2, 2016, 11:41 a.m.
---
 libavutil/pixdesc.c | 4 ++++
 libavutil/pixfmt.h  | 2 ++
 2 files changed, 6 insertions(+)

Comments

Luca Barbato Feb. 2, 2016, 12:53 p.m. | #1
On 02/02/16 12:41, Anton Khirnov wrote:
> ---
>  libavutil/pixdesc.c | 4 ++++
>  libavutil/pixfmt.h  | 2 ++
>  2 files changed, 6 insertions(+)
> 

Ok.

Patch

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 9e7d8bd..74b945f 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1577,6 +1577,10 @@  static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         .name = "mmal",
         .flags = AV_PIX_FMT_FLAG_HWACCEL,
     },
+    [AV_PIX_FMT_CUDA] = {
+        .name = "cuda",
+        .flags = AV_PIX_FMT_FLAG_HWACCEL,
+    },
 };
 #if FF_API_PLUS1_MINUS1
 FF_ENABLE_DEPRECATION_WARNINGS
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 4e0c0d3..32090a6 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -217,6 +217,8 @@  enum AVPixelFormat {
 
     AV_PIX_FMT_D3D11VA_VLD,  ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer
 
+    AV_PIX_FMT_CUDA,
+
     AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
 };