diff mbox series

[FFmpeg-devel,v2,1/2] avutil/hwcontext_cuda: add YUVA420P pixel format

Message ID 82d89a9a6b81966e8cb0ca75bcf000ed82699961.1584536595.git.yyyaroslav@gmail.com
State Accepted
Headers show
Series Overlay Cuda Filter
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Yaroslav Pogrebnyak March 19, 2020, 4:02 a.m. UTC
Signed-off-by: Yaroslav Pogrebnyak <yyyaroslav@gmail.com>
---
 libavutil/hwcontext_cuda.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Timo Rothenpieler March 19, 2020, 3:39 p.m. UTC | #1
applied
diff mbox series

Patch

diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
index a87c280cf7..3c4e36dde7 100644
--- a/libavutil/hwcontext_cuda.c
+++ b/libavutil/hwcontext_cuda.c
@@ -39,6 +39,7 @@  typedef struct CUDAFramesContext {
 static const enum AVPixelFormat supported_formats[] = {
     AV_PIX_FMT_NV12,
     AV_PIX_FMT_YUV420P,
+    AV_PIX_FMT_YUVA420P,
     AV_PIX_FMT_YUV444P,
     AV_PIX_FMT_P010,
     AV_PIX_FMT_P016,
@@ -274,7 +275,7 @@  static int cuda_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
             .srcPitch      = src->linesize[i],
             .dstPitch      = dst->linesize[i],
             .WidthInBytes  = FFMIN(src->linesize[i], dst->linesize[i]),
-            .Height        = src->height >> (i ? priv->shift_height : 0),
+            .Height        = src->height >> ((i == 0 || i == 3) ? 0 : priv->shift_height),
         };
 
         ret = CHECK_CU(cu->cuMemcpy2DAsync(&cpy, hwctx->stream));