From patchwork Thu Aug 15 04:32:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 14518 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 4C2CB449D2C for ; Thu, 15 Aug 2019 07:33:18 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 21B0068A84A; Thu, 15 Aug 2019 07:33:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 47C1F6898A1 for ; Thu, 15 Aug 2019 07:33:10 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 21:33:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,387,1559545200"; d="scan'208";a="178360464" Received: from media_lj_kbl.sh.intel.com ([10.239.13.13]) by fmsmga007.fm.intel.com with ESMTP; 14 Aug 2019 21:33:07 -0700 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Thu, 15 Aug 2019 12:32:42 +0800 Message-Id: <20190815043242.20478-1-linjie.fu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] lavu/hwcontext_vaapi: provide detailed error msg 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..3fbeb4954e 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_ERROR, "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_ERROR, "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_ERROR, "Requested format is " + "not a valid output format.\n"); return AVERROR(EINVAL); }