[FFmpeg-cvslog] avutil/hwcontext_cuda: add support for nvenc rgb formats

Timo Rothenpieler git at videolan.org
Thu May 10 01:47:40 EEST 2018


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Wed May  9 18:59:05 2018 +0200| [41a18982d092505ffb6af7d02a3ff62eaf2d6d63] | committer: Timo Rothenpieler

avutil/hwcontext_cuda: add support for nvenc rgb formats

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41a18982d092505ffb6af7d02a3ff62eaf2d6d63
---

 libavutil/hwcontext_cuda.c | 11 +++++++++++
 libavutil/version.h        |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
index 668293bffc..b90c29a51a 100644
--- a/libavutil/hwcontext_cuda.c
+++ b/libavutil/hwcontext_cuda.c
@@ -38,6 +38,8 @@ static const enum AVPixelFormat supported_formats[] = {
     AV_PIX_FMT_P010,
     AV_PIX_FMT_P016,
     AV_PIX_FMT_YUV444P16,
+    AV_PIX_FMT_0RGB32,
+    AV_PIX_FMT_0BGR32,
 };
 
 static int cuda_frames_get_constraints(AVHWDeviceContext *ctx,
@@ -146,6 +148,10 @@ static int cuda_frames_init(AVHWFramesContext *ctx)
         case AV_PIX_FMT_YUV444P16:
             size = aligned_width * ctx->height * 6;
             break;
+        case AV_PIX_FMT_0RGB32:
+        case AV_PIX_FMT_0BGR32:
+            size = aligned_width * ctx->height * 4;
+            break;
         default:
             av_log(ctx, AV_LOG_ERROR, "BUG: Pixel format missing from size calculation.");
             return AVERROR_BUG;
@@ -201,6 +207,11 @@ static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
         frame->linesize[1] = aligned_width;
         frame->linesize[2] = aligned_width;
         break;
+    case AV_PIX_FMT_0BGR32:
+    case AV_PIX_FMT_0RGB32:
+        frame->data[0]     = frame->buf[0]->data;
+        frame->linesize[0] = aligned_width * 4;
+        break;
     default:
         av_frame_unref(frame);
         return AVERROR_BUG;
diff --git a/libavutil/version.h b/libavutil/version.h
index 186fe0794d..44bdebdc93 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR  56
 #define LIBAVUTIL_VERSION_MINOR  18
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MICRO 102
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list