From patchwork Wed Aug 14 09:24:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 14504 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 010E9448D76 for ; Wed, 14 Aug 2019 12:25:19 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CEBC068A42C; Wed, 14 Aug 2019 12:25:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0B1A36897FA for ; Wed, 14 Aug 2019 12:25:12 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 02:25:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,384,1559545200"; d="scan'208";a="376655259" Received: from media_lj_kbl.sh.intel.com ([10.239.13.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Aug 2019 02:25:10 -0700 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Aug 2019 17:24:45 +0800 Message-Id: <20190814092445.23653-1-linjie.fu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] lavu/hwcontext_vaapi: provide detailed warning if directly mapping fails 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: Linjie Fu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Detailed message could be helpful when using hwmap=mode=direct,format=xxx for both qsv and vaapi. Signed-off-by: Linjie Fu --- libavutil/hwcontext_vaapi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index cf117640f2..30c42e4385 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -747,19 +747,22 @@ static int vaapi_map_frame(AVHWFramesContext *hwfc, av_log(hwfc, AV_LOG_DEBUG, "Map surface %#x.\n", surface_id); if (!ctx->derive_works && (flags & AV_HWFRAME_MAP_DIRECT)) { - // Requested direct mapping but it is not possible. + av_log(hwfc, AV_LOG_WARNING, "Requested direct mapping but " + "it is not possible.\n"); return AVERROR(EINVAL); } if (dst->format == AV_PIX_FMT_NONE) dst->format = hwfc->sw_format; if (dst->format != hwfc->sw_format && (flags & AV_HWFRAME_MAP_DIRECT)) { - // Requested direct mapping but the formats do not match. + av_log(hwfc, AV_LOG_WARNING, "Requested direct mapping but " + "the formats do not match.\n"); return AVERROR(EINVAL); } err = vaapi_get_image_format(hwfc->device_ctx, dst->format, &image_format); if (err < 0) { - // Requested format is not a valid output format. + av_log(hwfc, AV_LOG_WARNING, "Requested format is " + "not a valid output format.\n"); return AVERROR(EINVAL); }