case AV_CODEC_ID_HEVC: return cudaVideoCodec_HEVC;
case AV_CODEC_ID_MPEG1VIDEO: return cudaVideoCodec_MPEG1;
case AV_CODEC_ID_MPEG2VIDEO: return cudaVideoCodec_MPEG2;
+ case AV_CODEC_ID_MPEG4: return cudaVideoCodec_MPEG4;
case AV_CODEC_ID_VC1: return cudaVideoCodec_VC1;
+ case AV_CODEC_ID_VP8: return cudaVideoCodec_VP8;
case AV_CODEC_ID_VP9: return cudaVideoCodec_VP9;
case AV_CODEC_ID_WMV3: return cudaVideoCodec_VC1;
}
caps.eChromaFormat = params->ChromaFormat;
caps.nBitDepthMinus8 = params->bitDepthMinus8;
+ if (!decoder->cvdl->cuvidGetDecoderCaps) {
+ av_log(logctx, AV_LOG_WARNING, "Used Nvidia driver is too old to perform a capability check.\n");
+ av_log(logctx, AV_LOG_WARNING, "The minimum required version is "
+#if defined(_WIN32) || defined(__CYGWIN__)
+ "378.66"
+#else
+ "378.13"
+#endif
+ ". Continuing blind.\n");
+ return 0;
+ }
+
err = decoder->cvdl->cuvidGetDecoderCaps(&caps);
if (err != CUDA_SUCCESS) {
av_log(logctx, AV_LOG_ERROR, "Failed querying decoder capabilities\n");
decoder->cuda_ctx = device_hwctx->cuda_ctx;
decoder->cudl = device_hwctx->internal->cuda_dl;
- ret = cuvid_load_functions(&decoder->cvdl);
+ ret = cuvid_load_functions(&decoder->cvdl, logctx);
if (ret < 0) {
av_log(logctx, AV_LOG_ERROR, "Failed loading nvcuvid.\n");
goto fail;
}
frames_ctx->format = AV_PIX_FMT_CUDA;
- frames_ctx->width = avctx->coded_width;
- frames_ctx->height = avctx->coded_height;
+ frames_ctx->width = (avctx->coded_width + 1) & ~1;
+ frames_ctx->height = (avctx->coded_height + 1) & ~1;
frames_ctx->initial_pool_size = dpb_size;
switch (sw_desc->comp[0].depth) {