avcodec/nvdec: Implement mjpeg nvdec hwaccel
[ffmpeg.git] / libavcodec / mjpegdec.c
index 939f284..beef174 100644 (file)
@@ -650,6 +650,9 @@ unk_pixfmt:
         s->avctx->pix_fmt = s->hwaccel_pix_fmt;
     } else {
         enum AVPixelFormat pix_fmts[] = {
         s->avctx->pix_fmt = s->hwaccel_pix_fmt;
     } else {
         enum AVPixelFormat pix_fmts[] = {
+#if CONFIG_MJPEG_NVDEC_HWACCEL
+            AV_PIX_FMT_CUDA,
+#endif
 #if CONFIG_MJPEG_VAAPI_HWACCEL
             AV_PIX_FMT_VAAPI,
 #endif
 #if CONFIG_MJPEG_VAAPI_HWACCEL
             AV_PIX_FMT_VAAPI,
 #endif
@@ -2780,6 +2783,9 @@ AVCodec ff_mjpeg_decoder = {
     .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE |
                       FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
     .hw_configs     = (const AVCodecHWConfigInternal*[]) {
     .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE |
                       FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
     .hw_configs     = (const AVCodecHWConfigInternal*[]) {
+#if CONFIG_MJPEG_NVDEC_HWACCEL
+                        HWACCEL_NVDEC(mjpeg),
+#endif
 #if CONFIG_MJPEG_VAAPI_HWACCEL
                         HWACCEL_VAAPI(mjpeg),
 #endif
 #if CONFIG_MJPEG_VAAPI_HWACCEL
                         HWACCEL_VAAPI(mjpeg),
 #endif