From patchwork Thu Sep 15 02:56:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 581 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp2974602vsd; Wed, 14 Sep 2016 20:06:42 -0700 (PDT) X-Received: by 10.194.155.100 with SMTP id vv4mr6033548wjb.56.1473908802192; Wed, 14 Sep 2016 20:06:42 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t194si349442wmd.56.2016.09.14.20.06.40; Wed, 14 Sep 2016 20:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org; dkim=neutral (body hash did not verify) header.i=@overt.org; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5ABC1689E52; Thu, 15 Sep 2016 06:06:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from rs224.mailgun.us (rs224.mailgun.us [209.61.151.224]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7952A689E24 for ; Thu, 15 Sep 2016 06:06:18 +0300 (EEST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=overt.org; q=dns/txt; s=k1; t=1473908789; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=LtKUJDdoBZDiS22tciYv3MASDTfI72IbHwSOyo+nWrw=; b=i3tUDV68Q0mjil/pseoa+GIjylrO66LhM0rlH9+jzSLoCfdkGyObatH8nY8kydLxXqfB2n6n paVU12EWyxiVNrdrBZNyQG3fqH4enpLR0aInS6EQQHVeYdiyP3cl/KP9bSDUEe1Mul/65Cc+ /TtXEsKHchb0jyDYDiIjNf4Wn9o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=overt.org; s=k1; q=dns; h=Sender: From: To: Cc: Subject: Date: Message-Id: In-Reply-To: References; b=YVRBuuwmUqqU5kUCFX2a8BCuuKhtlOaV98thGPV2tARhDamkSEAAATyzAin7N9pFrZzlEv ChvYfWwfgmVjI54Xtx0N4eiCs0nu8O9DLjoR9Ewh8pEmvZ/Mo2+OLD0EE1o6WOCgvKFWdFiu 424zeWZyIQylQpivyqiuge97PH6SY= X-Mailgun-Sending-Ip: 209.61.151.224 X-Mailgun-Sid: WyIyM2Q3MCIsICJmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZyIsICI0YTg5NjEiXQ== Received: from mail.overt.org (155.208.178.107.bc.googleusercontent.com [107.178.208.155]) by mxa.mailgun.org with ESMTP id 57da0dcf.7f7424285f80-in6; Thu, 15 Sep 2016 02:56:15 -0000 (UTC) Received: from authenticated-user (mail.overt.org [107.178.208.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 573BE600AF; Thu, 15 Sep 2016 02:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1473908175; bh=E/EVWuCbFzw+OmJdh6Vh5oejOm5HKCW6cu9PgQ4kbMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sEWYhbVv1Fe8m/Xg4NDNWqwH+jHrwGIp7D9fzNN1OSSB8TalDnfdvdz1G5rPY5XVU hlH0oK8jF1BVGuZQ14OOPboMHzvV29n5SwS0kPxKfodxwiKINhBs9xtbLMHwQfpFSV melW3QfhbnVOn4IGrm4lzX5N1q314U/F20JqLTiB+aVYy5Ht+9HD6nrnwiaCNUCr67 G6iyqThf6/j54NCv5tx/Ksx0Hd3kcIg6bUOrMysRhrnXQmaHy+qysyFp1YZwDBlpI0 96vj684hzYZ54WGxoCTGNeWD6B5JifRJrVS4yGxlMiiAq7xjPgjuSE8JQvj+DG1QkW ON6eNHPCqPcMQ== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Sep 2016 19:56:08 -0700 Message-Id: <1473908168-31888-3-git-send-email-philipl@overt.org> In-Reply-To: <1473908168-31888-1-git-send-email-philipl@overt.org> References: <1473908168-31888-1-git-send-email-philipl@overt.org> Subject: [FFmpeg-devel] [PATCH 2/2] cuvid: Check for non 420 chroma formats - they aren't supported X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Philip Langdale MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Despite the video parser seeming to correctly handle 422 and 444 chroma formats, the video decoder fails miserably to actually decode frames - even though no errors are ever returned; you just get frames showing unintialized garbage. Signed-off-by: Philip Langdale --- libavcodec/cuvid.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/cuvid.c b/libavcodec/cuvid.c index 880a572..8f3efec 100644 --- a/libavcodec/cuvid.c +++ b/libavcodec/cuvid.c @@ -137,6 +137,12 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form return 0; } + if (format->chroma_format != cudaVideoChromaFormat_420) { + av_log(avctx, AV_LOG_ERROR, "Chroma formats other than 420 are not supported\n"); + ctx->internal_error = AVERROR(EINVAL); + return 0; + } + avctx->coded_width = format->coded_width; avctx->coded_height = format->coded_height;