[FFmpeg-devel] [PATCH] lavc/cuvid: fail early if GPU can't handle video parameters
Pavel Koshevoy
pkoshevoy at gmail.com
Sat Jan 21 20:05:37 EET 2017
On Thu, Jan 12, 2017 at 10:32 AM, Timo Rothenpieler
<timo at rothenpieler.org> wrote:
> On 1/9/2017 7:22 PM, pkoshevoy at gmail.com wrote:
>> From: Pavel Koshevoy <pkoshevoy at gmail.com>
<snip>
>> enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_CUDA,
>> AV_PIX_FMT_NV12,
>> AV_PIX_FMT_NONE };
>>
>> + enum AVPixelFormat probed_pix_fmt = (avctx->pix_fmt < 0 ?
>
> Shouldn't this be <= 0? If unset it will most likely be 0.
fixed and resubmitted in patch v4.
>> + AV_PIX_FMT_YUV420P :
>> + avctx->pix_fmt);
>> +
>> + ret = convert_to_cuda_video_chroma_format(probed_pix_fmt, &probed_chroma_format);
>> + if (ret < 0) {
>> + // pixel format is not supported:
>
> Printing an error here would be better, instead of failing init without
> any indication what went wrong.
added an av_log call and resubmitted in patch v4.
>> + return ret;
>> + }
>> + probed_width = avctx->coded_width ? avctx->coded_width : 1280;
>> + probed_height = avctx->coded_height ? avctx->coded_height : 720;
>> +
Thank you,
Pavel.
More information about the ffmpeg-devel
mailing list