From patchwork Wed Feb 20 02:58:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 12114 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 670464488EE for ; Wed, 20 Feb 2019 12:13:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 544DF68829F; Wed, 20 Feb 2019 12:13:39 +0200 (EET) 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 4C2FF680349 for ; Wed, 20 Feb 2019 12:13:32 +0200 (EET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2019 02:13:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,390,1544515200"; d="scan'208";a="125823137" Received: from blue-kbl.sh.intel.com ([10.239.13.16]) by fmsmga008.fm.intel.com with ESMTP; 20 Feb 2019 02:13:26 -0800 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Wed, 20 Feb 2019 10:58:17 +0800 Message-Id: <20190220025821.31346-3-zhong.li@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190220025821.31346-1-zhong.li@intel.com> References: <20190220025821.31346-1-zhong.li@intel.com> Subject: [FFmpeg-devel] [PATCH v2 2/6] lavc/qsv: make function qsv_map_fourcc() can be called externally 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: Zhong Li MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Zhong Li --- libavcodec/qsv.c | 4 ++-- libavcodec/qsv_internal.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 224bc00ce4..711fd3df1e 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -158,7 +158,7 @@ int ff_qsv_print_warning(void *log_ctx, mfxStatus err, return ret; } -static enum AVPixelFormat qsv_map_fourcc(uint32_t fourcc) +enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc) { switch (fourcc) { case MFX_FOURCC_NV12: return AV_PIX_FMT_NV12; @@ -469,7 +469,7 @@ static mfxStatus qsv_frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, frames_hwctx = frames_ctx->hwctx; frames_ctx->format = AV_PIX_FMT_QSV; - frames_ctx->sw_format = qsv_map_fourcc(i->FourCC); + frames_ctx->sw_format = ff_qsv_map_fourcc(i->FourCC); frames_ctx->width = i->Width; frames_ctx->height = i->Height; frames_ctx->initial_pool_size = req->NumFrameSuggested; diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h index 51c23d5c7b..c432ac8a3f 100644 --- a/libavcodec/qsv_internal.h +++ b/libavcodec/qsv_internal.h @@ -91,6 +91,8 @@ int ff_qsv_print_warning(void *log_ctx, mfxStatus err, int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id); int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile); +enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc); + int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc); enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type);